SL-20210 Recent Emojis - Remember emojis that were actually sent in the message

master
Alexander Gavriliuk 2023-08-30 04:35:48 +02:00 committed by Guru
parent f18746a175
commit 44098db8b3
5 changed files with 21 additions and 2 deletions

View File

@ -669,7 +669,6 @@ void LLFloaterEmojiPicker::onEmojiMouseUp(LLUICtrl* ctrl)
{
if (LLEmojiGridIcon* icon = dynamic_cast<LLEmojiGridIcon*>(ctrl))
{
onEmojiUsed(icon->getEmoji());
if (mEmojiPickCallback)
{
mEmojiPickCallback(icon->getEmoji());

View File

@ -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;

View File

@ -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);

View File

@ -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()
{

View File

@ -147,6 +147,8 @@ protected:
std::string appendTime();
void assignResizeLimits();
void updateUsedEmojis(LLWString text);
S32 mFloaterExtraWidth;
bool mIsNearbyChat;