Don't const_cast LLChat, just accept it as non-const.
This commit is contained in:
@@ -228,6 +228,12 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
|
|||||||
edit->appendText(line, false, prepend_newline, style, false);
|
edit->appendText(line, false, prepend_newline, style, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterChat::addChatHistory(const std::string& str, bool log_to_file)
|
||||||
|
{
|
||||||
|
LLChat chat(str);
|
||||||
|
addChatHistory(chat, log_to_file);
|
||||||
|
}
|
||||||
|
|
||||||
void log_chat_text(const LLChat& chat)
|
void log_chat_text(const LLChat& chat)
|
||||||
{
|
{
|
||||||
std::string histstr;
|
std::string histstr;
|
||||||
@@ -239,7 +245,7 @@ void log_chat_text(const LLChat& chat)
|
|||||||
LLLogChat::saveHistory(std::string("chat"), histstr);
|
LLLogChat::saveHistory(std::string("chat"), histstr);
|
||||||
}
|
}
|
||||||
// static
|
// static
|
||||||
void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
|
void LLFloaterChat::addChatHistory(LLChat& chat, bool log_to_file)
|
||||||
{
|
{
|
||||||
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
|
||||||
if (rlv_handler_t::isEnabled())
|
if (rlv_handler_t::isEnabled())
|
||||||
@@ -247,20 +253,18 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
|
|||||||
// TODO-RLVa: we might cast too broad a net by filtering here, needs testing
|
// TODO-RLVa: we might cast too broad a net by filtering here, needs testing
|
||||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
||||||
{
|
{
|
||||||
LLChat& rlvChat = const_cast<LLChat&>(chat);
|
RlvUtil::filterLocation(chat.mText);
|
||||||
RlvUtil::filterLocation(rlvChat.mText);
|
chat.mRlvLocFiltered = TRUE;
|
||||||
rlvChat.mRlvLocFiltered = TRUE;
|
|
||||||
}
|
}
|
||||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) )
|
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) )
|
||||||
{
|
{
|
||||||
// NOTE: this will also filter inventory accepted/declined text in the chat history
|
// NOTE: this will also filter inventory accepted/declined text in the chat history
|
||||||
LLChat& rlvChat = const_cast<LLChat&>(chat);
|
|
||||||
if (CHAT_SOURCE_AGENT != chat.mSourceType)
|
if (CHAT_SOURCE_AGENT != chat.mSourceType)
|
||||||
{
|
{
|
||||||
// Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup)
|
// Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup)
|
||||||
RlvUtil::filterNames(rlvChat.mText);
|
RlvUtil::filterNames(chat.mText);
|
||||||
}
|
}
|
||||||
rlvChat.mRlvNamesFiltered = TRUE;
|
chat.mRlvNamesFiltered = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
@@ -276,10 +280,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
|
|||||||
|
|
||||||
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
|
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
|
||||||
{
|
{
|
||||||
LLFloaterScriptDebug::addScriptLine(chat.mText,
|
LLFloaterScriptDebug::addScriptLine(chat, color);
|
||||||
chat.mFromName,
|
|
||||||
color,
|
|
||||||
chat.mFromID);
|
|
||||||
if (!gSavedSettings.getBOOL("ScriptErrorsAsChat"))
|
if (!gSavedSettings.getBOOL("ScriptErrorsAsChat"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -340,8 +341,14 @@ void LLFloaterChat::onClickToggleShowMute(bool show_mute, LLTextEditor* history_
|
|||||||
(show_mute ? history_editor_with_mute : history_editor)->setCursorAndScrollToEnd();
|
(show_mute ? history_editor_with_mute : history_editor)->setCursorAndScrollToEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterChat::addChat(const std::string& str, BOOL from_im, BOOL local_agent)
|
||||||
|
{
|
||||||
|
LLChat chat(str);
|
||||||
|
addChat(chat, from_im, local_agent);
|
||||||
|
}
|
||||||
|
|
||||||
// Put a line of chat in all the right places
|
// Put a line of chat in all the right places
|
||||||
void LLFloaterChat::addChat(const LLChat& chat,
|
void LLFloaterChat::addChat(LLChat& chat,
|
||||||
BOOL from_instant_message,
|
BOOL from_instant_message,
|
||||||
BOOL local_agent)
|
BOOL local_agent)
|
||||||
{
|
{
|
||||||
@@ -357,20 +364,18 @@ void LLFloaterChat::addChat(const LLChat& chat,
|
|||||||
// TODO-RLVa: we might cast too broad a net by filtering here, needs testing
|
// TODO-RLVa: we might cast too broad a net by filtering here, needs testing
|
||||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
||||||
{
|
{
|
||||||
LLChat& rlvChat = const_cast<LLChat&>(chat);
|
|
||||||
if (!from_instant_message)
|
if (!from_instant_message)
|
||||||
RlvUtil::filterLocation(rlvChat.mText);
|
RlvUtil::filterLocation(chat.mText);
|
||||||
rlvChat.mRlvLocFiltered = TRUE;
|
chat.mRlvLocFiltered = TRUE;
|
||||||
}
|
}
|
||||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) )
|
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!chat.mRlvNamesFiltered) )
|
||||||
{
|
{
|
||||||
LLChat& rlvChat = const_cast<LLChat&>(chat);
|
|
||||||
if ( (!from_instant_message) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
if ( (!from_instant_message) && (CHAT_SOURCE_AGENT != chat.mSourceType) )
|
||||||
{
|
{
|
||||||
// Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup)
|
// Filter object and system chat (names are filtered elsewhere to save ourselves an gObjectList lookup)
|
||||||
RlvUtil::filterNames(rlvChat.mText);
|
RlvUtil::filterNames(chat.mText);
|
||||||
}
|
}
|
||||||
rlvChat.mRlvNamesFiltered = TRUE;
|
chat.mRlvNamesFiltered = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|||||||
@@ -60,13 +60,15 @@ public:
|
|||||||
void updateConsoleVisibility();
|
void updateConsoleVisibility();
|
||||||
|
|
||||||
static void setHistoryCursorAndScrollToEnd();
|
static void setHistoryCursorAndScrollToEnd();
|
||||||
|
|
||||||
// Add chat to console and history list.
|
// Add chat to console and history list.
|
||||||
// Color based on source, type, distance.
|
// Color based on source, type, distance.
|
||||||
static void addChat(const LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE);
|
static void addChat(const std::string& str, BOOL from_im = FALSE, BOOL local_agent = FALSE);
|
||||||
|
static void addChat(LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE);
|
||||||
|
|
||||||
// Add chat to history alone.
|
// Add chat to history alone.
|
||||||
static void addChatHistory(const LLChat& chat, bool log_to_file = true);
|
static void addChatHistory(const std::string& str, bool log_to_file = true);
|
||||||
|
static void addChatHistory(LLChat& chat, bool log_to_file = true);
|
||||||
|
|
||||||
static void triggerAlerts(const std::string& text);
|
static void triggerAlerts(const std::string& text);
|
||||||
|
|
||||||
|
|||||||
@@ -3731,7 +3731,7 @@ private:
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void add_floater_chat(const LLChat &chat, const BOOL history)
|
void add_floater_chat(LLChat &chat, const BOOL history)
|
||||||
{
|
{
|
||||||
if (history)
|
if (history)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user