summaryrefslogtreecommitdiff
path: root/indra/llui/llemojidictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llemojidictionary.cpp')
-rw-r--r--indra/llui/llemojidictionary.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llui/llemojidictionary.cpp b/indra/llui/llemojidictionary.cpp
index b70a9b2e7a..d306407484 100644
--- a/indra/llui/llemojidictionary.cpp
+++ b/indra/llui/llemojidictionary.cpp
@@ -175,6 +175,12 @@ LLWString LLEmojiDictionary::findMatchingEmojis(const std::string& needle) const
return result;
}
+const LLEmojiDescriptor* LLEmojiDictionary::getDescriptorFromEmoji(llwchar emoji) const
+{
+ const auto it = mEmoji2Descr.find(emoji);
+ return (mEmoji2Descr.end() != it) ? it->second : nullptr;
+}
+
const LLEmojiDescriptor* LLEmojiDictionary::getDescriptorFromShortCode(const std::string& short_code) const
{
const auto it = mShortCode2Descr.find(short_code);
@@ -195,6 +201,10 @@ void LLEmojiDictionary::addEmoji(LLEmojiDescriptor&& descr)
{
mShortCode2Descr.insert(std::make_pair(shortCode, &mEmojis.back()));
}
+ for (const std::string& category : descr.Categories)
+ {
+ mCategory2Descrs[category].push_back(&mEmojis.back());
+ }
}
// ============================================================================