From 5b46c7e2d261f93010c922a560fcb24c47e75f2e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 9 Aug 2015 00:07:02 +0200 Subject: [PATCH] Refactor code for controlling friendship button in IM floater --- indra/newview/fsfloaterim.cpp | 9 ++------- indra/newview/fsfloaterim.h | 3 --- indra/newview/llcallingcard.cpp | 23 ----------------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index de7dc64d2e..d4fe09e978 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -681,6 +681,7 @@ void FSFloaterIM::changed(U32 mask) bool is_online = LLAvatarTracker::instance().isBuddyOnline(mOtherParticipantUUID); getChild("teleport_btn")->setEnabled(is_online); getChild("call_btn")->setEnabled(is_online); + getChild("add_friend_btn")->setEnabled(FALSE); } else { @@ -688,6 +689,7 @@ void FSFloaterIM::changed(U32 mask) // know about their online status anymore getChild("teleport_btn")->setEnabled(TRUE); getChild("call_btn")->setEnabled(TRUE); + getChild("add_friend_btn")->setEnabled(TRUE); } } @@ -2091,13 +2093,6 @@ BOOL FSFloaterIM::enableViewerVersionCallback(const LLSD& notification,const LLS } // -// FIRE-3248: Disable add friend button on IM floater if friendship request accepted -void FSFloaterIM::setEnableAddFriendButton(BOOL enabled) -{ - getChild("add_friend_btn")->setEnabled(enabled); -} -// - // FIRE-11734 //static void FSFloaterIM::clearAllOpenHistories() diff --git a/indra/newview/fsfloaterim.h b/indra/newview/fsfloaterim.h index e7aacd0d88..e026c0f2d3 100644 --- a/indra/newview/fsfloaterim.h +++ b/indra/newview/fsfloaterim.h @@ -139,9 +139,6 @@ public: static void onNewIMReceived(const LLUUID& session_id); virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } - - // 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; diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index bc7f81f756..2ece2b37ca 100755 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -56,7 +56,6 @@ // Firestorm includes #include "fscommon.h" -#include "fsfloaterim.h" #include "fsfloaternearbychat.h" #include "fskeywords.h" #include "lggcontactsets.h" @@ -889,17 +888,6 @@ void LLAvatarTracker::formFriendship(const LLUUID& id) at.mBuddyInfo[id] = buddy_info; at.addChangedMask(LLFriendObserver::ADD, id); at.notifyObservers(); - - // FIRE-3248: Disable add friend button on IM floater if friendship request accepted - LLUUID im_session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, id); - // [FS communication UI] - FSFloaterIM* im_floater = FSFloaterIM::findInstance(im_session_id); - // [FS communication UI] - if (im_floater) - { - im_floater->setEnableAddFriendButton(FALSE); - } - // } } } @@ -917,17 +905,6 @@ void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**) at.addChangedMask(LLFriendObserver::REMOVE, id); delete buddy; at.notifyObservers(); - - // FIRE-3248: Disable add friend button on IM floater if friendship request accepted - LLUUID im_session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, id); - // [FS communication UI] - FSFloaterIM* im_floater = FSFloaterIM::findInstance(im_session_id); - // [FS communication UI] - if (im_floater) - { - im_floater->setEnableAddFriendButton(TRUE); - } - // } }