diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 738320f5cd..d9094206cd 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -68,6 +68,7 @@ // #include "llfloaterreg.h" #include "llnotificationmanager.h" +#include "llimfloater.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -879,6 +880,15 @@ 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); + LLIMFloater* im_floater = LLIMFloater::findInstance(im_session_id); + if (im_floater) + { + im_floater->setEnableAddFriendButton(FALSE); + } + // } } } @@ -896,6 +906,15 @@ 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); + LLIMFloater* im_floater = LLIMFloater::findInstance(im_session_id); + if (im_floater) + { + im_floater->setEnableAddFriendButton(TRUE); + } + // } } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index bb28745037..0a54e71a53 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -1801,3 +1801,10 @@ BOOL LLIMFloater::enableViewerVersionCallback(const LLSD& notification,const LLS return result; } // + +// FIRE-3248: Disable add friend button on IM floater if friendship request accepted +void LLIMFloater::setEnableAddFriendButton(BOOL enabled) +{ + getChild("add_friend_btn")->setEnabled(enabled); +} +// \ No newline at end of file diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 656af1cc51..78e16c3cbd 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -130,6 +130,9 @@ public: virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } + // FIRE-3248: Disable add friend button on IM floater if friendship request accepted + void setEnableAddFriendButton(BOOL enabled); + protected: /* virtual */ void onClickCloseBtn();