summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-08-30 04:35:48 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2023-08-30 12:16:46 +0200
commit44098db8b3fd96726fec7ec4b68b258a3408dff0 (patch)
treefd33e370f9dce7066f7602a7dc24481f552e66e2
parentf18746a1753fc8d5338fcaeb839540a071c68b13 (diff)
SL-20210 Recent Emojis - Remember emojis that were actually sent in the message
-rw-r--r--indra/newview/llfloateremojipicker.cpp1
-rw-r--r--indra/newview/llfloaterimnearbychat.cpp2
-rw-r--r--indra/newview/llfloaterimsession.cpp2
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp16
-rw-r--r--indra/newview/llfloaterimsessiontab.h2
5 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp
index 95ea9fc478..d24f627cdf 100644
--- a/indra/newview/llfloateremojipicker.cpp
+++ b/indra/newview/llfloateremojipicker.cpp
@@ -669,7 +669,6 @@ void LLFloaterEmojiPicker::onEmojiMouseUp(LLUICtrl* ctrl)
{
if (LLEmojiGridIcon* icon = dynamic_cast<LLEmojiGridIcon*>(ctrl))
{
- onEmojiUsed(icon->getEmoji());
if (mEmojiPickCallback)
{
mEmojiPickCallback(icon->getEmoji());
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 4d9d5de30d..40bdf14deb 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -591,6 +591,8 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type )
S32 channel = 0;
stripChannelNumber(text, &channel);
+ updateUsedEmojis(text);
+
std::string utf8text = wstring_to_utf8str(text);
// Try to trigger a gesture, if not chat to a script.
std::string utf8_revised_text;
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index ee9dc35283..ed2a2807b5 100644
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -249,6 +249,8 @@ void LLFloaterIMSession::sendMsgFromInputEditor()
LLWStringUtil::replaceChar(text,182,'\n'); // Convert paragraph symbols back into newlines.
if(!text.empty())
{
+ updateUsedEmojis(text);
+
// Truncate and convert to UTF8 for transport
std::string utf8_text = wstring_to_utf8str(text);
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 61722a823f..f840dbd9c2 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -38,6 +38,7 @@
#include "llchiclet.h"
#include "llchicletbar.h"
#include "lldraghandle.h"
+#include "llemojidictionary.h"
#include "llfloaterreg.h"
#include "llfloateremojipicker.h"
#include "llfloaterimsession.h"
@@ -513,7 +514,6 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value)
if (wstr.size())
{
llwchar emoji = wstr[0];
- LLFloaterEmojiPicker::onEmojiUsed(emoji);
onEmojiPicked(emoji);
}
}
@@ -576,6 +576,20 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD& args)
mChatHistory->appendMessage(chat, chat_args);
}
+void LLFloaterIMSessionTab::updateUsedEmojis(LLWString text)
+{
+ LLEmojiDictionary* dictionary = LLEmojiDictionary::getInstance();
+ llassert_always(dictionary);
+
+ for (llwchar& c : text)
+ {
+ if (dictionary->isEmoji(c))
+ {
+ LLFloaterEmojiPicker::onEmojiUsed(c);
+ }
+ }
+}
+
static LLTrace::BlockTimerStatHandle FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT("Build Conversation View");
void LLFloaterIMSessionTab::buildConversationViewParticipant()
{
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index 5f8ba44e48..d21f611172 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -147,6 +147,8 @@ protected:
std::string appendTime();
void assignResizeLimits();
+ void updateUsedEmojis(LLWString text);
+
S32 mFloaterExtraWidth;
bool mIsNearbyChat;