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
24d8bf26
Commit
24d8bf26
authored
15 years ago
by
Eugene Mutavchi
Browse files
Options
Downloads
Patches
Plain Diff
Fixed normal bug EXT-4072([BSI] Emotes appear as (italic) text chat in plain text mode)
--HG-- branch : product-engine
parent
eb800ade
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llchathistory.cpp
+21
-29
21 additions, 29 deletions
indra/newview/llchathistory.cpp
indra/newview/llnearbychat.cpp
+1
-21
1 addition, 21 deletions
indra/newview/llnearbychat.cpp
indra/newview/llnearbychathandler.cpp
+13
-11
13 additions, 11 deletions
indra/newview/llnearbychathandler.cpp
with
35 additions
and
61 deletions
indra/newview/llchathistory.cpp
+
21
−
29
View file @
24d8bf26
...
...
@@ -499,24 +499,29 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
style_params
.
font
.
name
(
font_name
);
style_params
.
font
.
size
(
font_size
);
style_params
.
font
.
style
(
input_append_params
.
font
.
style
);
//whether to show colon after a name in header copy/past and in plain text mode
bool
show_colon
=
chat
.
mChatType
!=
CHAT_TYPE_SHOUT
&&
chat
.
mChatType
!=
CHAT_TYPE_WHISPER
;
std
::
string
prefix
=
chat
.
mText
.
substr
(
0
,
4
);
//IRC styled /me messages.
bool
irc_me
=
false
;
bool
irc_me
=
prefix
==
"/me "
||
prefix
==
"/me'"
;
std
::
string
prefix
=
chat
.
mText
.
substr
(
0
,
4
);
if
(
prefix
==
"/me "
||
prefix
==
"/me'"
)
// Delimiter after a name in header copy/past and in plain text mode
std
::
string
delimiter
=
(
chat
.
mChatType
!=
CHAT_TYPE_SHOUT
&&
chat
.
mChatType
!=
CHAT_TYPE_WHISPER
)
?
": "
:
" "
;
// Don't add any delimiter after name in irc styled messages
if
(
irc_me
||
chat
.
mChatStyle
==
CHAT_STYLE_IRC
)
{
irc_me
=
true
;
delimiter
=
LLStringUtil
::
null
;
style_params
.
font
.
style
=
"ITALIC"
;
}
if
(
use_plain_text_chat_history
)
{
mEditor
->
appendText
(
"["
+
chat
.
mTimeStr
+
"] "
,
mEditor
->
getText
().
size
()
!=
0
,
style_params
);
if
(
utf8str_trim
(
chat
.
mFromName
).
size
()
!=
0
&&
!
irc_me
)
if
(
utf8str_trim
(
chat
.
mFromName
).
size
()
!=
0
)
{
// Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text.
if
(
chat
.
mFromName
!=
SYSTEM_FROM
&&
chat
.
mFromID
.
notNull
()
)
...
...
@@ -524,11 +529,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
LLStyle
::
Params
link_params
(
style_params
);
link_params
.
fillFrom
(
LLStyleMap
::
instance
().
lookupAgent
(
chat
.
mFromID
));
// Convert the name to a hotlink and add to message.
mEditor
->
appendText
(
chat
.
mFromName
+
(
show_colon
?
": "
:
" "
)
,
false
,
link_params
);
mEditor
->
appendText
(
chat
.
mFromName
+
delimiter
,
false
,
link_params
);
}
else
{
mEditor
->
appendText
(
chat
.
mFromName
+
(
show_colon
?
": "
:
" "
)
,
false
,
style_params
);
mEditor
->
appendText
(
chat
.
mFromName
+
delimiter
,
false
,
style_params
);
}
}
}
...
...
@@ -574,35 +579,22 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
std
::
string
header_text
=
"["
+
chat
.
mTimeStr
+
"] "
;
if
(
utf8str_trim
(
chat
.
mFromName
).
size
()
!=
0
&&
chat
.
mFromName
!=
SYSTEM_FROM
)
header_text
+=
chat
.
mFromName
+
(
show_colon
?
": "
:
" "
)
;
header_text
+=
chat
.
mFromName
+
delimiter
;
mEditor
->
appendWidget
(
p
,
header_text
,
false
);
mLastFromName
=
chat
.
mFromName
;
mLastFromID
=
chat
.
mFromID
;
mLastMessageTime
=
new_message_time
;
}
if
(
irc_me
)
{
style_params
.
font
.
style
=
"ITALIC"
;
if
(
chat
.
mFromName
.
size
()
>
0
)
mEditor
->
appendText
(
chat
.
mFromName
,
FALSE
,
style_params
);
std
::
string
message
=
irc_me
?
chat
.
mText
.
substr
(
3
)
:
chat
.
mText
;
if
(
message
.
size
()
>
0
&&
!
LLStringOps
::
isSpace
(
message
[
message
.
size
()
-
1
])
)
{
// Ensure that message ends with NewLine, to avoid losing of new lines
// while copy/paste from text chat. See EXT-3263.
mEditor
->
appendText
(
chat
.
mText
.
substr
(
3
)
+
NEW_LINE
,
FALSE
,
style_params
);
}
else
{
std
::
string
message
(
chat
.
mText
);
if
(
message
.
size
()
>
0
&&
!
LLStringOps
::
isSpace
(
message
[
message
.
size
()
-
1
])
)
{
// Ensure that message ends with NewLine, to avoid losing of new lines
// while copy/paste from text chat. See EXT-3263.
message
+=
NEW_LINE
;
}
mEditor
->
appendText
(
message
,
FALSE
,
style_params
);
message
+=
NEW_LINE
;
}
mEditor
->
appendText
(
message
,
FALSE
,
style_params
);
mEditor
->
blockUndo
();
// automatically scroll to end when receiving chat from myself
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llnearbychat.cpp
+
1
−
21
View file @
24d8bf26
...
...
@@ -179,27 +179,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive)
if
(
!
chat
.
mMuted
)
{
tmp_chat
.
mFromName
=
chat
.
mFromName
;
if
(
chat
.
mChatStyle
==
CHAT_STYLE_IRC
)
{
LLColor4
txt_color
=
LLUIColorTable
::
instance
().
getColor
(
"White"
);
LLViewerChat
::
getChatColor
(
chat
,
txt_color
);
LLFontGL
*
fontp
=
LLViewerChat
::
getChatFont
();
std
::
string
font_name
=
LLFontGL
::
nameFromFont
(
fontp
);
std
::
string
font_size
=
LLFontGL
::
sizeFromFont
(
fontp
);
LLStyle
::
Params
append_style_params
;
append_style_params
.
color
(
txt_color
);
append_style_params
.
readonly_color
(
txt_color
);
append_style_params
.
font
.
name
(
font_name
);
append_style_params
.
font
.
size
(
font_size
);
append_style_params
.
font
.
style
=
"ITALIC"
;
mChatHistory
->
appendMessage
(
chat
,
use_plain_text_chat_history
,
append_style_params
);
}
else
{
mChatHistory
->
appendMessage
(
chat
,
use_plain_text_chat_history
);
}
mChatHistory
->
appendMessage
(
chat
,
use_plain_text_chat_history
);
}
if
(
archive
)
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llnearbychathandler.cpp
+
13
−
11
View file @
24d8bf26
...
...
@@ -180,6 +180,11 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
if
(
panel
&&
panel
->
messageID
()
==
fromID
&&
panel
->
canAddText
())
{
if
(
CHAT_STYLE_IRC
==
notification
[
"chat_style"
].
asInteger
())
{
notification
[
"message"
]
=
notification
[
"from"
].
asString
()
+
notification
[
"message"
].
asString
();
}
panel
->
addMessage
(
notification
);
toast
->
reshapeToPanel
();
toast
->
resetTimer
();
...
...
@@ -331,25 +336,22 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg)
LLChat
&
tmp_chat
=
const_cast
<
LLChat
&>
(
chat_msg
);
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
);
}
LLNearbyChat
*
nearby_chat
=
LLFloaterReg
::
getTypedInstance
<
LLNearbyChat
>
(
"nearby_chat"
,
LLSD
());
{
//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();
}
LLNearbyChat
*
nearby_chat
=
LLFloaterReg
::
getTypedInstance
<
LLNearbyChat
>
(
"nearby_chat"
,
LLSD
());
nearby_chat
->
addMessage
(
chat_msg
);
if
(
nearby_chat
->
getVisible
())
return
;
//no need in toast if chat is visible
// Handle irc styled messages for toast panel
if
(
tmp_chat
.
mChatStyle
==
CHAT_STYLE_IRC
)
{
tmp_chat
.
mText
=
tmp_chat
.
mText
.
substr
(
3
);
}
// arrange a channel on a screen
if
(
!
mChannel
->
getVisible
())
{
...
...
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