diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-08-13 14:50:04 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-08-13 14:50:04 +0300 |
commit | 9f2e322c7eea6830d372943d74f986d299cd314a (patch) | |
tree | b9a9f7057fa1d1438db2b88761fcfd6a248516a5 /indra/newview | |
parent | e363ae54b08842c628970e6d32eb5e6fea635469 (diff) |
clean up and add comment
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/groupchatlistener.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lltoastimpanel.cpp | 1 | ||||
-rw-r--r-- | indra/newview/scripts/lua/require/LLChat.lua | 10 | ||||
-rw-r--r-- | indra/newview/scripts/lua/test_group_chat.lua | 1 |
4 files changed, 5 insertions, 9 deletions
diff --git a/indra/newview/groupchatlistener.cpp b/indra/newview/groupchatlistener.cpp index 298f41ff8c..e48cbe824a 100644 --- a/indra/newview/groupchatlistener.cpp +++ b/indra/newview/groupchatlistener.cpp @@ -38,7 +38,7 @@ #include "llgroupactions.h" #include "llimview.h" -static const F32 GROUP_CHAT_THROTTLE_PERIOD = 1.f; +static const F64 GROUP_CHAT_THROTTLE_PERIOD = 1.f; LLGroupChatListener::LLGroupChatListener(): LLEventAPI("GroupChat", diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 7fadd8773b..b7353d6960 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -87,6 +87,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif { LLAvatarName avatar_name; LLAvatarNameCache::get(p.avatar_id, &avatar_name); + // move Lua prefix from the message field to the [From] field auto [message, is_lua] = LLStringUtil::withoutPrefix(p.message, LUA_PREFIX); std::string prefix = is_lua ? "LUA - " : ""; p.message = "[From " + prefix + avatar_name.getDisplayName() + "]\n" + message; diff --git a/indra/newview/scripts/lua/require/LLChat.lua b/indra/newview/scripts/lua/require/LLChat.lua index ea6329d574..bc0fc86d22 100644 --- a/indra/newview/scripts/lua/require/LLChat.lua +++ b/indra/newview/scripts/lua/require/LLChat.lua @@ -6,8 +6,9 @@ local LLChat = {} -- Nearby chat -- *************************************************************************** -function LLChat.sendNearby(msg) - leap.send('LLChatBar', {op='sendChat', message=msg}) +-- 0 is public nearby channel, other channels are used to communicate with LSL scripts +function LLChat.sendNearby(msg, channel) + leap.send('LLChatBar', {op='sendChat', message=msg, channel=channel}) end function LLChat.sendWhisper(msg) @@ -18,11 +19,6 @@ function LLChat.sendShout(msg) leap.send('LLChatBar', {op='sendChat', type='shout', message=msg}) end --- 0 is public nearby channel, other channels are used to communicate with LSL scripts -function LLChat.sendChannel(msg, channel) - leap.send('LLChatBar', {op='sendChat', channel=channel, message=msg}) -end - -- *************************************************************************** -- Group chat -- *************************************************************************** diff --git a/indra/newview/scripts/lua/test_group_chat.lua b/indra/newview/scripts/lua/test_group_chat.lua index 6299ba535f..eaff07ed14 100644 --- a/indra/newview/scripts/lua/test_group_chat.lua +++ b/indra/newview/scripts/lua/test_group_chat.lua @@ -1,5 +1,4 @@ LLChat = require 'LLChat' -inspect = require 'inspect' LLAgent = require 'LLAgent' popup = require 'popup' |