summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterfriends.cpp
diff options
context:
space:
mode:
authorMonroe Williams <monroe@lindenlab.com>2009-02-27 21:01:19 +0000
committerMonroe Williams <monroe@lindenlab.com>2009-02-27 21:01:19 +0000
commitdd437009e88954fd0fe9dd95b903dbd1ea52e901 (patch)
tree5f5cb97ebc5dc4ca3bdbe2867a897e625c54a011 /indra/newview/llfloaterfriends.cpp
parent0bd557510a20565a4f27318f86dd11dac88ff574 (diff)
svn merge -r 113014:113017 svn+ssh://svn.lindenlab.com/svn/linden/branches/merge-QAR-1323
Merging in QAR-1323.
Diffstat (limited to 'indra/newview/llfloaterfriends.cpp')
-rw-r--r--indra/newview/llfloaterfriends.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp
index f5133584b5..014a631a53 100644
--- a/indra/newview/llfloaterfriends.cpp
+++ b/indra/newview/llfloaterfriends.cpp
@@ -58,6 +58,7 @@
#include "llviewermessage.h"
#include "lltimer.h"
#include "lltextbox.h"
+#include "llvoiceclient.h"
//Maximum number of people you can select to do an operation on at once.
#define MAX_FRIEND_SELECT 20
@@ -65,6 +66,8 @@
#define RIGHTS_CHANGE_TIMEOUT 5.0
#define OBSERVER_TIMEOUT 0.5
+#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga"
+
// simple class to observe the calling cards.
class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer
{
@@ -112,10 +115,14 @@ LLPanelFriends::LLPanelFriends() :
mEventTimer.stop();
mObserver = new LLLocalFriendsObserver(this);
LLAvatarTracker::instance().addObserver(mObserver);
+ // For notification when SIP online status changes.
+ LLVoiceClient::getInstance()->addObserver(mObserver);
}
LLPanelFriends::~LLPanelFriends()
{
+ // For notification when SIP online status changes.
+ LLVoiceClient::getInstance()->removeObserver(mObserver);
LLAvatarTracker::instance().removeObserver(mObserver);
delete mObserver;
}
@@ -213,7 +220,9 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
LLAvatarTracker& at = LLAvatarTracker::instance();
const LLRelationship* relationInfo = at.getBuddyInfo(agent_id);
if(!relationInfo) return FALSE;
- BOOL online = relationInfo->isOnline();
+
+ bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id);
+ bool isOnline = relationInfo->isOnline();
std::string fullname;
BOOL have_name = gCacheName->getFullName(agent_id, fullname);
@@ -229,12 +238,17 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS];
online_status_column["column"] = "icon_online_status";
online_status_column["type"] = "icon";
-
- if (online)
+
+ if (isOnline)
{
friend_column["font-style"] = "BOLD";
online_status_column["value"] = "icon_avatar_online.tga";
}
+ else if(isOnlineSIP)
+ {
+ friend_column["font-style"] = "BOLD";
+ online_status_column["value"] = ONLINE_SIP_ICON_NAME;
+ }
LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE];
online_column["column"] = "icon_visible_online";
@@ -272,14 +286,30 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh
if (!info) return FALSE;
LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
if (!itemp) return FALSE;
+
+ bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
+ bool isOnline = info->isOnline();
std::string fullname;
BOOL have_name = gCacheName->getFullName(agent_id, fullname);
+
+ // Name of the status icon to use
+ std::string statusIcon;
+
+ if(isOnline)
+ {
+ statusIcon = "icon_avatar_online.tga";
+ }
+ else if(isOnlineSIP)
+ {
+ statusIcon = ONLINE_SIP_ICON_NAME;
+ }
- itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? std::string("icon_avatar_online.tga") : LLStringUtil::null);
+ itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
+
itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
// render name of online friends in bold text
- ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(info->isOnline() ? LLFontGL::BOLD : LLFontGL::NORMAL);
+ ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);
itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));