diff options
author | Sergey Borushevsky <sborushevsky@productengine.com> | 2009-11-25 20:46:53 +0200 |
---|---|---|
committer | Sergey Borushevsky <sborushevsky@productengine.com> | 2009-11-25 20:46:53 +0200 |
commit | b19b63ad8cba7b1c3e44c4084313103765af1917 (patch) | |
tree | ad49895f73f42f67331c324d5a6fe764a7bf34a4 /indra | |
parent | cf77bc11772c41546d1f5f1a0bda1bf36506e37b (diff) |
Fixed minor bug EXT-2744 (IM window: Add Friend is disabled after removing friendship with a friends)
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelimcontrolpanel.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpanelimcontrolpanel.h | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 40319d949d..ed651790f0 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -120,6 +120,7 @@ LLPanelIMControlPanel::LLPanelIMControlPanel() LLPanelIMControlPanel::~LLPanelIMControlPanel() { + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); } BOOL LLPanelIMControlPanel::postBuild() @@ -175,7 +176,9 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLIMModel& im_model = LLIMModel::instance(); + LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); mAvatarID = im_model.getOtherParticipantID(session_id); + LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); @@ -204,6 +207,12 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) } } +//virtual +void LLPanelIMControlPanel::changed(U32 mask) +{ + childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(mAvatarID)); +} + void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { if ( id == mAvatarID ) diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 7bfc432ef2..a590232a0b 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -35,6 +35,7 @@ #include "llpanel.h" #include "llvoicechannel.h" +#include "llcallingcard.h" class LLSpeakerMgr; class LLAvatarList; @@ -66,7 +67,7 @@ private: }; -class LLPanelIMControlPanel : public LLPanelChatControlPanel +class LLPanelIMControlPanel : public LLPanelChatControlPanel, LLFriendObserver { public: LLPanelIMControlPanel(); @@ -76,6 +77,9 @@ public: void setSessionId(const LLUUID& session_id); + // LLFriendObserver trigger + virtual void changed(U32 mask); + protected: void nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); |