Hookup setIMFloaterShowedCallback

master
Cinders 2013-07-04 20:09:43 -06:00
parent feeedb6bfd
commit 9b91c197c0
4 changed files with 23 additions and 6 deletions

View File

@ -77,6 +77,8 @@
#include "llnotificationtemplate.h" // <FS:Zi> 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<LLButton>("add_friend_btn")->setEnabled(enabled);
}
// </FS:Ansariel>
boost::signals2::connection FSFloaterIM::setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb)
{
return FSFloaterIM::sIMFloaterShowedSignal.connect(cb);
}

View File

@ -43,6 +43,8 @@ class FSChatHistory;
class LLInventoryItem;
class LLInventoryCategory;
typedef boost::signals2::signal<void(const LLUUID& session_id)> 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:
// <FS:Ansariel> 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 */

View File

@ -149,20 +149,20 @@ bool LLConversation::isOlderThan(U32 days) const
void LLConversation::setListenIMFloaterOpened()
{
// <FS:CR>
// <FS:CR> [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();
// </FS:CR>
// 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 <FS:CR>
//mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1));
mIMFloaterShowedConnection = FSFloaterIM::setIMFloaterShowedCallback(boost::bind(&LLConversation::onIMFloaterShown, this, _1));
// </FS:CR>
}
else
{

View File

@ -48,17 +48,17 @@ LLConversationLogListItem::LLConversationLogListItem(const LLConversation* conve
{
buildFromFile("panel_conversation_log_list_item.xml");
// <FS:CR>
// <FS:CR> [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();
// </FS:CR>
if (mConversation->hasOfflineMessages() && !ims_are_read)
{
// FIXME: Commented this out cuz I'm lazy. <FS:CR>
//mIMFloaterShowedConnection = LLFloaterIMSession::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1));
mIMFloaterShowedConnection = FSFloaterIM::setIMFloaterShowedCallback(boost::bind(&LLConversationLogListItem::onIMFloaterShown, this, _1));
// </FS:CR>
}
}