aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:54 -0500
committerJacek Antonelli2008-08-15 23:44:54 -0500
commitb2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch)
tree3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llpanelavatar.cpp
parentSecond Life viewer sources 1.14.0.1 (diff)
downloadmeta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp219
1 files changed, 78 insertions, 141 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index 70b18be..fd25775 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 5 * Copyright (c) 2004-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -29,6 +30,7 @@
29 30
30#include "llpanelavatar.h" 31#include "llpanelavatar.h"
31 32
33#include "llclassifiedflags.h"
32#include "llfontgl.h" 34#include "llfontgl.h"
33#include "llcachename.h" 35#include "llcachename.h"
34 36
@@ -43,10 +45,11 @@
43#include "llcallingcard.h" 45#include "llcallingcard.h"
44#include "llcheckboxctrl.h" 46#include "llcheckboxctrl.h"
45#include "llfloater.h" 47#include "llfloater.h"
48
49#include "llfloaterfriends.h"
46#include "llfloatergroupinfo.h" 50#include "llfloatergroupinfo.h"
47#include "llfloaterworldmap.h" 51#include "llfloaterworldmap.h"
48#include "llfloatermute.h" 52#include "llfloatermute.h"
49#include "llfloaterrate.h"
50#include "llfloateravatarinfo.h" 53#include "llfloateravatarinfo.h"
51#include "lliconctrl.h" 54#include "lliconctrl.h"
52#include "llinventoryview.h" 55#include "llinventoryview.h"
@@ -64,7 +67,7 @@
64#include "lluiconstants.h" 67#include "lluiconstants.h"
65#include "llvoavatar.h" 68#include "llvoavatar.h"
66#include "llviewermenu.h" // *FIX: for is_agent_friend() 69#include "llviewermenu.h" // *FIX: for is_agent_friend()
67#include "llviewermessage.h" // send_generic_message 70#include "llviewergenericmessage.h" // send_generic_message
68#include "llviewerobjectlist.h" 71#include "llviewerobjectlist.h"
69#include "llviewerregion.h" 72#include "llviewerregion.h"
70#include "llviewborder.h" 73#include "llviewborder.h"
@@ -78,7 +81,7 @@
78#include "llvieweruictrlfactory.h" 81#include "llvieweruictrlfactory.h"
79 82
80// Statics 83// Statics
81LLLinkedList<LLPanelAvatar> LLPanelAvatar::sAllPanels; 84std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
82BOOL LLPanelAvatar::sAllowFirstLife = FALSE; 85BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
83 86
84//----------------------------------------------------------------------------- 87//-----------------------------------------------------------------------------
@@ -274,14 +277,13 @@ void LLPanelAvatarTab::draw()
274 } 277 }
275} 278}
276 279
277void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* type) 280void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* method)
278{ 281{
279 if (!mDataRequested) 282 if (!mDataRequested)
280 { 283 {
281 std::vector<std::string> strings; 284 std::vector<std::string> strings;
282 strings.push_back( mPanelAvatar->getAvatarID().asString() ); 285 strings.push_back( mPanelAvatar->getAvatarID().asString() );
283 strings.push_back( type ); 286 send_generic_message(method, strings);
284 send_generic_message("avatarprofilerequest", strings);
285 mDataRequested = true; 287 mDataRequested = true;
286 } 288 }
287} 289}
@@ -465,7 +467,8 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
465 467
466 childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); 468 childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar());
467 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); 469 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar());
468 childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); 470
471 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar());
469 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); 472 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar());
470 childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); 473 childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() );
471 474
@@ -822,7 +825,7 @@ LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& re
822 825
823void LLPanelAvatarNotes::refresh() 826void LLPanelAvatarNotes::refresh()
824{ 827{
825 sendAvatarProfileRequestIfNeeded("notes"); 828 sendAvatarProfileRequestIfNeeded("avatarnotesrequest");
826} 829}
827 830
828void LLPanelAvatarNotes::clearControls() 831void LLPanelAvatarNotes::clearControls()
@@ -858,15 +861,15 @@ void LLPanelAvatarClassified::refresh()
858 861
859 S32 tab_count = tabs ? tabs->getTabCount() : 0; 862 S32 tab_count = tabs ? tabs->getTabCount() : 0;
860 863
861 BOOL allow_new = TRUE; //tab_count < MAX_CLASSIFIEDS; 864 bool allow_new = tab_count < MAX_CLASSIFIEDS;
862 BOOL allow_delete = (tab_count > 0); 865 bool allow_delete = (tab_count > 0);
863 BOOL show_help = (tab_count == 0); 866 bool show_help = (tab_count == 0);
864 867
865 childSetEnabled("New...",self && allow_new); 868 childSetEnabled("New...",self && allow_new);
866 childSetEnabled("Delete...",self && allow_delete); 869 childSetEnabled("Delete...",self && allow_delete);
867 childSetVisible("classified tab",!show_help); 870 childSetVisible("classified tab",!show_help);
868 871
869 sendAvatarProfileRequestIfNeeded("classifieds"); 872 sendAvatarProfileRequestIfNeeded("avatarclassifiedsrequest");
870} 873}
871 874
872 875
@@ -923,9 +926,8 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg,
923 926
924 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); 927 LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab");
925 928
926 // Clear out all the old panels. 929 // Don't remove old panels. We need to be able to process multiple
927 // We'll replace them with the correct number of new panels. 930 // packets for people who have lots of classifieds. JC
928 deleteClassifiedPanels();
929 931
930 block_count = msg->getNumberOfBlocksFast(_PREHASH_Data); 932 block_count = msg->getNumberOfBlocksFast(_PREHASH_Data);
931 for (block = 0; block < block_count; block++) 933 for (block = 0; block < block_count; block++)
@@ -1068,7 +1070,7 @@ void LLPanelAvatarPicks::refresh()
1068 childSetEnabled("New...",self && allow_new); 1070 childSetEnabled("New...",self && allow_new);
1069 childSetEnabled("Delete...",self && allow_delete); 1071 childSetEnabled("Delete...",self && allow_delete);
1070 1072
1071 sendAvatarProfileRequestIfNeeded("picks"); 1073 sendAvatarProfileRequestIfNeeded("avatarpicksrequest");
1072} 1074}
1073 1075
1074 1076
@@ -1099,6 +1101,9 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1099 // number of new panels. 1101 // number of new panels.
1100 deletePickPanels(); 1102 deletePickPanels();
1101 1103
1104 // The database needs to know for which user to look up picks.
1105 LLUUID avatar_id = getPanelAvatar()->getAvatarID();
1106
1102 block_count = msg->getNumberOfBlocks("Data"); 1107 block_count = msg->getNumberOfBlocks("Data");
1103 for (block = 0; block < block_count; block++) 1108 for (block = 0; block < block_count; block++)
1104 { 1109 {
@@ -1107,7 +1112,7 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1107 1112
1108 panel_pick = new LLPanelPick(FALSE); 1113 panel_pick = new LLPanelPick(FALSE);
1109 1114
1110 panel_pick->setPickID(pick_id); 1115 panel_pick->setPickID(pick_id, avatar_id);
1111 1116
1112 // This will request data from the server when the pick is first 1117 // This will request data from the server when the pick is first
1113 // drawn. 1118 // drawn.
@@ -1186,23 +1191,24 @@ void LLPanelAvatarPicks::callbackDelete(S32 option, void* data)
1186 if(gAgent.isGodlike()) 1191 if(gAgent.isGodlike())
1187 { 1192 {
1188 msg->newMessage("PickGodDelete"); 1193 msg->newMessage("PickGodDelete");
1194 msg->nextBlock("AgentData");
1195 msg->addUUID("AgentID", gAgent.getID());
1196 msg->addUUID("SessionID", gAgent.getSessionID());
1197 msg->nextBlock("Data");
1198 msg->addUUID("PickID", panel_pick->getPickID());
1199 // *HACK: We need to send the pick's creator id to accomplish
1200 // the delete, and we don't use the query id for anything. JC
1201 msg->addUUID( "QueryID", panel_pick->getPickCreatorID() );
1189 } 1202 }
1190 else 1203 else
1191 { 1204 {
1192 msg->newMessage("PickDelete"); 1205 msg->newMessage("PickDelete");
1206 msg->nextBlock("AgentData");
1207 msg->addUUID("AgentID", gAgent.getID());
1208 msg->addUUID("SessionID", gAgent.getSessionID());
1209 msg->nextBlock("Data");
1210 msg->addUUID("PickID", panel_pick->getPickID());
1193 } 1211 }
1194 msg->nextBlock("AgentData");
1195 msg->addUUID("AgentID", gAgent.getID());
1196 msg->addUUID("SessionID", gAgent.getSessionID());
1197 msg->nextBlock("Data");
1198 msg->addUUID("PickID", panel_pick->getPickID());
1199
1200 //God delete receiving end expects a query ID but we dont need it, so send a null.
1201 //This is to resolve SL-24170 God Picks Delete results in crash.
1202 if(gAgent.isGodlike())
1203 msg->addUUID( "QueryID", LLUUID::null );
1204
1205
1206 gAgent.sendReliableMessage(); 1212 gAgent.sendReliableMessage();
1207 1213
1208 if(tabs) 1214 if(tabs)
@@ -1235,11 +1241,10 @@ LLPanelAvatar::LLPanelAvatar(
1235 mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID' 1241 mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID'
1236 mHaveProperties(FALSE), 1242 mHaveProperties(FALSE),
1237 mHaveStatistics(FALSE), 1243 mHaveStatistics(FALSE),
1238 mAllowEdit(allow_edit), 1244 mAllowEdit(allow_edit)
1239 mDisableRate(FALSE)
1240{ 1245{
1241 1246
1242 sAllPanels.addData(this); 1247 sAllPanels.push_back(this);
1243 1248
1244 LLCallbackMap::map_t factory_map; 1249 LLCallbackMap::map_t factory_map;
1245 1250
@@ -1291,7 +1296,7 @@ BOOL LLPanelAvatar::postBuild(void)
1291 1296
1292LLPanelAvatar::~LLPanelAvatar() 1297LLPanelAvatar::~LLPanelAvatar()
1293{ 1298{
1294 sAllPanels.removeData(this); 1299 sAllPanels.remove(this);
1295} 1300}
1296 1301
1297 1302
@@ -1451,8 +1456,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1451 childSetEnabled("drop target",FALSE); 1456 childSetEnabled("drop target",FALSE);
1452 childSetVisible("Show on Map",FALSE); 1457 childSetVisible("Show on Map",FALSE);
1453 childSetEnabled("Show on Map",FALSE); 1458 childSetEnabled("Show on Map",FALSE);
1454 childSetVisible("Rate...",FALSE); 1459 childSetVisible("Add Friend...",FALSE);
1455 childSetEnabled("Rate...",FALSE); 1460 childSetEnabled("Add Friend...",FALSE);
1456 childSetVisible("Pay...",FALSE); 1461 childSetVisible("Pay...",FALSE);
1457 childSetEnabled("Pay...",FALSE); 1462 childSetEnabled("Pay...",FALSE);
1458 } 1463 }
@@ -1489,8 +1494,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
1489 { 1494 {
1490 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString()); 1495 childSetToolTip("Show on Map",childGetValue("ShowOnMapFriendOnline").asString());
1491 } 1496 }
1492 childSetVisible("Rate...",TRUE); 1497 childSetVisible("Add Friend...", true);
1493 childSetEnabled("Rate...",FALSE); 1498 childSetEnabled("Add Friend...", true);
1494 childSetVisible("Pay...",TRUE); 1499 childSetVisible("Pay...",TRUE);
1495 childSetEnabled("Pay...",FALSE); 1500 childSetEnabled("Pay...",FALSE);
1496 } 1501 }
@@ -1522,7 +1527,6 @@ void LLPanelAvatar::resetGroupList()
1522 if (mPanelSecondLife && group_list) 1527 if (mPanelSecondLife && group_list)
1523 { 1528 {
1524 group_list->deleteAllItems(); 1529 group_list->deleteAllItems();
1525 LLScrollListItem* item;
1526 1530
1527 S32 count = gAgent.mGroups.count(); 1531 S32 count = gAgent.mGroups.count();
1528 LLUUID id; 1532 LLUUID id;
@@ -1544,9 +1548,12 @@ void LLPanelAvatar::resetGroupList()
1544 */ 1548 */
1545 1549
1546 group_string += group_data.mName; 1550 group_string += group_data.mName;
1547 item = new LLScrollListItem(TRUE, NULL, id); 1551
1548 item->addColumn(group_string, LLFontGL::sSansSerifSmall, 0, LLFontGL::NORMAL); 1552 LLSD row;
1549 group_list->addItem(item); 1553 row["columns"][0]["value"] = group_string;
1554 row["columns"][0]["font"] = "SANSSERIF_SMALL";
1555 row["columns"][0]["width"] = 0;
1556 group_list->addElement(row);
1550 } 1557 }
1551 group_list->sortByColumn(0, TRUE); 1558 group_list->sortByColumn(0, TRUE);
1552 } 1559 }
@@ -1586,15 +1593,17 @@ void LLPanelAvatar::onClickTrack(void* userdata)
1586 } 1593 }
1587} 1594}
1588 1595
1596
1589// static 1597// static
1590//----------------------------------------------------------------------------- 1598void LLPanelAvatar::onClickAddFriend(void* userdata)
1591// onClickRate()
1592//-----------------------------------------------------------------------------
1593void LLPanelAvatar::onClickRate(void *userdata)
1594{ 1599{
1595 LLPanelAvatar* self = (LLPanelAvatar*) userdata; 1600 LLPanelAvatar* self = (LLPanelAvatar*) userdata;
1596 1601 LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name");
1597 LLFloaterRate::show(self->mAvatarID); 1602 if (name_edit)
1603 {
1604 LLFloaterFriends::requestFriendshipDialog(self->getAvatarID(),
1605 name_edit->getText());
1606 }
1598} 1607}
1599 1608
1600//----------------------------------------------------------------------------- 1609//-----------------------------------------------------------------------------
@@ -1625,15 +1634,6 @@ void LLPanelAvatar::onClickMute(void *userdata)
1625} 1634}
1626 1635
1627 1636
1628void LLPanelAvatar::disableRate()
1629{
1630 // Force off the rate button, but enable IM.
1631 // Note that these buttons may not exist if it is your own profile.
1632 childSetEnabled("Rate...",FALSE);
1633 mDisableRate = TRUE;
1634}
1635
1636
1637// static 1637// static
1638void LLPanelAvatar::onClickOfferTeleport(void *userdata) 1638void LLPanelAvatar::onClickOfferTeleport(void *userdata)
1639{ 1639{
@@ -1747,8 +1747,6 @@ void LLPanelAvatar::sendAvatarNotesUpdate()
1747// static 1747// static
1748void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) 1748void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1749{ 1749{
1750 LLPanelAvatar* self = NULL;
1751
1752 LLUUID agent_id; // your id 1750 LLUUID agent_id; // your id
1753 LLUUID avatar_id; // target of this panel 1751 LLUUID avatar_id; // target of this panel
1754 LLUUID image_id; 1752 LLUUID image_id;
@@ -1772,8 +1770,9 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1772 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); 1770 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
1773 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); 1771 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id );
1774 1772
1775 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 1773 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
1776 { 1774 {
1775 LLPanelAvatar* self = *iter;
1777 if (self->mAvatarID != avatar_id) 1776 if (self->mAvatarID != avatar_id)
1778 { 1777 {
1779 continue; 1778 continue;
@@ -1782,10 +1781,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1782 self->childSetEnabled("Pay...",TRUE); 1781 self->childSetEnabled("Pay...",TRUE);
1783 self->childSetEnabled("Mute",TRUE); 1782 self->childSetEnabled("Mute",TRUE);
1784 1783
1785 if (!self->mDisableRate)
1786 {
1787 self->childSetEnabled("Rate...",TRUE);
1788 }
1789 self->childSetEnabled("drop target",TRUE); 1784 self->childSetEnabled("drop target",TRUE);
1790 1785
1791 self->mHaveProperties = TRUE; 1786 self->mHaveProperties = TRUE;
@@ -1895,8 +1890,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1895// static 1890// static
1896void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**) 1891void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**)
1897{ 1892{
1898 LLPanelAvatar* self = NULL;
1899
1900 LLUUID agent_id; // your id 1893 LLUUID agent_id; // your id
1901 LLUUID avatar_id; // target of this panel 1894 LLUUID avatar_id; // target of this panel
1902 1895
@@ -1911,8 +1904,9 @@ void LLPanelAvatar::processAvatarInterestsReply(LLMessageSystem *msg, void**)
1911 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); 1904 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
1912 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); 1905 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id );
1913 1906
1914 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 1907 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
1915 { 1908 {
1909 LLPanelAvatar* self = *iter;
1916 if (self->mAvatarID != avatar_id) 1910 if (self->mAvatarID != avatar_id)
1917 { 1911 {
1918 continue; 1912 continue;
@@ -1940,15 +1934,15 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
1940 LLUUID group_id; 1934 LLUUID group_id;
1941 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ 1935 char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1942 LLUUID group_insignia_id; 1936 LLUUID group_insignia_id;
1943 const LLFontGL* FONT = LLFontGL::sSansSerifSmall;
1944 1937
1945 llinfos << "groups packet size " << msg->getReceiveSize() << llendl; 1938 llinfos << "groups packet size " << msg->getReceiveSize() << llendl;
1946 1939
1947 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); 1940 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
1948 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id ); 1941 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AvatarID, avatar_id );
1949 1942
1950 for (LLPanelAvatar* self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 1943 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
1951 { 1944 {
1945 LLPanelAvatar* self = *iter;
1952 if (self->mAvatarID != avatar_id) 1946 if (self->mAvatarID != avatar_id)
1953 { 1947 {
1954 continue; 1948 continue;
@@ -1996,9 +1990,15 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
1996 group_list->deleteSingleItem(index); 1990 group_list->deleteSingleItem(index);
1997 } 1991 }
1998 } 1992 }
1999 LLScrollListItem *group_item = new LLScrollListItem(TRUE, NULL, group_id); 1993
2000 group_item->addColumn(group_string, FONT); 1994 LLSD row;
2001 if(group_list) group_list->addItem(group_item); 1995 row["id"] = group_id;
1996 row["columns"][0]["value"] = group_string;
1997 row["columns"][0]["font"] = "SANSSERIF_SMALL";
1998 if (group_list)
1999 {
2000 group_list->addElement(row);
2001 }
2002 } 2002 }
2003 } 2003 }
2004 if(group_list) group_list->sortByColumn(0, TRUE); 2004 if(group_list) group_list->sortByColumn(0, TRUE);
@@ -2009,7 +2009,7 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
2009// Otherwise you will write blanks back into the database. 2009// Otherwise you will write blanks back into the database.
2010void LLPanelAvatar::enableOKIfReady() 2010void LLPanelAvatar::enableOKIfReady()
2011{ 2011{
2012 if(mHaveProperties && mHaveStatistics && childIsVisible("OK")) 2012 if(mHaveProperties && childIsVisible("OK"))
2013 { 2013 {
2014 childSetEnabled("OK", TRUE); 2014 childSetEnabled("OK", TRUE);
2015 } 2015 }
@@ -2115,68 +2115,6 @@ void LLPanelAvatar::selectTabByName(std::string tab_name)
2115} 2115}
2116 2116
2117 2117
2118// static
2119void LLPanelAvatar::processAvatarStatisticsReply(LLMessageSystem *msg, void**)
2120{
2121 // extract the agent id
2122 LLUUID agent_id;
2123 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
2124
2125 LLUUID avatar_id;
2126 msg->getUUIDFast(_PREHASH_AvatarData, _PREHASH_AvatarID, avatar_id);
2127
2128 // look up all panels which have this avatar
2129 LLPanelAvatar *self = NULL;
2130
2131 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData())
2132 {
2133 if (self->mAvatarID != avatar_id)
2134 {
2135 continue;
2136 }
2137
2138 self->mHaveStatistics = TRUE;
2139 self->enableOKIfReady();
2140
2141 // clear out list
2142 LLScrollListCtrl* ratings_list = LLUICtrlFactory::getScrollListByName(self->mPanelSecondLife,"ratings");
2143 if (ratings_list)
2144 {
2145 ratings_list->deleteAllItems();
2146 }
2147 // build the item list
2148 LLFontGL *font = LLFontGL::sSansSerifSmall;
2149
2150 S32 items = msg->getNumberOfBlocksFast(_PREHASH_StatisticsData);
2151 for (S32 i = 0; i < items; i++)
2152 {
2153 char name[MAX_STRING]; /*Flawfinder: ignore*/
2154 S32 positive;
2155 S32 negative;
2156 char value_string[MAX_STRING]; /*Flawfinder: ignore*/
2157
2158 msg->getStringFast( _PREHASH_StatisticsData,
2159 _PREHASH_Name, MAX_STRING, name, i);
2160 msg->getS32( "StatisticsData", "Positive", positive, i);
2161 msg->getS32( "StatisticsData", "Negative", negative, i);
2162
2163 LLScrollListItem *item = NULL;
2164
2165 const S32 TEXT_WIDTH = 75;
2166
2167 item = new LLScrollListItem();
2168 item->addColumn( name, font, TEXT_WIDTH );
2169
2170 snprintf( value_string, sizeof(value_string), "+%d", positive); /*Flawfinder: ignore*/
2171 item->addColumn( value_string, font, 50 );
2172
2173 item->addColumn("", font); // extra column to force striped appearance
2174 if(ratings_list) ratings_list->addItem( item );
2175 }
2176 }
2177}
2178
2179
2180void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**) 2118void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
2181{ 2119{
2182 // extract the agent id 2120 // extract the agent id
@@ -2187,10 +2125,9 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
2187 msg->getUUID("Data", "TargetID", target_id); 2125 msg->getUUID("Data", "TargetID", target_id);
2188 2126
2189 // look up all panels which have this avatar 2127 // look up all panels which have this avatar
2190 LLPanelAvatar *self = NULL; 2128 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
2191
2192 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData())
2193 { 2129 {
2130 LLPanelAvatar* self = *iter;
2194 if (self->mAvatarID != target_id) 2131 if (self->mAvatarID != target_id)
2195 { 2132 {
2196 continue; 2133 continue;
@@ -2206,7 +2143,6 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
2206 2143
2207void LLPanelAvatar::processAvatarClassifiedReply(LLMessageSystem *msg, void** userdata) 2144void LLPanelAvatar::processAvatarClassifiedReply(LLMessageSystem *msg, void** userdata)
2208{ 2145{
2209 LLPanelAvatar *self = NULL;
2210 LLUUID agent_id; 2146 LLUUID agent_id;
2211 LLUUID target_id; 2147 LLUUID target_id;
2212 2148
@@ -2214,8 +2150,9 @@ void LLPanelAvatar::processAvatarClassifiedReply(LLMessageSystem *msg, void** us
2214 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TargetID, target_id); 2150 msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TargetID, target_id);
2215 2151
2216 // look up all panels which have this avatar target 2152 // look up all panels which have this avatar target
2217 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 2153 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
2218 { 2154 {
2155 LLPanelAvatar* self = *iter;
2219 if (self->mAvatarID != target_id) 2156 if (self->mAvatarID != target_id)
2220 { 2157 {
2221 continue; 2158 continue;
@@ -2227,7 +2164,6 @@ void LLPanelAvatar::processAvatarClassifiedReply(LLMessageSystem *msg, void** us
2227 2164
2228void LLPanelAvatar::processAvatarPicksReply(LLMessageSystem *msg, void** userdata) 2165void LLPanelAvatar::processAvatarPicksReply(LLMessageSystem *msg, void** userdata)
2229{ 2166{
2230 LLPanelAvatar *self = NULL;
2231 LLUUID agent_id; 2167 LLUUID agent_id;
2232 LLUUID target_id; 2168 LLUUID target_id;
2233 2169
@@ -2235,8 +2171,9 @@ void LLPanelAvatar::processAvatarPicksReply(LLMessageSystem *msg, void** userdat
2235 msg->getUUID("AgentData", "TargetID", target_id); 2171 msg->getUUID("AgentData", "TargetID", target_id);
2236 2172
2237 // look up all panels which have this avatar target 2173 // look up all panels which have this avatar target
2238 for (self = sAllPanels.getFirstData(); self; self = sAllPanels.getNextData()) 2174 for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
2239 { 2175 {
2176 LLPanelAvatar* self = *iter;
2240 if (self->mAvatarID != target_id) 2177 if (self->mAvatarID != target_id)
2241 { 2178 {
2242 continue; 2179 continue;