diff options
author | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:49 -0500 |
commit | c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd (patch) | |
tree | 49f225d319b111f30f113c4cf7728565afa52132 /linden/indra/newview/llpanelavatar.cpp | |
parent | Second Life viewer sources 1.13.2.15 (diff) | |
download | meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.zip meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.gz meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.bz2 meta-impy-c659c65d02d4d92b614ccdf2e2a4a0dcf859a8cd.tar.xz |
Second Life viewer sources 1.13.3.2
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 81 |
1 files changed, 32 insertions, 49 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 8ba33a9..c7019e0 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -419,8 +419,11 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) | |||
419 | childSetVisible("allow_publish",LLPanelAvatar::sAllowFirstLife); | 419 | childSetVisible("allow_publish",LLPanelAvatar::sAllowFirstLife); |
420 | childSetVisible("?",LLPanelAvatar::sAllowFirstLife); | 420 | childSetVisible("?",LLPanelAvatar::sAllowFirstLife); |
421 | 421 | ||
422 | childSetVisible("online_unknown",TRUE); | ||
423 | childSetVisible("online_yes",FALSE); | 422 | childSetVisible("online_yes",FALSE); |
423 | |||
424 | // These are cruft but may still exist in some xml files | ||
425 | // TODO: remove the following 2 lines once translators grab these changes | ||
426 | childSetVisible("online_unknown",FALSE); | ||
424 | childSetVisible("online_no",FALSE); | 427 | childSetVisible("online_no",FALSE); |
425 | 428 | ||
426 | childSetAction("Show on Map", LLPanelAvatar::onClickTrack, mPanelAvatar); | 429 | childSetAction("Show on Map", LLPanelAvatar::onClickTrack, mPanelAvatar); |
@@ -1298,6 +1301,19 @@ void LLPanelAvatar::setAvatar(LLViewerObject *avatarp) | |||
1298 | setAvatarID(avatarp->getID(), name, ONLINE_STATUS_YES); | 1301 | setAvatarID(avatarp->getID(), name, ONLINE_STATUS_YES); |
1299 | } | 1302 | } |
1300 | 1303 | ||
1304 | void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status) | ||
1305 | { | ||
1306 | // Online status NO could be because they are hidden | ||
1307 | // If they are a friend, we may know the truth! | ||
1308 | if ((ONLINE_STATUS_YES != online_status) | ||
1309 | && mIsFriend | ||
1310 | && (LLAvatarTracker::instance().isBuddyOnline( mAvatarID ))) | ||
1311 | { | ||
1312 | online_status = ONLINE_STATUS_YES; | ||
1313 | } | ||
1314 | |||
1315 | mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES)); | ||
1316 | } | ||
1301 | 1317 | ||
1302 | void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, | 1318 | void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, |
1303 | EOnlineStatus online_status) | 1319 | EOnlineStatus online_status) |
@@ -1314,50 +1330,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, | |||
1314 | // Determine if we have their calling card. | 1330 | // Determine if we have their calling card. |
1315 | mIsFriend = is_agent_friend(mAvatarID); | 1331 | mIsFriend = is_agent_friend(mAvatarID); |
1316 | 1332 | ||
1317 | if (ONLINE_STATUS_UNKNOWN == online_status) | 1333 | // setOnlineStatus uses mIsFriend |
1318 | { | 1334 | setOnlineStatus(online_status); |
1319 | // Determine if we know that they are online. If we can see them, | ||
1320 | // we know they're online. Likewise, if we have a calling card, | ||
1321 | // we know. Otherwise we don't. | ||
1322 | LLViewerObject* object = gObjectList.findObject( mAvatarID ); | ||
1323 | if (object && !object->isDead()) | ||
1324 | { | ||
1325 | online_status = ONLINE_STATUS_YES; | ||
1326 | } | ||
1327 | else if (mIsFriend) | ||
1328 | { | ||
1329 | if (LLAvatarTracker::instance().isBuddyOnline( mAvatarID )) | ||
1330 | { | ||
1331 | online_status = ONLINE_STATUS_YES; | ||
1332 | } | ||
1333 | else | ||
1334 | { | ||
1335 | online_status = ONLINE_STATUS_NO; | ||
1336 | } | ||
1337 | } | ||
1338 | else | ||
1339 | { | ||
1340 | // Don't actually know if they are online. | ||
1341 | } | ||
1342 | } | ||
1343 | |||
1344 | mPanelSecondLife->childSetVisible("online_unknown",FALSE); | ||
1345 | mPanelSecondLife->childSetVisible("online_yes",FALSE); | ||
1346 | mPanelSecondLife->childSetVisible("online_no",FALSE); | ||
1347 | |||
1348 | switch(online_status) | ||
1349 | { | ||
1350 | case ONLINE_STATUS_YES: | ||
1351 | mPanelSecondLife->childSetVisible("online_yes",TRUE); | ||
1352 | break; | ||
1353 | case ONLINE_STATUS_NO: | ||
1354 | mPanelSecondLife->childSetVisible("online_no",TRUE); | ||
1355 | break; | ||
1356 | case ONLINE_STATUS_UNKNOWN: | ||
1357 | default: | ||
1358 | mPanelSecondLife->childSetVisible("online_unknown",TRUE); | ||
1359 | break; | ||
1360 | } | ||
1361 | 1335 | ||
1362 | BOOL own_avatar = (mAvatarID == gAgent.getID() ); | 1336 | BOOL own_avatar = (mAvatarID == gAgent.getID() ); |
1363 | 1337 | ||
@@ -1755,8 +1729,11 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1755 | //BOOL mature = FALSE; | 1729 | //BOOL mature = FALSE; |
1756 | BOOL identified = FALSE; | 1730 | BOOL identified = FALSE; |
1757 | BOOL transacted = FALSE; | 1731 | BOOL transacted = FALSE; |
1732 | BOOL online = FALSE; | ||
1758 | char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; | 1733 | char profile_url[DB_USER_PROFILE_URL_BUF_SIZE]; |
1759 | 1734 | ||
1735 | U32 flags = 0x0; | ||
1736 | |||
1760 | //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; | 1737 | //llinfos << "properties packet size " << msg->getReceiveSize() << llendl; |
1761 | 1738 | ||
1762 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); | 1739 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); |
@@ -1776,7 +1753,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1776 | { | 1753 | { |
1777 | self->childSetEnabled("Rate...",TRUE); | 1754 | self->childSetEnabled("Rate...",TRUE); |
1778 | } | 1755 | } |
1779 | lldebugs << "!!!!!!!!!!!!!!!!!!!!!!Enabling drop target" << llendl; | ||
1780 | self->childSetEnabled("drop target",TRUE); | 1756 | self->childSetEnabled("drop target",TRUE); |
1781 | 1757 | ||
1782 | self->mHaveProperties = TRUE; | 1758 | self->mHaveProperties = TRUE; |
@@ -1788,9 +1764,17 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1788 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_AboutText, DB_USER_ABOUT_BUF_SIZE, about_text ); | 1764 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_AboutText, DB_USER_ABOUT_BUF_SIZE, about_text ); |
1789 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_FLAboutText, DB_USER_FL_ABOUT_BUF_SIZE, fl_about_text ); | 1765 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_FLAboutText, DB_USER_FL_ABOUT_BUF_SIZE, fl_about_text ); |
1790 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, DB_BORN_BUF_SIZE, born_on); | 1766 | msg->getStringFast(_PREHASH_PropertiesData, _PREHASH_BornOn, DB_BORN_BUF_SIZE, born_on); |
1791 | msg->getBOOLFast(_PREHASH_PropertiesData, _PREHASH_Identified, identified); | ||
1792 | msg->getBOOLFast(_PREHASH_PropertiesData, _PREHASH_Transacted, transacted); | ||
1793 | msg->getString("PropertiesData","ProfileURL", DB_USER_PROFILE_URL_BUF_SIZE, profile_url); | 1767 | msg->getString("PropertiesData","ProfileURL", DB_USER_PROFILE_URL_BUF_SIZE, profile_url); |
1768 | msg->getU32Fast(_PREHASH_PropertiesData, _PREHASH_Flags, flags); | ||
1769 | |||
1770 | identified = (flags & AVATAR_IDENTIFIED); | ||
1771 | transacted = (flags & AVATAR_TRANSACTED); | ||
1772 | allow_publish = (flags & AVATAR_ALLOW_PUBLISH); | ||
1773 | online = (flags & AVATAR_ONLINE); | ||
1774 | |||
1775 | EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; | ||
1776 | |||
1777 | self->setOnlineStatus(online_status); | ||
1794 | 1778 | ||
1795 | self->mPanelWeb->setWebURL(std::string(profile_url)); | 1779 | self->mPanelWeb->setWebURL(std::string(profile_url)); |
1796 | U8 caption_index = 0; | 1780 | U8 caption_index = 0; |
@@ -1868,7 +1852,6 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1868 | { | 1852 | { |
1869 | image_ctrl->setImageAssetID(fl_image_id); | 1853 | image_ctrl->setImageAssetID(fl_image_id); |
1870 | } | 1854 | } |
1871 | msg->getBOOL("PropertiesData", "AllowPublish", allow_publish); | ||
1872 | 1855 | ||
1873 | self->mPanelSecondLife->childSetValue("allow_publish", allow_publish); | 1856 | self->mPanelSecondLife->childSetValue("allow_publish", allow_publish); |
1874 | 1857 | ||