FIRE-13433: Closing an IM session via the syswell chiclet leaves conversation toolbar button in flashing state

Ansariel 2014-04-11 09:24:56 +02:00
parent 70be375f29
commit 44eb29c6b5
3 changed files with 41 additions and 0 deletions

View File

@ -42,6 +42,7 @@
#include "llviewercontrol.h"
#include "fsfloaterim.h"
#include "llvoiceclient.h"
#include "lltoolbarview.h"
static const F32 VOICE_STATUS_UPDATE_INTERVAL = 1.0f;
@ -288,6 +289,15 @@ void FSFloaterIMContainer::setMinimized(BOOL b)
}
}
void FSFloaterIMContainer::setVisible(BOOL b)
{
LLMultiFloater::setVisible(b);
if (b)
{
mFlashingSessions.clear();
}
}
//virtual
void FSFloaterIMContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg)
@ -309,6 +319,13 @@ void FSFloaterIMContainer::sessionRemoved(const LLUUID& session_id)
{
iMfloater->closeFloater();
}
uuid_vec_t::iterator found = std::find(mFlashingSessions.begin(), mFlashingSessions.end(), session_id);
if (found != mFlashingSessions.end())
{
mFlashingSessions.erase(found);
checkFlashing();
}
}
// static
@ -438,4 +455,20 @@ LLFloater* FSFloaterIMContainer::getCurrentVoiceFloater()
return NULL;
}
void FSFloaterIMContainer::addFlashingSession(const LLUUID& session_id)
{
uuid_vec_t::iterator found = std::find(mFlashingSessions.begin(), mFlashingSessions.end(), session_id);
if (found == mFlashingSessions.end())
{
mFlashingSessions.push_back(session_id);
}
}
void FSFloaterIMContainer::checkFlashing()
{
if (mFlashingSessions.empty())
{
gToolBarView->flashCommand(LLCommandId("chat"), false);
}
}
// EOF

View File

@ -64,6 +64,7 @@ public:
static FSFloaterIMContainer* getInstance();
virtual void setMinimized(BOOL b);
virtual void setVisible(BOOL b);
void onNewMessageReceived(const LLSD& data); // public so nearbychat can call it directly. TODO: handle via callback. -AO
@ -76,6 +77,8 @@ public:
static void reloadEmptyFloaters();
void initTabs();
void addFlashingSession(const LLUUID& session_id);
private:
enum eVoiceState
{
@ -97,6 +100,9 @@ private:
typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;
avatarID_panel_map_t mSessions;
boost::signals2::connection mNewMessageConnection;
void checkFlashing();
uuid_vec_t mFlashingSessions;
};
#endif // FS_FLOATERIMCONTAINER_H

View File

@ -430,6 +430,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
if (!im_container->getVisible() && nearby_chat_instance && im_container->hasFloater(nearby_chat_instance)
&& gSavedSettings.getBOOL("FSNotifyNearbyChatFlash"))
{
im_container->addFlashingSession(session_id);
gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized());
}
return;
@ -453,6 +454,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
if (!im_container->getVisible() && im_instance && im_container->hasFloater(im_instance)
&& gSavedSettings.getBOOL("FSNotifyIMFlash"))
{
im_container->addFlashingSession(session_id);
gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized());
}