[LLIMMgr/LLIMPanel Revision] LLFloaterIMPanel constructor combination and removal of LLFloaterIMPanel::init()

Also changes Session Label to Log Label because that's really what it is at this point
Also rearranges members in LLFloaterIMPanel, and war on BOOLs
Also removes mSessionInitialTargetIDs because it's no longer needed outside of the constructor
This commit is contained in:
Inusaito Sayori
2013-10-10 03:26:51 -04:00
parent 260723f2a4
commit d04820507c
4 changed files with 98 additions and 229 deletions

View File

@@ -278,87 +278,46 @@ bool send_start_session_messages(
// LLFloaterIMPanel // LLFloaterIMPanel
// //
LLFloaterIMPanel::LLFloaterIMPanel( LLFloaterIMPanel::LLFloaterIMPanel(
const std::string& session_label, const std::string& log_label,
const LLUUID& session_id, const LLUUID& session_id,
const LLUUID& other_participant_id, const LLUUID& other_participant_id,
EInstantMessage dialog) : const EInstantMessage& dialog,
LLFloater(session_label, LLRect(), session_label), const LLDynamicArray<LLUUID>& ids) :
LLFloater(log_label, LLRect(), log_label),
mStartCallOnInitialize(false),
mInputEditor(NULL), mInputEditor(NULL),
mHistoryEditor(NULL), mHistoryEditor(NULL),
mSessionUUID(session_id), mSessionInitialized(false),
mVoiceChannel(NULL),
mSessionInitialized(FALSE),
mSessionStartMsgPos(0), mSessionStartMsgPos(0),
mSessionType(P2P_SESSION),
mSessionUUID(session_id),
mLogLabel(log_label),
mQueuedMsgsForInit(),
mOtherParticipantUUID(other_participant_id), mOtherParticipantUUID(other_participant_id),
mDialog(dialog), mDialog(dialog),
mTyping(FALSE), mTyping(false),
mOtherTyping(FALSE),
mTypingLineStartIndex(0), mTypingLineStartIndex(0),
mSentTypingState(TRUE), mOtherTyping(false),
mOtherTypingName(),
mNumUnreadMessages(0), mNumUnreadMessages(0),
mShowSpeakersOnConnect(TRUE), mSentTypingState(true),
mStartCallOnInitialize(false), mShowSpeakersOnConnect(true),
mTextIMPossible(TRUE), mDing(false),
mProfileButtonEnabled(TRUE), mRPMode(false),
mCallBackEnabled(TRUE), mTextIMPossible(true),
mCallBackEnabled(true),
mSpeakers(NULL), mSpeakers(NULL),
mSpeakerPanel(NULL), mSpeakerPanel(NULL),
mFirstKeystrokeTimer(),
mLastKeystrokeTimer()
{
if(mOtherParticipantUUID.isNull())
{
llwarns << "Other participant is NULL" << llendl;
}
init(session_label);
}
LLFloaterIMPanel::LLFloaterIMPanel(
const std::string& session_label,
const LLUUID& session_id,
const LLUUID& other_participant_id,
const LLDynamicArray<LLUUID>& ids,
EInstantMessage dialog) :
LLFloater(session_label, LLRect(), session_label),
mInputEditor(NULL),
mHistoryEditor(NULL),
mSessionUUID(session_id),
mVoiceChannel(NULL), mVoiceChannel(NULL),
mSessionInitialized(FALSE),
mSessionStartMsgPos(0),
mOtherParticipantUUID(other_participant_id),
mDialog(dialog),
mTyping(FALSE),
mOtherTyping(FALSE),
mTypingLineStartIndex(0),
mSentTypingState(TRUE),
mShowSpeakersOnConnect(TRUE),
mStartCallOnInitialize(false),
mTextIMPossible(TRUE),
mProfileButtonEnabled(TRUE),
mCallBackEnabled(TRUE),
mSpeakers(NULL),
mSpeakerPanel(NULL),
mFirstKeystrokeTimer(), mFirstKeystrokeTimer(),
mLastKeystrokeTimer() mLastKeystrokeTimer()
{ {
if(mOtherParticipantUUID.isNull()) if (mOtherParticipantUUID.isNull())
{ {
llwarns << "Other participant is NULL" << llendl; llwarns << "Other participant is NULL" << llendl;
} }
mSessionInitialTargetIDs = ids;
init(session_label);
}
void LLFloaterIMPanel::init(const std::string& session_label)
{
// set P2P type by default // set P2P type by default
mSessionType = P2P_SESSION;
mSessionLabel = session_label;
// [Ansariel: Display name support] // [Ansariel: Display name support]
mProfileButtonEnabled = FALSE; mProfileButtonEnabled = FALSE;
@@ -429,7 +388,7 @@ void LLFloaterIMPanel::init(const std::string& session_label)
&getFactoryMap(), &getFactoryMap(),
FALSE); FALSE);
setTitle(mSessionLabel); setTitle(mLogLabel);
// [Ansariel: Display name support] // [Ansariel: Display name support]
if (mProfileButtonEnabled) if (mProfileButtonEnabled)
@@ -444,7 +403,7 @@ void LLFloaterIMPanel::init(const std::string& session_label)
if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
{ {
LLLogChat::loadHistory(mSessionLabel, LLLogChat::loadHistory(mLogLabel,
&chatFromLogFile, &chatFromLogFile,
(void *)this); (void *)this);
} }
@@ -454,13 +413,12 @@ void LLFloaterIMPanel::init(const std::string& session_label)
if ( !send_start_session_messages( if ( !send_start_session_messages(
mSessionUUID, mSessionUUID,
mOtherParticipantUUID, mOtherParticipantUUID,
mSessionInitialTargetIDs, ids,
mDialog) ) mDialog) )
{ {
//we don't need to need to wait for any responses //we don't need to need to wait for any responses
//so we're already initialized //so we're already initialized
mSessionInitialized = TRUE; mSessionInitialized = true;
mSessionStartMsgPos = 0;
} }
else else
{ {
@@ -468,8 +426,7 @@ void LLFloaterIMPanel::init(const std::string& session_label)
LLUIString session_start = sSessionStartString; LLUIString session_start = sSessionStartString;
session_start.setArg("[NAME]", getTitle()); session_start.setArg("[NAME]", getTitle());
mSessionStartMsgPos = mSessionStartMsgPos = mHistoryEditor->getWText().length();
mHistoryEditor->getWText().length();
addHistoryLine( addHistoryLine(
session_start, session_start,
@@ -489,6 +446,7 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLUUID&, const LLAvatarName& ava
std::string title; std::string title;
LLAvatarNameCache::getPNSName(avatar_name, title); LLAvatarNameCache::getPNSName(avatar_name, title);
setTitle(title); setTitle(title);
// Singu Note: We could set tab name here, too now.
} }
LLFloaterIMPanel::~LLFloaterIMPanel() LLFloaterIMPanel::~LLFloaterIMPanel()
@@ -531,9 +489,6 @@ BOOL LLFloaterIMPanel::postBuild()
if (checkRequirements()) if (checkRequirements())
{ {
mDing = false;
mRPMode = false;
mInputEditor = getChild<LLLineEditor>("chat_editor"); mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) ); mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) );
mFocusLostSignal = mInputEditor->setFocusLostCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusLost, this) ); mFocusLostSignal = mInputEditor->setFocusLostCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusLost, this) );
@@ -629,7 +584,7 @@ void LLFloaterIMPanel::draw()
{ {
LLViewerRegion* region = gAgent.getRegion(); LLViewerRegion* region = gAgent.getRegion();
BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") bool enable_connect = (region && !region->getCapability("ChatSessionRequest").empty())
&& mSessionInitialized && mSessionInitialized
&& LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->voiceEnabled()
&& mCallBackEnabled; && mCallBackEnabled;
@@ -661,7 +616,6 @@ void LLFloaterIMPanel::draw()
if (mShowSpeakersOnConnect && mVoiceChannel->isActive()) if (mShowSpeakersOnConnect && mVoiceChannel->isActive())
{ {
childSetVisible("active_speakers_panel", true); childSetVisible("active_speakers_panel", true);
mShowSpeakersOnConnect = FALSE;
} }
if (LLUICtrl* ctrl = findChild<LLUICtrl>("toggle_active_speakers_btn")) if (LLUICtrl* ctrl = findChild<LLUICtrl>("toggle_active_speakers_btn"))
ctrl->setValue(getChildView("active_speakers_panel")->getVisible()); ctrl->setValue(getChildView("active_speakers_panel")->getVisible());
@@ -671,7 +625,7 @@ void LLFloaterIMPanel::draw()
// Time out if user hasn't typed for a while. // Time out if user hasn't typed for a while.
if (mLastKeystrokeTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS) if (mLastKeystrokeTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS)
{ {
setTyping(FALSE); setTyping(false);
} }
// If we are typing, and it's been a little while, send the // If we are typing, and it's been a little while, send the
@@ -679,8 +633,8 @@ void LLFloaterIMPanel::draw()
if (!mSentTypingState if (!mSentTypingState
&& mFirstKeystrokeTimer.getElapsedTimeF32() > 1.f) && mFirstKeystrokeTimer.getElapsedTimeF32() > 1.f)
{ {
sendTypingState(TRUE); sendTypingState(true);
mSentTypingState = TRUE; mSentTypingState = true;
} }
} }
@@ -864,9 +818,9 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
// [Ansariel: Display name support] // [Ansariel: Display name support]
// Floater title contains display name -> bad idea to use that as filename // Floater title contains display name -> bad idea to use that as filename
// mSessionLabel, however, should still be the old legacy name // mLogLabel, however, is the old legacy name
//LLLogChat::saveHistory(getTitle(),histstr); //LLLogChat::saveHistory(getTitle(),histstr);
LLLogChat::saveHistory(mSessionLabel, histstr); LLLogChat::saveHistory(mLogLabel, histstr);
// [/Ansariel: Display name support] // [/Ansariel: Display name support]
} }
@@ -895,7 +849,7 @@ void LLFloaterIMPanel::setVisible(BOOL b)
} }
void LLFloaterIMPanel::setInputFocus( BOOL b ) void LLFloaterIMPanel::setInputFocus(bool b)
{ {
mInputEditor->setFocus( b ); mInputEditor->setFocus( b );
} }
@@ -1024,7 +978,7 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop)
return rv; return rv;
} }
BOOL LLFloaterIMPanel::isInviteAllowed() const bool LLFloaterIMPanel::isInviteAllowed() const
{ {
return ( (IM_SESSION_CONFERENCE_START == mDialog) return ( (IM_SESSION_CONFERENCE_START == mDialog)
@@ -1093,7 +1047,7 @@ void LLFloaterIMPanel::onClickHistory()
{ {
// [Ansariel: Display name support] // [Ansariel: Display name support]
//show_log_browser(getTitle(), mOtherParticipantUUID.asString()); //show_log_browser(getTitle(), mOtherParticipantUUID.asString());
show_log_browser(mSessionLabel, mOtherParticipantUUID.asString()); show_log_browser(mLogLabel, mOtherParticipantUUID.asString());
// [/Ansariel: Display name support] // [/Ansariel: Display name support]
} }
} }
@@ -1115,21 +1069,13 @@ void LLFloaterIMPanel::onInputEditorFocusLost()
void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller) void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller)
{ {
std::string text = caller->getText(); // Deleting all text counts as stopping typing.
if (!text.empty()) setTyping(!caller->getText().empty());
{
setTyping(TRUE);
}
else
{
// Deleting all text counts as stopping typing.
setTyping(FALSE);
}
} }
void LLFloaterIMPanel::onClose(bool app_quitting) void LLFloaterIMPanel::onClose(bool app_quitting)
{ {
setTyping(FALSE); setTyping(false);
if(mSessionUUID.notNull()) if(mSessionUUID.notNull())
{ {
@@ -1429,8 +1375,8 @@ LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_E
// Don't need to actually send the typing stop message, the other // Don't need to actually send the typing stop message, the other
// client will infer it from receiving the message. // client will infer it from receiving the message.
mTyping = FALSE; mTyping = false;
mSentTypingState = TRUE; mSentTypingState = true;
} }
void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update) void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update)
@@ -1439,15 +1385,15 @@ void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update)
session_update.has("moderated_mode") && session_update.has("moderated_mode") &&
session_update["moderated_mode"].has("voice") ) session_update["moderated_mode"].has("voice") )
{ {
BOOL voice_moderated = session_update["moderated_mode"]["voice"]; bool voice_moderated = session_update["moderated_mode"]["voice"];
if (voice_moderated) if (voice_moderated)
{ {
setTitle(mSessionLabel + std::string(" ") + getString("moderated_chat_label")); setTitle(mLogLabel + std::string(" ") + getString("moderated_chat_label"));
} }
else else
{ {
setTitle(mSessionLabel); setTitle(mLogLabel);
} }
@@ -1460,18 +1406,16 @@ void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id)
{ {
mSessionUUID = session_id; mSessionUUID = session_id;
mVoiceChannel->updateSessionID(session_id); mVoiceChannel->updateSessionID(session_id);
mSessionInitialized = TRUE; mSessionInitialized = true;
//we assume the history editor hasn't moved at all since //we assume the history editor hasn't moved at all since
//we added the starting session message //we added the starting session message
//so, we count how many characters to remove //so, we count how many characters to remove
S32 chars_to_remove = mHistoryEditor->getWText().length() - S32 chars_to_remove = mHistoryEditor->getWText().length() - mSessionStartMsgPos;
mSessionStartMsgPos;
mHistoryEditor->removeTextFromEnd(chars_to_remove); mHistoryEditor->removeTextFromEnd(chars_to_remove);
//and now, send the queued msg //and now, send the queued msg
LLSD::array_iterator iter; for (LLSD::array_iterator iter = mQueuedMsgsForInit.beginArray();
for ( iter = mQueuedMsgsForInit.beginArray();
iter != mQueuedMsgsForInit.endArray(); iter != mQueuedMsgsForInit.endArray();
++iter) ++iter)
{ {
@@ -1489,7 +1433,7 @@ void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id)
} }
} }
void LLFloaterIMPanel::setTyping(BOOL typing) void LLFloaterIMPanel::setTyping(bool typing)
{ {
if (typing) if (typing)
{ {
@@ -1502,7 +1446,7 @@ void LLFloaterIMPanel::setTyping(BOOL typing)
mFirstKeystrokeTimer.reset(); mFirstKeystrokeTimer.reset();
// Will send typing state after a short delay. // Will send typing state after a short delay.
mSentTypingState = FALSE; mSentTypingState = false;
} }
mSpeakers->setSpeakerTyping(gAgent.getID(), TRUE); mSpeakers->setSpeakerTyping(gAgent.getID(), TRUE);
@@ -1512,8 +1456,8 @@ void LLFloaterIMPanel::setTyping(BOOL typing)
if (mTyping) if (mTyping)
{ {
// you just stopped typing, send state immediately // you just stopped typing, send state immediately
sendTypingState(FALSE); sendTypingState(false);
mSentTypingState = TRUE; mSentTypingState = true;
} }
mSpeakers->setSpeakerTyping(gAgent.getID(), FALSE); mSpeakers->setSpeakerTyping(gAgent.getID(), FALSE);
} }
@@ -1521,7 +1465,7 @@ void LLFloaterIMPanel::setTyping(BOOL typing)
mTyping = typing; mTyping = typing;
} }
void LLFloaterIMPanel::sendTypingState(BOOL typing) void LLFloaterIMPanel::sendTypingState(bool typing)
{ {
if(gSavedSettings.getBOOL("AscentHideTypingNotification")) if(gSavedSettings.getBOOL("AscentHideTypingNotification"))
return; return;
@@ -1547,7 +1491,7 @@ void LLFloaterIMPanel::sendTypingState(BOOL typing)
} }
void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, BOOL typing) void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, bool typing)
{ {
if (typing) if (typing)
{ {
@@ -1574,7 +1518,7 @@ void LLFloaterIMPanel::addTypingIndicator(const std::string &name)
typing_start.setArg("[NAME]", name); typing_start.setArg("[NAME]", name);
addHistoryLine(typing_start, gSavedSettings.getColor4("SystemChatColor"), false); addHistoryLine(typing_start, gSavedSettings.getColor4("SystemChatColor"), false);
mOtherTypingName = name; mOtherTypingName = name;
mOtherTyping = TRUE; mOtherTyping = true;
} }
// MBW -- XXX -- merge from release broke this (argument to this function changed from an LLIMInfo to a name) // MBW -- XXX -- merge from release broke this (argument to this function changed from an LLIMInfo to a name)
// Richard will fix. // Richard will fix.
@@ -1587,7 +1531,7 @@ void LLFloaterIMPanel::removeTypingIndicator(const LLIMInfo* im_info)
if (mOtherTyping) if (mOtherTyping)
{ {
// Must do this first, otherwise addHistoryLine calls us again. // Must do this first, otherwise addHistoryLine calls us again.
mOtherTyping = FALSE; mOtherTyping = false;
S32 chars_to_remove = mHistoryEditor->getWText().length() - mTypingLineStartIndex; S32 chars_to_remove = mHistoryEditor->getWText().length() - mTypingLineStartIndex;
mHistoryEditor->removeTextFromEnd(chars_to_remove); mHistoryEditor->removeTextFromEnd(chars_to_remove);
@@ -1710,7 +1654,7 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id)
LLPointer<LLSpeaker> speakerp = mSpeakers->findSpeaker(speaker_id); LLPointer<LLSpeaker> speakerp = mSpeakers->findSpeaker(speaker_id);
return speakerp && speakerp->mIsModerator; return speakerp && speakerp->mIsModerator;
} }
return FALSE; return false;
} }
BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash )

View File

@@ -55,15 +55,11 @@ public:
// the default. For example, if you open a session though a // the default. For example, if you open a session though a
// calling card, a new session id will be generated, but the // calling card, a new session id will be generated, but the
// target_id will be the agent referenced by the calling card. // target_id will be the agent referenced by the calling card.
LLFloaterIMPanel(const std::string& session_label, LLFloaterIMPanel(const std::string& log_label,
const LLUUID& session_id, const LLUUID& session_id,
const LLUUID& target_id, const LLUUID& target_id,
EInstantMessage dialog); const EInstantMessage& dialog,
LLFloaterIMPanel(const std::string& session_label, const LLDynamicArray<LLUUID>& ids = LLDynamicArray<LLUUID>());
const LLUUID& session_id,
const LLUUID& target_id,
const LLDynamicArray<LLUUID>& ids,
EInstantMessage dialog);
virtual ~LLFloaterIMPanel(); virtual ~LLFloaterIMPanel();
void lookupName(); void lookupName();
@@ -86,7 +82,7 @@ public:
const LLUUID& source = LLUUID::null, const LLUUID& source = LLUUID::null,
const std::string& name = LLStringUtil::null); const std::string& name = LLStringUtil::null);
void setInputFocus( BOOL b ); void setInputFocus(bool b);
void setVisible(BOOL b); void setVisible(BOOL b);
@@ -121,7 +117,7 @@ public:
void sessionInitReplyReceived(const LLUUID& im_session_id); void sessionInitReplyReceived(const LLUUID& im_session_id);
// Handle other participant in the session typing. // Handle other participant in the session typing.
void processIMTyping(const LLIMInfo* im_info, BOOL typing); void processIMTyping(const LLIMInfo* im_info, bool typing);
static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata);
//show error statuses to the user //show error statuses to the user
@@ -133,22 +129,11 @@ public:
static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response);
typedef enum e_session_type
{
P2P_SESSION,
GROUP_SESSION,
ADHOC_SESSION
} SType;
SType mSessionType;
// LLIMModel Functionality // LLIMModel Functionality
bool getSessionInitialized() const { return mSessionInitialized; } bool getSessionInitialized() const { return mSessionInitialized; }
bool mStartCallOnInitialize; bool mStartCallOnInitialize;
private: private:
// called by constructors
void init(const std::string& session_label);
// Called by UI methods. // Called by UI methods.
void onSendMsg(); void onSendMsg();
@@ -157,11 +142,11 @@ private:
BOOL dropCategory(LLInventoryCategory* category, BOOL drop); BOOL dropCategory(LLInventoryCategory* category, BOOL drop);
// test if local agent can add agents. // test if local agent can add agents.
BOOL isInviteAllowed() const; bool isInviteAllowed() const;
// Called whenever the user starts or stops typing. // Called whenever the user starts or stops typing.
// Sends the typing state to the other user if necessary. // Sends the typing state to the other user if necessary.
void setTyping(BOOL typing); void setTyping(bool typing);
// Add the "User is typing..." indicator. // Add the "User is typing..." indicator.
void addTypingIndicator(const std::string &name); void addTypingIndicator(const std::string &name);
@@ -169,7 +154,7 @@ private:
// Remove the "User is typing..." indicator. // Remove the "User is typing..." indicator.
void removeTypingIndicator(const LLIMInfo* im_info); void removeTypingIndicator(const LLIMInfo* im_info);
void sendTypingState(BOOL typing); void sendTypingState(bool typing);
const bool isModerator(const LLUUID& speaker_id); const bool isModerator(const LLUUID& speaker_id);
@@ -177,6 +162,19 @@ private:
LLLineEditor* mInputEditor; LLLineEditor* mInputEditor;
LLViewerTextEditor* mHistoryEditor; LLViewerTextEditor* mHistoryEditor;
bool mSessionInitialized;
// Where does the "Starting session..." line start?
S32 mSessionStartMsgPos;
enum SType
{
P2P_SESSION,
GROUP_SESSION,
ADHOC_SESSION
};
SType mSessionType;
// The value of the mSessionUUID depends on how the IM session was started: // The value of the mSessionUUID depends on how the IM session was started:
// one-on-one ==> random id // one-on-one ==> random id
// group ==> group_id // group ==> group_id
@@ -184,10 +182,9 @@ private:
// 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID() // 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID()
LLUUID mSessionUUID; LLUUID mSessionUUID;
std::string mSessionLabel; // mLogLabel is the name of the log file before directories and extensions
LLVoiceChannel* mVoiceChannel; std::string mLogLabel;
BOOL mSessionInitialized;
LLSD mQueuedMsgsForInit; LLSD mQueuedMsgsForInit;
// The value mOtherParticipantUUID depends on how the IM session was started: // The value mOtherParticipantUUID depends on how the IM session was started:
@@ -196,39 +193,38 @@ private:
// inventory folder ==> first target id in list // inventory folder ==> first target id in list
// 911 ==> sender // 911 ==> sender
LLUUID mOtherParticipantUUID; LLUUID mOtherParticipantUUID;
LLDynamicArray<LLUUID> mSessionInitialTargetIDs;
EInstantMessage mDialog; EInstantMessage mDialog;
// Are you currently typing? // Are you currently typing?
BOOL mTyping; bool mTyping;
// Where does the "User is typing..." line start?
S32 mTypingLineStartIndex;
// Is other user currently typing? // Is other user currently typing?
BOOL mOtherTyping; bool mOtherTyping;
// name of other user who is currently typing // name of other user who is currently typing
std::string mOtherTypingName; std::string mOtherTypingName;
// Where does the "User is typing..." line start?
S32 mTypingLineStartIndex;
// Where does the "Starting session..." line start?
S32 mSessionStartMsgPos;
S32 mNumUnreadMessages; S32 mNumUnreadMessages;
BOOL mSentTypingState; bool mSentTypingState;
BOOL mShowSpeakersOnConnect; bool mShowSpeakersOnConnect;
BOOL mTextIMPossible;
BOOL mProfileButtonEnabled; BOOL mProfileButtonEnabled;
BOOL mCallBackEnabled;
bool mDing; // Whether or not to play a ding on new messages bool mDing; // Whether or not to play a ding on new messages
bool mRPMode; bool mRPMode;
bool mTextIMPossible;
bool mCallBackEnabled;
LLIMSpeakerMgr* mSpeakers; LLIMSpeakerMgr* mSpeakers;
LLParticipantList* mSpeakerPanel; LLParticipantList* mSpeakerPanel;
LLVoiceChannel* mVoiceChannel;
// Optimization: Don't send "User is typing..." until the // Optimization: Don't send "User is typing..." until the
// user has actually been typing for a little while. Prevents // user has actually been typing for a little while. Prevents

View File

@@ -480,13 +480,7 @@ void LLIMMgr::addMessage(
name = session_name; name = session_name;
} }
floater = createFloater(new_session_id, other_participant_id, name, dialog);
floater = createFloater(
new_session_id,
other_participant_id,
name,
dialog,
FALSE);
// When we get a new IM, and if you are a god, display a bit // When we get a new IM, and if you are a god, display a bit
// of information about the source. This is to help liaisons // of information about the source. This is to help liaisons
@@ -651,13 +645,7 @@ LLUUID LLIMMgr::addSession(
LLDynamicArray<LLUUID> ids; LLDynamicArray<LLUUID> ids;
ids.put(other_participant_id); ids.put(other_participant_id);
floater = createFloater( floater = createFloater(session_id, other_participant_id, name, dialog, ids, true);
session_id,
other_participant_id,
name,
ids,
dialog,
TRUE);
noteOfflineUsers(floater, ids); noteOfflineUsers(floater, ids);
LLFloaterChatterBox::showInstance(session_id); LLFloaterChatterBox::showInstance(session_id);
@@ -714,13 +702,7 @@ LLUUID LLIMMgr::addSession(
{ {
// On creation, use the first element of ids as the // On creation, use the first element of ids as the
// "other_participant_id" // "other_participant_id"
floater = createFloater( floater = createFloater(session_id, other_participant_id, name, dialog, ids, true);
session_id,
other_participant_id,
name,
ids,
dialog,
TRUE);
if ( !floater ) return LLUUID::null; if ( !floater ) return LLUUID::null;
@@ -1094,52 +1076,9 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
const LLUUID& session_id, const LLUUID& session_id,
const LLUUID& other_participant_id, const LLUUID& other_participant_id,
const std::string& session_label, const std::string& session_label,
EInstantMessage dialog, const EInstantMessage& dialog,
BOOL user_initiated)
{
if (session_id.isNull())
{
llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl;
}
llinfos << "LLIMMgr::createFloater: from " << other_participant_id
<< " in session " << session_id << llendl;
LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label,
session_id,
other_participant_id,
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (tear_off)
{
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
gFloaterView->addChild(floater); // reparent to floater view
LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
floater->open(); // make the new chat floater appear
static LLCachedControl<bool> minimize("OtherChatsTornOffAndMinimized");
if (focused_floater != NULL) // there was a focused floater
{
floater->setMinimized(minimize); // so minimize this one, for now, if desired
focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
}
else if (minimize)
{
floater->setFocus(false); // work around focus being granted to new floater
floater->setMinimized(true);
}
}
mFloaters.insert(floater->getHandle());
return floater;
}
LLFloaterIMPanel* LLIMMgr::createFloater(
const LLUUID& session_id,
const LLUUID& other_participant_id,
const std::string& session_label,
const LLDynamicArray<LLUUID>& ids, const LLDynamicArray<LLUUID>& ids,
EInstantMessage dialog, bool user_initiated)
BOOL user_initiated)
{ {
if (session_id.isNull()) if (session_id.isNull())
{ {
@@ -1148,11 +1087,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
llinfos << "LLIMMgr::createFloater: from " << other_participant_id llinfos << "LLIMMgr::createFloater: from " << other_participant_id
<< " in session " << session_id << llendl; << " in session " << session_id << llendl;
LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, session_id, other_participant_id, dialog, ids);
session_id,
other_participant_id,
ids,
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff"); static LLCachedControl<bool> tear_off("OtherChatsTornOff");

View File

@@ -192,15 +192,9 @@ private:
LLFloaterIMPanel* createFloater(const LLUUID& session_id, LLFloaterIMPanel* createFloater(const LLUUID& session_id,
const LLUUID& target_id, const LLUUID& target_id,
const std::string& name, const std::string& name,
EInstantMessage dialog, const EInstantMessage& dialog,
BOOL user_initiated = FALSE); const LLDynamicArray<LLUUID>& ids = LLDynamicArray<LLUUID>(),
bool user_initiated = false);
LLFloaterIMPanel* createFloater(const LLUUID& session_id,
const LLUUID& target_id,
const std::string& name,
const LLDynamicArray<LLUUID>& ids,
EInstantMessage dialog,
BOOL user_initiated = FALSE);
// This simple method just iterates through all of the ids, and // This simple method just iterates through all of the ids, and
// prints a simple message if they are not online. Used to help // prints a simple message if they are not online. Used to help