From 68a4975fe1583008fe25d2632bb0c4856f26d96b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 17 Apr 2019 15:01:48 -0400 Subject: [PATCH] Actually fix the removal of Starting session Thanks for the assistance and testing, Router~! --- indra/newview/llimpanel.cpp | 8 +++++--- indra/newview/llimpanel.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index e40970565..6334a7f62 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -288,7 +288,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( mInputEditor(NULL), mHistoryEditor(NULL), mSessionInitialized(false), - mSessionStartMsgPos(0), + mSessionStartMsgPos({0, 0}), mSessionType(P2P_SESSION), mSessionUUID(session_id), mLogLabel(log_label), @@ -396,12 +396,14 @@ LLFloaterIMPanel::LLFloaterIMPanel( LLUIString session_start = sSessionStartString; session_start.setArg("[NAME]", getTitle()); - mSessionStartMsgPos = mHistoryEditor->getWText().length(); + mSessionStartMsgPos.first = mHistoryEditor->getLength(); addHistoryLine( session_start, gSavedSettings.getColor4("SystemChatColor"), false); + + mSessionStartMsgPos.second = mHistoryEditor->getLength() - mSessionStartMsgPos.first; } } } @@ -1490,7 +1492,7 @@ void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id) mVoiceChannel->updateSessionID(session_id); mSessionInitialized = true; - mHistoryEditor->remove(mSessionStartMsgPos, sSessionStartString.size(), true); + mHistoryEditor->remove(mSessionStartMsgPos.first, mSessionStartMsgPos.second, true); //and now, send the queued msg for (LLSD::array_iterator iter = mQueuedMsgsForInit.beginArray(); diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 832c0ddee..1fddf5603 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -191,8 +191,8 @@ private: bool mSessionInitialized; - // Where does the "Starting session..." line start? - S32 mSessionStartMsgPos; + // Where does the "Starting session..." line start and how long is it? + std::pair mSessionStartMsgPos; SType mSessionType;