summaryrefslogtreecommitdiff
path: root/indra/newview/llcallingcard.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
commit30ff6cabd61f2f083df5df1e6e70cc94742af477 (patch)
tree631935f1cf59d19a91cdad65e9a75fe825afda7d /indra/newview/llcallingcard.cpp
parentff11d74820c89822cd067b51727d9df1dc87d0d0 (diff)
parent3ac3a4b206c08ed06b889bdaa24074b6aa0e020a (diff)
Merge with trunk
Diffstat (limited to 'indra/newview/llcallingcard.cpp')
-rw-r--r--indra/newview/llcallingcard.cpp44
1 files changed, 18 insertions, 26 deletions
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index db28c7ad38..7326e39af3 100644
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -95,29 +95,8 @@ const F32 OFFLINE_SECONDS = FIND_FREQUENCY + 8.0f;
// static
LLAvatarTracker LLAvatarTracker::sInstance;
-/*
-class LLAvatarTrackerInventoryObserver : public LLInventoryObserver
-{
-public:
- LLAvatarTrackerInventoryObserver(LLAvatarTracker* at) :
- mAT(at) {}
- virtual ~LLAvatarTrackerInventoryObserver() {}
- virtual void changed(U32 mask);
-protected:
- LLAvatarTracker* mAT;
-};
-*/
-/*
-void LLAvatarTrackerInventoryObserver::changed(U32 mask)
-{
- // if there's a calling card change, just do it.
- if((mask & LLInventoryObserver::CALLING_CARD) != 0)
- {
- mAT->inventoryChanged();
- }
-}
-*/
+
///----------------------------------------------------------------------------
/// Class LLAvatarTracker
@@ -329,7 +308,8 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id)
msg->nextBlock("ExBlock");
msg->addUUID("OtherID", id);
gAgent.sendReliableMessage();
- mModifyMask |= LLFriendObserver::REMOVE;
+
+ addChangedMask(LLFriendObserver::REMOVE, id);
delete buddy;
}
@@ -503,6 +483,18 @@ void LLAvatarTracker::notifyObservers()
(*it)->changed(mModifyMask);
}
mModifyMask = LLFriendObserver::NONE;
+ mChangedBuddyIDs.clear();
+}
+
+// store flag for change
+// and id of object change applies to
+void LLAvatarTracker::addChangedMask(U32 mask, const LLUUID& referent)
+{
+ mModifyMask |= mask;
+ if (referent.notNull())
+ {
+ mChangedBuddyIDs.insert(referent);
+ }
}
void LLAvatarTracker::applyFunctor(LLRelationshipFunctor& f)
@@ -684,7 +676,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
- floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
+ floater->addHistoryLine(notifyMsg,LLUIColorTable::instance().getColor("SystemChatColor"));
}
}
@@ -706,7 +698,7 @@ void LLAvatarTracker::formFriendship(const LLUUID& id)
//visible online to each other.
buddy_info = new LLRelationship(LLRelationship::GRANT_ONLINE_STATUS,LLRelationship::GRANT_ONLINE_STATUS, false);
at.mBuddyInfo[id] = buddy_info;
- at.mModifyMask |= LLFriendObserver::ADD;
+ at.addChangedMask(LLFriendObserver::ADD, id);
at.notifyObservers();
}
}
@@ -722,7 +714,7 @@ void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**)
LLRelationship* buddy = get_ptr_in_map(at.mBuddyInfo, id);
if(!buddy) return;
at.mBuddyInfo.erase(id);
- at.mModifyMask |= LLFriendObserver::REMOVE;
+ at.addChangedMask(LLFriendObserver::REMOVE, id);
delete buddy;
at.notifyObservers();
}