diff options
Diffstat (limited to 'linden/indra/newview/llcallingcard.cpp')
-rw-r--r-- | linden/indra/newview/llcallingcard.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp index 15be0eb..f1328be 100644 --- a/linden/indra/newview/llcallingcard.cpp +++ b/linden/indra/newview/llcallingcard.cpp | |||
@@ -613,6 +613,25 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) | |||
613 | LLSD args; | 613 | LLSD args; |
614 | if(gCacheName->getName(agent_id, first, last)) | 614 | if(gCacheName->getName(agent_id, first, last)) |
615 | { | 615 | { |
616 | if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends")) | ||
617 | { | ||
618 | LLAvatarName avatar_name; | ||
619 | if (LLAvatarNameCache::get(agent_id, &avatar_name)) | ||
620 | { | ||
621 | // Always show "Display Name [Legacy Name]" for security reasons | ||
622 | first = avatar_name.getNames(); | ||
623 | size_t i = first.find(" "); | ||
624 | if (i != std::string::npos) | ||
625 | { | ||
626 | last = first.substr(i + 1); | ||
627 | first = first.substr(0, i); | ||
628 | } | ||
629 | else | ||
630 | { | ||
631 | last = ""; | ||
632 | } | ||
633 | } | ||
634 | } | ||
616 | args["FIRST_NAME"] = first; | 635 | args["FIRST_NAME"] = first; |
617 | args["LAST_NAME"] = last; | 636 | args["LAST_NAME"] = last; |
618 | } | 637 | } |
@@ -669,6 +688,31 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) | |||
669 | std::string first, last; | 688 | std::string first, last; |
670 | if(gCacheName->getName(agent_id, first, last)) | 689 | if(gCacheName->getName(agent_id, first, last)) |
671 | { | 690 | { |
691 | if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends")) | ||
692 | { | ||
693 | LLAvatarName avatar_name; | ||
694 | if (LLAvatarNameCache::get(agent_id, &avatar_name)) | ||
695 | { | ||
696 | if (LLAvatarNameCache::useDisplayNames() == 1) | ||
697 | { | ||
698 | first = avatar_name.mDisplayName; | ||
699 | } | ||
700 | else | ||
701 | { | ||
702 | first = avatar_name.getNames(); | ||
703 | } | ||
704 | size_t i = first.find(" "); | ||
705 | if (i != std::string::npos) | ||
706 | { | ||
707 | last = first.substr(i + 1); | ||
708 | first = first.substr(0, i); | ||
709 | } | ||
710 | else | ||
711 | { | ||
712 | last = ""; | ||
713 | } | ||
714 | } | ||
715 | } | ||
672 | notify = TRUE; | 716 | notify = TRUE; |
673 | args["FIRST"] = first; | 717 | args["FIRST"] = first; |
674 | args["LAST"] = last; | 718 | args["LAST"] = last; |
@@ -745,6 +789,12 @@ void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**) | |||
745 | } | 789 | } |
746 | } | 790 | } |
747 | 791 | ||
792 | void LLAvatarTracker::dirtyBuddies() | ||
793 | { | ||
794 | mModifyMask |= LLFriendObserver::REMOVE | LLFriendObserver::ADD; | ||
795 | notifyObservers(); | ||
796 | } | ||
797 | |||
748 | ///---------------------------------------------------------------------------- | 798 | ///---------------------------------------------------------------------------- |
749 | /// Tracking Data | 799 | /// Tracking Data |
750 | ///---------------------------------------------------------------------------- | 800 | ///---------------------------------------------------------------------------- |