aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llcallingcard.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index b7fd3b0..1d353fa 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -625,7 +625,7 @@ void LLAvatarTracker::processChangeUserRights(LLMessageSystem* msg, void**)
625void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) 625void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
626{ 626{
627 S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock); 627 S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock);
628 BOOL chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification"); 628 BOOL notify = gSavedSettings.getBOOL("ChatOnlineNotification");
629 629
630 lldebugs << "Received " << count << " online notifications **** " << llendl; 630 lldebugs << "Received " << count << " online notifications **** " << llendl;
631 if(count > 0) 631 if(count > 0)
@@ -637,7 +637,6 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
637 { 637 {
638 tracking_id = mTrackingData->mAvatarID; 638 tracking_id = mTrackingData->mAvatarID;
639 } 639 }
640 BOOL notify = FALSE;
641 LLStringUtil::format_map_t args; 640 LLStringUtil::format_map_t args;
642 for(S32 i = 0; i < count; ++i) 641 for(S32 i = 0; i < count; ++i)
643 { 642 {
@@ -646,14 +645,16 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
646 if(info) 645 if(info)
647 { 646 {
648 setBuddyOnline(agent_id,online); 647 setBuddyOnline(agent_id,online);
649 if(chat_notify) 648
649 std::string first, last;
650 if(gCacheName->getName(agent_id, first, last))
650 { 651 {
651 std::string first, last; 652 args["[FIRST]"] = first;
652 if(gCacheName->getName(agent_id, first, last)) 653 args["[LAST]"] = last;
654 if(notify)
653 { 655 {
654 notify = TRUE; 656 // Popup a notify box with online status of this agent
655 args["[FIRST]"] = first; 657 LLNotifyBox::showXml(online ? "FriendOnline" : "FriendOffline", args);
656 args["[LAST]"] = last;
657 } 658 }
658 } 659 }
659 } 660 }
@@ -671,20 +672,16 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
671 // *TODO: get actual inventory id 672 // *TODO: get actual inventory id
672 gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null); 673 gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null);
673 } 674 }
674 if(notify)
675 {
676 // Popup a notify box with online status of this agent
677 LLNotifyBox::showXml(online ? "FriendOnline" : "FriendOffline", args);
678 675
679 // If there's an open IM session with this agent, send a notification there too. 676 // If there's an open IM session with this agent, send a notification there too
680 LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); 677 // even if ChatOnlineNotification is false.
681 LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); 678 LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
682 if (floater) 679 LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
683 { 680 if (floater)
684 LLUIString notifyMsg = LLNotifyBox::getTemplateMessage((online ? "FriendOnline" : "FriendOffline"),args); 681 {
685 if (!notifyMsg.empty()) 682 LLUIString notifyMsg = LLNotifyBox::getTemplateMessage((online ? "FriendOnline" : "FriendOffline"),args);
686 floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); 683 if (!notifyMsg.empty())
687 } 684 floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
688 } 685 }
689 686
690 mModifyMask |= LLFriendObserver::ONLINE; 687 mModifyMask |= LLFriendObserver::ONLINE;