diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterfriends.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 6f792e0..6f4945e 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp | |||
@@ -61,19 +61,43 @@ | |||
61 | //Maximum number of people you can select to do an operation on at once. | 61 | //Maximum number of people you can select to do an operation on at once. |
62 | #define MAX_FRIEND_SELECT 20 | 62 | #define MAX_FRIEND_SELECT 20 |
63 | #define RIGHTS_CHANGE_TIMEOUT 5.0 | 63 | #define RIGHTS_CHANGE_TIMEOUT 5.0 |
64 | #define OBSERVER_TIMEOUT 0.5 | ||
64 | 65 | ||
65 | // simple class to observe the calling cards. | 66 | // simple class to observe the calling cards. |
66 | class LLLocalFriendsObserver : public LLFriendObserver | 67 | class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer |
67 | { | 68 | { |
68 | public: | 69 | public: |
69 | LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater) {} | 70 | LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT) |
70 | virtual ~LLLocalFriendsObserver() { mFloater = NULL; } | 71 | { |
72 | mEventTimer.stop(); | ||
73 | } | ||
74 | virtual ~LLLocalFriendsObserver() | ||
75 | { | ||
76 | mFloater = NULL; | ||
77 | } | ||
71 | virtual void changed(U32 mask) | 78 | virtual void changed(U32 mask) |
72 | { | 79 | { |
73 | mFloater->updateFriends(mask); | 80 | // events can arrive quickly in bulk - we need not process EVERY one of them - |
81 | // so we wait a short while to let others pile-in, and process them in aggregate. | ||
82 | mEventTimer.start(); | ||
83 | mEventTimer.reset(); | ||
84 | |||
85 | // save-up all the mask-bits which have come-in | ||
86 | mMask |= mask; | ||
87 | } | ||
88 | virtual BOOL tick() | ||
89 | { | ||
90 | mFloater->updateFriends(mMask); | ||
91 | |||
92 | mEventTimer.stop(); | ||
93 | mMask = 0; | ||
94 | |||
95 | return FALSE; | ||
74 | } | 96 | } |
97 | |||
75 | protected: | 98 | protected: |
76 | LLPanelFriends* mFloater; | 99 | LLPanelFriends* mFloater; |
100 | U32 mMask; | ||
77 | }; | 101 | }; |
78 | 102 | ||
79 | LLPanelFriends::LLPanelFriends() : | 103 | LLPanelFriends::LLPanelFriends() : |