Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
1b3bd4da
Commit
1b3bd4da
authored
13 years ago
by
Vadim ProductEngine
Browse files
Options
Downloads
Patches
Plain Diff
EXP-1565 FIXED Fixed IRC-style emotes in chat.
parent
9a5a96aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llnearbychathandler.cpp
+18
-20
18 additions, 20 deletions
indra/newview/llnearbychathandler.cpp
with
18 additions
and
20 deletions
indra/newview/llnearbychathandler.cpp
+
18
−
20
View file @
1b3bd4da
...
...
@@ -470,7 +470,7 @@ void LLNearbyChatHandler::initChannel()
void
LLNearbyChatHandler
::
processChat
(
const
LLChat
&
chat_msg
,
// WARNING - not really const, see hack below changing chat_msg.mText
void
LLNearbyChatHandler
::
processChat
(
const
LLChat
&
chat_msg
,
const
LLSD
&
args
)
{
if
(
chat_msg
.
mMuted
==
TRUE
)
...
...
@@ -479,28 +479,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not
if
(
chat_msg
.
mText
.
empty
())
return
;
//don't process empty messages
// Handle irc styled messages for toast panel
// HACK ALERT - changes mText, stripping out IRC style "/me" prefixes
LLChat
&
tmp_chat
=
const_cast
<
LLChat
&>
(
chat_msg
);
std
::
string
original_message
=
tmp_chat
.
mText
;
// Save un-modified version of chat text
if
(
tmp_chat
.
mChatStyle
==
CHAT_STYLE_IRC
)
{
if
(
!
tmp_chat
.
mFromName
.
empty
())
tmp_chat
.
mText
=
tmp_chat
.
mFromName
+
tmp_chat
.
mText
.
substr
(
3
);
else
tmp_chat
.
mText
=
tmp_chat
.
mText
.
substr
(
3
);
}
LLFloater
*
chat_bar
=
LLFloaterReg
::
getInstance
(
"chat_bar"
);
LLNearbyChat
*
nearby_chat
=
chat_bar
->
findChild
<
LLNearbyChat
>
(
"nearby_chat"
);
{
//sometimes its usefull to have no name at all...
//if(tmp_chat.mFromName.empty() && tmp_chat.mFromID!= LLUUID::null)
// tmp_chat.mFromName = tmp_chat.mFromID.asString();
}
// Build notification data
LLSD
notification
;
notification
[
"message"
]
=
chat_msg
.
mText
;
...
...
@@ -543,7 +525,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not
LLViewerChat
::
getChatColor
(
chat_msg
,
txt_color
);
LLFloaterScriptDebug
::
addScriptLine
(
original_message
,
// Send full message with "/me" style prefix
LLFloaterScriptDebug
::
addScriptLine
(
chat_msg
.
mText
,
chat_msg
.
mFromName
,
txt_color
,
chat_msg
.
mFromID
);
...
...
@@ -597,6 +579,21 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not
if
(
channel
)
{
// Handle IRC styled messages.
std
::
string
toast_msg
;
if
(
chat_msg
.
mChatStyle
==
CHAT_STYLE_IRC
)
{
if
(
!
chat_msg
.
mFromName
.
empty
())
{
toast_msg
+=
chat_msg
.
mFromName
;
}
toast_msg
+=
chat_msg
.
mText
.
substr
(
3
);
}
else
{
toast_msg
=
chat_msg
.
mText
;
}
// Add a nearby chat toast.
LLUUID
id
;
id
.
generate
();
...
...
@@ -608,6 +605,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not
notification
[
"text_color"
]
=
r_color_name
;
notification
[
"color_alpha"
]
=
r_color_alpha
;
notification
[
"font_size"
]
=
(
S32
)
LLViewerChat
::
getChatFontSize
()
;
notification
[
"message"
]
=
toast_msg
;
channel
->
addNotification
(
notification
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment