aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterfriends.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterfriends.cpp')
-rw-r--r--linden/indra/newview/llfloaterfriends.cpp42
1 files changed, 36 insertions, 6 deletions
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp
index acdd5ce..bf1f678 100644
--- a/linden/indra/newview/llfloaterfriends.cpp
+++ b/linden/indra/newview/llfloaterfriends.cpp
@@ -6,7 +6,7 @@
6 * 6 *
7 * $LicenseInfo:firstyear=2005&license=viewergpl$ 7 * $LicenseInfo:firstyear=2005&license=viewergpl$
8 * 8 *
9 * Copyright (c) 2005-2008, Linden Research, Inc. 9 * Copyright (c) 2005-2009, Linden Research, Inc.
10 * 10 *
11 * Second Life Viewer Source Code 11 * Second Life Viewer Source Code
12 * The source code in this file ("Source Code") is provided by Linden Lab 12 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -57,6 +57,7 @@
57#include "llviewermessage.h" 57#include "llviewermessage.h"
58#include "lltimer.h" 58#include "lltimer.h"
59#include "lltextbox.h" 59#include "lltextbox.h"
60#include "llvoiceclient.h"
60 61
61//Maximum number of people you can select to do an operation on at once. 62//Maximum number of people you can select to do an operation on at once.
62#define MAX_FRIEND_SELECT 20 63#define MAX_FRIEND_SELECT 20
@@ -64,6 +65,8 @@
64#define RIGHTS_CHANGE_TIMEOUT 5.0 65#define RIGHTS_CHANGE_TIMEOUT 5.0
65#define OBSERVER_TIMEOUT 0.5 66#define OBSERVER_TIMEOUT 0.5
66 67
68#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga"
69
67// simple class to observe the calling cards. 70// simple class to observe the calling cards.
68class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer 71class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer
69{ 72{
@@ -111,10 +114,14 @@ LLPanelFriends::LLPanelFriends() :
111 mEventTimer.stop(); 114 mEventTimer.stop();
112 mObserver = new LLLocalFriendsObserver(this); 115 mObserver = new LLLocalFriendsObserver(this);
113 LLAvatarTracker::instance().addObserver(mObserver); 116 LLAvatarTracker::instance().addObserver(mObserver);
117 // For notification when SIP online status changes.
118 LLVoiceClient::getInstance()->addObserver(mObserver);
114} 119}
115 120
116LLPanelFriends::~LLPanelFriends() 121LLPanelFriends::~LLPanelFriends()
117{ 122{
123 // For notification when SIP online status changes.
124 LLVoiceClient::getInstance()->removeObserver(mObserver);
118 LLAvatarTracker::instance().removeObserver(mObserver); 125 LLAvatarTracker::instance().removeObserver(mObserver);
119 delete mObserver; 126 delete mObserver;
120} 127}
@@ -212,7 +219,9 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
212 LLAvatarTracker& at = LLAvatarTracker::instance(); 219 LLAvatarTracker& at = LLAvatarTracker::instance();
213 const LLRelationship* relationInfo = at.getBuddyInfo(agent_id); 220 const LLRelationship* relationInfo = at.getBuddyInfo(agent_id);
214 if(!relationInfo) return FALSE; 221 if(!relationInfo) return FALSE;
215 BOOL online = relationInfo->isOnline(); 222
223 bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id);
224 bool isOnline = relationInfo->isOnline();
216 225
217 std::string fullname; 226 std::string fullname;
218 BOOL have_name = gCacheName->getFullName(agent_id, fullname); 227 BOOL have_name = gCacheName->getFullName(agent_id, fullname);
@@ -228,12 +237,17 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
228 LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; 237 LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS];
229 online_status_column["column"] = "icon_online_status"; 238 online_status_column["column"] = "icon_online_status";
230 online_status_column["type"] = "icon"; 239 online_status_column["type"] = "icon";
231 240
232 if (online) 241 if (isOnline)
233 { 242 {
234 friend_column["font-style"] = "BOLD"; 243 friend_column["font-style"] = "BOLD";
235 online_status_column["value"] = "icon_avatar_online.tga"; 244 online_status_column["value"] = "icon_avatar_online.tga";
236 } 245 }
246 else if(isOnlineSIP)
247 {
248 friend_column["font-style"] = "BOLD";
249 online_status_column["value"] = ONLINE_SIP_ICON_NAME;
250 }
237 251
238 LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE]; 252 LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE];
239 online_column["column"] = "icon_visible_online"; 253 online_column["column"] = "icon_visible_online";
@@ -271,14 +285,30 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh
271 if (!info) return FALSE; 285 if (!info) return FALSE;
272 LLScrollListItem* itemp = mFriendsList->getItem(agent_id); 286 LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
273 if (!itemp) return FALSE; 287 if (!itemp) return FALSE;
288
289 bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
290 bool isOnline = info->isOnline();
274 291
275 std::string fullname; 292 std::string fullname;
276 BOOL have_name = gCacheName->getFullName(agent_id, fullname); 293 BOOL have_name = gCacheName->getFullName(agent_id, fullname);
294
295 // Name of the status icon to use
296 std::string statusIcon;
297
298 if(isOnline)
299 {
300 statusIcon = "icon_avatar_online.tga";
301 }
302 else if(isOnlineSIP)
303 {
304 statusIcon = ONLINE_SIP_ICON_NAME;
305 }
277 306
278 itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? std::string("icon_avatar_online.tga") : LLStringUtil::null); 307 itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
308
279 itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); 309 itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
280 // render name of online friends in bold text 310 // render name of online friends in bold text
281 ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(info->isOnline() ? LLFontGL::BOLD : LLFontGL::NORMAL); 311 ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);
282 itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)); 312 itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
283 itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION)); 313 itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
284 itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS)); 314 itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));