From 146e9d5e4d9a9a4f33d9ccd47a901980972b7ab9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 17:06:18 -0800 Subject: Support returning full_name (and SLID) for LLCacheName::get() calls Changed callback signature to full_name instead of first_name,last_name Eliminated all calls to legacy (non-signal/non-boost-bind) lookup mechanism Change Pay dialog names to SLURL links Tweaked layout of Pay Resident and Pay via Object floaters to make SLURLs fit Consolidate name first + " " + last concatenation in LLCacheName::buildFullName() Reviewed with Kelly --- indra/llmessage/llcachename.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 111cc8b650..c7385204f5 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -42,13 +42,12 @@ class LLUUID; typedef boost::signals2::signal LLCacheNameSignal; + const std::string& name, + bool is_group)> LLCacheNameSignal; typedef LLCacheNameSignal::slot_type LLCacheNameCallback; // Old callback with user data for compatability -typedef void (*old_callback_t)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); +typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*); // Here's the theory: // If you request a name that isn't in the cache, it returns "waiting" @@ -89,6 +88,10 @@ public: // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); BOOL getUUID(const std::string& fullname, LLUUID& id); + + // IDEVO Temporary code + // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display + static std::string buildFullname(const std::string& first, const std::string& last); // If available, this method copies the group name into the string // provided. The caller must allocate at least @@ -100,10 +103,10 @@ public: // If the data is currently available, may call the callback immediatly // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. - boost::signals2::connection get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback); + boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); // LEGACY - boost::signals2::connection get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data); + boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out // requests. void processPending(); -- cgit v1.2.3 From 42176145c9e81dd99b65f88152df50a7b3ccf834 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 8 Feb 2010 14:55:30 -0800 Subject: Converted names build from avatar object LLNameValue pairs to SLID Added temporary getDisplayName() to LLCacheName Moved temporary placeholder display names into LLCacheName Eliminated rarely used LLAgentUI::buildName in favor of buildFullName Standardized buildFullName capitalization --- indra/llmessage/llcachename.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index c7385204f5..76865928d3 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -77,13 +77,16 @@ public: bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); - // If available, copies the first and last name into the strings provided. - // first must be at least DB_FIRST_NAME_BUF_SIZE characters. - // last must be at least DB_LAST_NAME_BUF_SIZE characters. + // If available, copies name ("bobsmith123" or "James Linden") into string // If not available, copies the string "waiting". // Returns TRUE iff available. - BOOL getName(const LLUUID& id, std::string& first, std::string& last); - BOOL getFullName(const LLUUID& id, std::string& fullname); + BOOL getFullName(const LLUUID& id, std::string& full_name); + + // IDEVO temporary code + // If available, copies display name (UTF-8) into string + // If not available, copies empty string + // Returns TRUE iff available + bool getDisplayName(const LLUUID& id, std::string& display_name); // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); @@ -91,7 +94,7 @@ public: // IDEVO Temporary code // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display - static std::string buildFullname(const std::string& first, const std::string& last); + static std::string buildFullName(const std::string& first, const std::string& last); // If available, this method copies the group name into the string // provided. The caller must allocate at least -- cgit v1.2.3 From 4c4ba930029c34c6810c7e229b186e89b458053a Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 11 Feb 2010 16:44:42 -0800 Subject: Removed temporary LLCacheName::getDisplayName code --- indra/llmessage/llcachename.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 76865928d3..322ca4aa1a 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -82,12 +82,6 @@ public: // Returns TRUE iff available. BOOL getFullName(const LLUUID& id, std::string& full_name); - // IDEVO temporary code - // If available, copies display name (UTF-8) into string - // If not available, copies empty string - // Returns TRUE iff available - bool getDisplayName(const LLUUID& id, std::string& display_name); - // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); BOOL getUUID(const std::string& fullname, LLUUID& id); -- cgit v1.2.3 From c16591c046fa76fc5d13387efa3bcaec3422e593 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 12 Feb 2010 16:12:12 -0800 Subject: Per-avatar customizable icons next to name links in text Changed LLUrlEntryAgent callbacks to handle both link label and icon Eliminated legacy LLNameCache file loading Reviewed with Kelly --- indra/llmessage/llcachename.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 322ca4aa1a..8d8e172c08 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -70,9 +70,6 @@ public: boost::signals2::connection addObserver(const LLCacheNameCallback& callback); - // janky old format. Remove after a while. Phoenix. 2008-01-30 - void importFile(LLFILE* fp); - // storing cache on disk; for viewer, in name.cache bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); @@ -116,7 +113,7 @@ public: void dumpStats(); // Dumps the sizes of the cache and associated queues. static std::string getDefaultName(); - static void LocalizeCacheName(std::string key, std::string value); + static void localizeCacheName(std::string key, std::string value); static std::map sCacheName; private: -- cgit v1.2.3 From b34225a1918026ed8557a19cacf5925d107c134a Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 16 Feb 2010 10:40:53 -0800 Subject: Fix server to use updated LLCacheName API. Fixed callback signatures. Added LLCacheName::getDefaultLastName() to return "Resident" Reviewed with Huseby --- indra/llmessage/llcachename.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 8d8e172c08..59ad03cfcc 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -113,6 +113,11 @@ public: void dumpStats(); // Dumps the sizes of the cache and associated queues. static std::string getDefaultName(); + + // Returns "Resident", the default last name for SLID-based accounts + // that have no last name. + static std::string getDefaultLastName(); + static void localizeCacheName(std::string key, std::string value); static std::map sCacheName; private: -- cgit v1.2.3 From 5774acb84e486c1eabad88093e80e3985d36dfcb Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 17 Feb 2010 09:19:06 -0800 Subject: Added function LLCacheName::cleanFullName() to strip " Resident" from strings --- indra/llmessage/llcachename.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 59ad03cfcc..083975d4ca 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -86,6 +86,10 @@ public: // IDEVO Temporary code // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display static std::string buildFullName(const std::string& first, const std::string& last); + + // Clean up legacy "bobsmith123 Resident" to "bobsmith123" + // If name does not contain "Resident" returns it unchanged. + static std::string cleanFullName(const std::string& full_name); // If available, this method copies the group name into the string // provided. The caller must allocate at least -- cgit v1.2.3 From c1d7e7d5d961819255f6f2fe4de5ece3b80867db Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 19 Feb 2010 10:53:17 -0800 Subject: Added clear() method for debugging --- indra/llmessage/llcachename.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 083975d4ca..6b6bbde6ab 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -115,6 +115,7 @@ public: // Debugging void dump(); // Dumps the contents of the cache void dumpStats(); // Dumps the sizes of the cache and associated queues. + void clear(); // Deletes all entries from the cache static std::string getDefaultName(); -- cgit v1.2.3 From 77e6fcd4230f7540c9f4d6f3d503737c6eaf408c Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 25 May 2010 11:39:06 -0700 Subject: DEV-50013 WIP gCacheName->getGroup() to distinguish from av lookups Helps with global finds looking for remaining calls to patch. Reviewed with Leyla. --- indra/llmessage/llcachename.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 6b6bbde6ab..45dae562ad 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -102,7 +102,12 @@ public: // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); - + + // Convenience method for looking up a group name, so you can + // tell the difference between avatar lookup and group lookup + // in global searches + boost::signals2::connection getGroup(const LLUUID& group_id, const LLCacheNameCallback& callback); + // LEGACY boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out -- cgit v1.2.3 From 6cb420b20bd509e7bf62c8450f12d433c5a81be2 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 27 May 2010 15:12:03 -0700 Subject: added function for building a username from a legacy name and fixed group notice panel reviewed by James --- indra/llmessage/llcachename.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 45dae562ad..697bb27556 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -91,6 +91,11 @@ public: // If name does not contain "Resident" returns it unchanged. static std::string cleanFullName(const std::string& full_name); + // Converts a standard legacy name to a username + // "bobsmith123 Resident" -> "bobsmith" + // "Random Linden" -> "random.linden" + static std::string buildUsername(const std::string& name); + // If available, this method copies the group name into the string // provided. The caller must allocate at least // DB_GROUP_NAME_BUF_SIZE characters. If not available, this -- cgit v1.2.3 From cb5d8d1a9295076327f23e5f6d6c91fd0d4580ea Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 22 Oct 2010 17:41:06 -0700 Subject: DN-181 Chat & IM logs saved in unreadable .llsd instead of .txt --- indra/llmessage/llcachename.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llmessage/llcachename.h') diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index b469803060..b108e37157 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -90,6 +90,12 @@ public: // "Random Linden" -> "random.linden" static std::string buildUsername(const std::string& name); + // Converts a complete display name to a legacy name + // if possible, otherwise returns the input + // "Alias (random.linden)" -> "Random Linden" + // "Something random" -> "Something random" + static std::string buildLegacyName(const std::string& name); + // If available, this method copies the group name into the string // provided. The caller must allocate at least // DB_GROUP_NAME_BUF_SIZE characters. If not available, this -- cgit v1.2.3