summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterchatterbox.cpp4
-rw-r--r--indra/newview/llimview.cpp237
-rw-r--r--indra/newview/llimview.h28
-rw-r--r--indra/newview/llmutelist.cpp6
-rw-r--r--indra/newview/lltoolbar.cpp12
5 files changed, 19 insertions, 268 deletions
diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp
index 84b423399e..774caaec90 100644
--- a/indra/newview/llfloaterchatterbox.cpp
+++ b/indra/newview/llfloaterchatterbox.cpp
@@ -216,11 +216,11 @@ void LLFloaterChatterBox::onOpen(const LLSD& key)
}
else if (key.isDefined())
{
- LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID());
+ /*LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID());
if (impanel)
{
impanel->openFloater();
- }
+ }*/
}
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index c4b1d7a9f4..213862df4b 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -538,13 +538,6 @@ void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, con
gIMMgr->startCall(new_session_id);
}
}
-
- //*TODO remove this "floater" stuff when Communicate Floater is gone
- LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(old_session_id);
- if (floater)
- {
- floater->sessionInitReplyReceived(new_session_id);
- }
}
void LLIMModel::testMessages()
@@ -679,15 +672,6 @@ bool LLIMModel::proccessOnlineOfflineNotification(
const LLUUID& session_id,
const std::string& utf8_text)
{
- // Add message to old one floater
- LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
- if ( floater )
- {
- if ( !utf8_text.empty() )
- {
- floater->addHistoryLine(utf8_text, LLUIColorTable::instance().getColor("SystemChatColor"));
- }
- }
// Add system message to history
return addMessage(session_id, SYSTEM_FROM, LLUUID::null, utf8_text);
}
@@ -955,9 +939,6 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
history_echo += ": " + utf8_text;
- LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(im_session_id);
- if (floater) floater->addHistoryLine(history_echo, LLUIColorTable::instance().getColor("IMChatColor"), true, gAgent.getID());
-
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(im_session_id);
if (speaker_mgr)
{
@@ -1275,33 +1256,16 @@ LLUUID LLIMMgr::computeSessionID(
return session_id;
}
-inline LLFloater* getFloaterBySessionID(const LLUUID session_id)
-{
- LLFloater* floater = NULL;
- if ( gIMMgr )
- {
- floater = dynamic_cast < LLFloater* >
- ( gIMMgr->findFloaterBySession(session_id) );
- }
- if ( !floater )
- {
- floater = dynamic_cast < LLFloater* >
- ( LLIMFloater::findInstance(session_id) );
- }
- return floater;
-}
-
void
LLIMMgr::showSessionStartError(
const std::string& error_string,
const LLUUID session_id)
{
- const LLFloater* floater = getFloaterBySessionID (session_id);
- if (!floater) return;
+ if (!hasSession(session_id)) return;
LLSD args;
args["REASON"] = LLTrans::getString(error_string);
- args["RECIPIENT"] = floater->getTitle();
+ args["RECIPIENT"] = LLIMModel::getInstance()->getName(session_id);
LLSD payload;
payload["session_id"] = session_id;
@@ -1339,12 +1303,11 @@ LLIMMgr::showSessionForceClose(
const std::string& reason_string,
const LLUUID session_id)
{
- const LLFloater* floater = getFloaterBySessionID (session_id);
- if (!floater) return;
+ if (!hasSession(session_id)) return;
LLSD args;
- args["NAME"] = floater->getTitle();
+ args["NAME"] = LLIMModel::getInstance()->getName(session_id);
args["REASON"] = LLTrans::getString(reason_string);
LLSD payload;
@@ -1366,7 +1329,7 @@ LLIMMgr::onConfirmForceCloseError(
//only 1 option really
LLUUID session_id = notification["payload"]["session_id"];
- LLFloater* floater = getFloaterBySessionID (session_id);
+ LLFloater* floater = LLIMFloater::findInstance(session_id);
if ( floater )
{
floater->closeFloater(FALSE);
@@ -2144,7 +2107,6 @@ void LLIMMgr::addMessage(
return;
}
- LLFloaterIMPanel* floater;
LLUUID new_session_id = session_id;
if (new_session_id.isNull())
{
@@ -2163,32 +2125,7 @@ void LLIMMgr::addMessage(
if (new_session)
{
LLIMModel::getInstance()->newSession(new_session_id, fixed_session_name, dialog, other_participant_id);
- }
-
- floater = findFloaterBySession(new_session_id);
- if (!floater)
- {
- floater = findFloaterBySession(other_participant_id);
- if (floater)
- {
- llinfos << "found the IM session " << session_id
- << " by participant " << other_participant_id << llendl;
- }
- }
-
- // create IM window as necessary
- if(!floater)
- {
- floater = createFloater(
- new_session_id,
- other_participant_id,
- fixed_session_name,
- dialog,
- FALSE);
- }
- if (new_session)
- {
// 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
// when answering questions.
@@ -2207,50 +2144,13 @@ void LLIMMgr::addMessage(
//<< "*** region_id: " << region_id << std::endl
//<< "*** position: " << position << std::endl;
- floater->addHistoryLine(bonus_info.str(), LLUIColorTable::instance().getColor("SystemChatColor"));
LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, bonus_info.str());
}
make_ui_sound("UISndNewIncomingIMSession");
}
- // now add message to floater
- bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM);
- const LLColor4& color = ( is_from_system ?
- LLUIColorTable::instance().getColor("SystemChatColor") :
- LLUIColorTable::instance().getColor("IMChatColor"));
- if ( !link_name )
- {
- floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
- }
- else
- {
- floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message
- }
-
LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg);
-
- if( !LLFloaterReg::instanceVisible("communicate") && !floater->getVisible())
- {
- LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance();
-
- //if the IM window is not open and the floater is not visible (i.e. not torn off)
- LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater();
-
- // select the newly added floater (or the floater with the new line added to it).
- // it should be there.
- chat_floater->selectFloater(floater);
-
- //there was a previously unseen IM, make that old tab flashing
- //it is assumed that the most recently unseen IM tab is the one current selected/active
- if ( previouslyActiveFloater && getIMReceived() )
- {
- chat_floater->setFloaterFlashing(previouslyActiveFloater, TRUE);
- }
-
- //notify of a new IM
- notifyNewIM();
- }
}
void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args)
@@ -2414,21 +2314,6 @@ LLUUID LLIMMgr::addSession(
LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids, voice);
}
- //*TODO remove this "floater" thing when Communicate Floater's gone
- LLFloaterIMPanel* floater = findFloaterBySession(session_id);
- if(!floater)
- {
- // On creation, use the first element of ids as the
- // "other_participant_id"
- floater = createFloater(
- session_id,
- other_participant_id,
- name,
- dialog,
- TRUE,
- ids);
- }
-
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
if (!new_session) return session_id;
@@ -2439,7 +2324,7 @@ LLUUID LLIMMgr::addSession(
// Only warn for regular IMs - not group IMs
if( dialog == IM_NOTHING_SPECIAL )
{
- noteMutedUsers(session_id, floater, ids);
+ noteMutedUsers(session_id, ids);
}
return session_id;
@@ -2460,14 +2345,6 @@ void LLIMMgr::removeSession(const LLUUID& session_id)
{
llassert_always(hasSession(session_id));
- //*TODO remove this floater thing when Communicate Floater is being deleted (IB)
- LLFloaterIMPanel* floater = findFloaterBySession(session_id);
- if(floater)
- {
- mFloaters.erase(floater->getHandle());
- LLFloaterChatterBox::getInstance()->removeFloater(floater);
- }
-
clearPendingInvitation(session_id);
clearPendingAgentListUpdates(session_id);
@@ -2577,50 +2454,12 @@ void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::stri
LLFloaterReg::showInstance("incoming_call", payload, TRUE);
}
+//*TODO disconnects all sessions
void LLIMMgr::disconnectAllSessions()
{
- LLFloaterIMPanel* floater = NULL;
- std::set<LLHandle<LLFloater> >::iterator handle_it;
- for(handle_it = mFloaters.begin();
- handle_it != mFloaters.end();
- )
- {
- floater = (LLFloaterIMPanel*)handle_it->get();
-
- // MUST do this BEFORE calling floater->onClose() because that may remove the item from the set, causing the subsequent increment to crash.
- ++handle_it;
-
- if (floater)
- {
- floater->setEnabled(FALSE);
- floater->closeFloater(TRUE);
- }
- }
+ //*TODO disconnects all IM sessions
}
-
-// This method returns the im panel corresponding to the uuid
-// provided. The uuid can either be a session id or an agent
-// id. Returns NULL if there is no matching panel.
-LLFloaterIMPanel* LLIMMgr::findFloaterBySession(const LLUUID& session_id)
-{
- LLFloaterIMPanel* rv = NULL;
- std::set<LLHandle<LLFloater> >::iterator handle_it;
- for(handle_it = mFloaters.begin();
- handle_it != mFloaters.end();
- ++handle_it)
- {
- rv = (LLFloaterIMPanel*)handle_it->get();
- if(rv && session_id == rv->getSessionID())
- {
- break;
- }
- rv = NULL;
- }
- return rv;
-}
-
-
BOOL LLIMMgr::hasSession(const LLUUID& session_id)
{
return LLIMModel::getInstance()->findIMSession(session_id) != NULL;
@@ -2804,49 +2643,14 @@ bool LLIMMgr::isVoiceCall(const LLUUID& session_id)
return im_session->mStartedAsIMCall;
}
-// create a floater and update internal representation for
-// consistency. Returns the pointer, caller (the class instance since
-// it is a private method) is not responsible for deleting the
-// pointer. Add the floater to this but do not select it.
-LLFloaterIMPanel* LLIMMgr::createFloater(
- const LLUUID& session_id,
- const LLUUID& other_participant_id,
- const std::string& session_label,
- EInstantMessage dialog,
- BOOL user_initiated,
- const LLDynamicArray<LLUUID>& ids)
-{
- 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,
- ids,
- dialog);
- LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
- LLFloaterChatterBox::getInstance()->addFloater(floater, FALSE, i_pt);
- mFloaters.insert(floater->getHandle());
- return floater;
-}
-
void LLIMMgr::noteOfflineUsers(
const LLUUID& session_id,
- LLFloaterIMPanel* floater,
const LLDynamicArray<LLUUID>& ids)
{
S32 count = ids.count();
if(count == 0)
{
const std::string& only_user = LLTrans::getString("only_user_message");
- if (floater)
- {
- floater->addHistoryLine(only_user, LLUIColorTable::instance().getColor("SystemChatColor"));
- }
LLIMModel::getInstance()->addMessage(session_id, SYSTEM_FROM, LLUUID::null, only_user);
}
else
@@ -2870,7 +2674,7 @@ void LLIMMgr::noteOfflineUsers(
}
}
-void LLIMMgr::noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* floater,
+void LLIMMgr::noteMutedUsers(const LLUUID& session_id,
const LLDynamicArray<LLUUID>& ids)
{
// Don't do this if we don't have a mute list.
@@ -2891,9 +2695,6 @@ void LLIMMgr::noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* floater
{
LLUIString muted = LLTrans::getString("muted_message");
- //*TODO remove this "floater" thing when Communicate Floater's gone
- floater->addHistoryLine(muted);
-
im_model->addMessage(session_id, SYSTEM_FROM, LLUUID::null, muted);
break;
}
@@ -2914,12 +2715,6 @@ void LLIMMgr::processIMTypingStop(const LLIMInfo* im_info)
void LLIMMgr::processIMTypingCore(const LLIMInfo* im_info, BOOL typing)
{
LLUUID session_id = computeSessionID(im_info->mIMType, im_info->mFromID);
- LLFloaterIMPanel* floater = findFloaterBySession(session_id);
- if (floater)
- {
- floater->processIMTyping(im_info, typing);
- }
-
LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
if ( im_floater )
{
@@ -2965,15 +2760,6 @@ public:
speaker_mgr->updateSpeakers(gIMMgr->getPendingAgentListUpdates(session_id));
}
- LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id);
- if (floaterp)
- {
- if ( body.has("session_info") )
- {
- floaterp->processSessionUpdate(body["session_info"]);
- }
- }
-
LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
if ( im_floater )
{
@@ -3068,11 +2854,6 @@ public:
const LLSD& input) const
{
LLUUID session_id = input["body"]["session_id"].asUUID();
- LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id);
- if (floaterp)
- {
- floaterp->processSessionUpdate(input["body"]["info"]);
- }
LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
if ( im_floater )
{
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 0386ff234d..17406025f2 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -41,7 +41,6 @@
class LLFloaterChatterBox;
class LLUUID;
-class LLFloaterIMPanel;
class LLFriendObserver;
class LLCallDialogManager;
class LLIMSpeakerMgr;
@@ -386,11 +385,6 @@ public:
BOOL hasSession(const LLUUID& session_id);
- // This method returns the im panel corresponding to the uuid
- // provided. The uuid must be a session id. Returns NULL if there
- // is no matching panel.
- LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id);
-
static LLUUID computeSessionID(EInstantMessage dialog, const LLUUID& other_participant_id);
void clearPendingInvitation(const LLUUID& session_id);
@@ -402,10 +396,6 @@ public:
const LLSD& updates);
void clearPendingAgentListUpdates(const LLUUID& session_id);
- //HACK: need a better way of enumerating existing session, or listening to session create/destroy events
- //@deprecated, is used only by LLToolBox, which is not used anywhere, right? (IB)
- const std::set<LLHandle<LLFloater> >& getIMFloaterHandles() { return mFloaters; }
-
void addSessionObserver(LLIMSessionObserver *);
void removeSessionObserver(LLIMSessionObserver *);
@@ -436,23 +426,12 @@ private:
*/
void removeSession(const LLUUID& session_id);
- // create a panel and update internal representation for
- // consistency. Returns the pointer, caller (the class instance
- // since it is a private method) is not responsible for deleting
- // the pointer.
- LLFloaterIMPanel* createFloater(const LLUUID& session_id,
- const LLUUID& target_id,
- const std::string& name,
- EInstantMessage dialog,
- BOOL user_initiated = FALSE,
- const LLDynamicArray<LLUUID>& ids = LLDynamicArray<LLUUID>());
-
// This simple method just iterates through all of the ids, and
// prints a simple message if they are not online. Used to help
// reduce 'hello' messages to the linden employees unlucky enough
// to have their calling card in the default inventory.
- void noteOfflineUsers(const LLUUID& session_id, LLFloaterIMPanel* panel, const LLDynamicArray<LLUUID>& ids);
- void noteMutedUsers(const LLUUID& session_id, LLFloaterIMPanel* panel, const LLDynamicArray<LLUUID>& ids);
+ void noteOfflineUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids);
+ void noteMutedUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids);
void processIMTypingCore(const LLIMInfo* im_info, BOOL typing);
@@ -464,9 +443,6 @@ private:
private:
- //*TODO should be deleted when Communicate Floater is being deleted
- std::set<LLHandle<LLFloater> > mFloaters;
-
typedef std::list <LLIMSessionObserver *> session_observers_list_t;
session_observers_list_t mSessionObservers;
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index c1666f5666..45e5408b1e 100644
--- a/indra/newview/llmutelist.cpp
+++ b/indra/newview/llmutelist.cpp
@@ -472,12 +472,6 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n
if (reason == LLMuteList::AR_IM)
{
- LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id);
- if (timp)
- {
- timp->addHistoryLine(message);
- }
-
LLIMModel::getInstance()->addMessage(agent_id, SYSTEM_FROM, LLUUID::null, message);
}
}
diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp
index e7dc7ae522..4a66d88fa2 100644
--- a/indra/newview/lltoolbar.cpp
+++ b/indra/newview/lltoolbar.cpp
@@ -290,7 +290,7 @@ void LLToolBar::updateCommunicateList()
std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it;
- if (gIMMgr->getIMFloaterHandles().size() > 0)
+ /*if (gIMMgr->getIMFloaterHandles().size() > 0)
{
communicate_button->addSeparator(ADD_TOP);
}
@@ -316,7 +316,7 @@ void LLToolBar::updateCommunicateList()
}
itemp = communicate_button->addElement(im_sd, ADD_TOP);
}
- }
+ }*/
communicate_button->setValue(selected);
}
@@ -340,7 +340,7 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data)
}
else if (selected_option.asString() == "redock")
{
- LLFloaterChatterBox* chatterbox_instance = LLFloaterChatterBox::getInstance();
+ /*LLFloaterChatterBox* chatterbox_instance = LLFloaterChatterBox::getInstance();
if(chatterbox_instance)
{
chatterbox_instance->addFloater(LLFloaterMyFriends::getInstance(), FALSE);
@@ -361,7 +361,7 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data)
}
}
LLFloaterReg::showInstance("communicate", session_to_show);
- }
+ }*/
}
else if (selected_option.asString() == "mute list")
{
@@ -369,11 +369,11 @@ void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, const LLSD& user_data)
}
else if (selected_option.isUndefined()) // user just clicked the communicate button, treat as toggle
{
- LLFloaterReg::toggleInstance("communicate");
+ /*LLFloaterReg::toggleInstance("communicate");*/
}
else // otherwise selection_option is undifined or a specific IM session id
{
- LLFloaterReg::showInstance("communicate", selected_option);
+ /*LLFloaterReg::showInstance("communicate", selected_option);*/
}
}