diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index e060df563e..4fdd215832 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -77,6 +77,8 @@ #include "llnotificationtemplate.h" // Viewer version popup #include "fscommon.h" +floater_showed_signal_t FSFloaterIM::sIMFloaterShowedSignal; + FSFloaterIM::FSFloaterIM(const LLUUID& session_id) : LLTransientDockableFloater(NULL, true, session_id), mControlPanel(NULL), @@ -1114,6 +1116,11 @@ void FSFloaterIM::setVisible(BOOL visible) chiclet->setToggleState(false); } } + + if (visible && isInVisibleChain()) + { + sIMFloaterShowedSignal(mSessionID); + } } BOOL FSFloaterIM::getVisible() @@ -1831,3 +1838,8 @@ void FSFloaterIM::setEnableAddFriendButton(BOOL enabled) getChild("add_friend_btn")->setEnabled(enabled); } // + +boost::signals2::connection FSFloaterIM::setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb) +{ + return FSFloaterIM::sIMFloaterShowedSignal.connect(cb); +} diff --git a/indra/newview/fsfloaterim.h b/indra/newview/fsfloaterim.h index fad716e598..2eb2745365 100644 --- a/indra/newview/fsfloaterim.h +++ b/indra/newview/fsfloaterim.h @@ -43,6 +43,8 @@ class FSChatHistory; class LLInventoryItem; class LLInventoryCategory; +typedef boost::signals2::signal floater_showed_signal_t; + /** * Individual IM window that appears at the bottom of the screen, * optionally "docked" to the bottom tray. @@ -134,6 +136,9 @@ public: // FIRE-3248: Disable add friend button on IM floater if friendship request accepted void setEnableAddFriendButton(BOOL enabled); + + static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); + static floater_showed_signal_t sIMFloaterShowedSignal; protected: /* virtual */ diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 44fdcde423..ad37b4c2b4 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -149,20 +149,20 @@ bool LLConversation::isOlderThan(U32 days) const void LLConversation::setListenIMFloaterOpened() { - // + // [Firestorm Communications UI] //LLFloaterIMSession* floater = LLFloaterIMSession::findInstance(mSessionID); FSFloaterIM* floater = FSFloaterIM::findInstance(mSessionID); //bool offline_ims_visible = LLFloaterIMSession::isVisible(floater) && floater->hasFocus(); bool offline_ims_visible = FSFloaterIM::isVisible(floater) && floater->hasFocus(); - // // we don't need to listen for im floater with this conversation is opened // if floater is already opened or this conversation doesn't have unread offline messages if (mHasOfflineIMs && !offline_ims_visible) { - // FIXME: I commented this out until it's hooked up //mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1)); + mIMFloaterShowedConnection = FSFloaterIM::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1)); + // } else { diff --git a/indra/newview/llconversationloglistitem.cpp b/indra/newview/llconversationloglistitem.cpp index 70a3ccc361..0c5cbcb27c 100644 --- a/indra/newview/llconversationloglistitem.cpp +++ b/indra/newview/llconversationloglistitem.cpp @@ -48,17 +48,17 @@ LLConversationLogListItem::LLConversationLogListItem(const LLConversation* conve { buildFromFile("panel_conversation_log_list_item.xml"); - // + // [Firestorm Communications UI] //LLFloaterIMSession* floater = LLFloaterIMSession::findInstance(mConversation->getSessionID()); FSFloaterIM* floater = FSFloaterIM::findInstance(mConversation->getSessionID()); //bool ims_are_read = LLFloaterIMSession::isVisible(floater) && floater->hasFocus(); bool ims_are_read = FSFloaterIM::isVisible(floater) && floater->hasFocus(); - // if (mConversation->hasOfflineMessages() && !ims_are_read) { - // FIXME: Commented this out cuz I'm lazy. //mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1)); + mIMFloaterShowedConnection = FSFloaterIM::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1)); + // } }