summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_group_chat.lua
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-17 16:56:21 +0300
committerGitHub <noreply@github.com>2024-10-17 16:56:21 +0300
commit0ef7a9b39cf72da1211039ab22bdf8f9f6a2c984 (patch)
tree6f51ef179497265b5bff2a355471ae5dc9643ad2 /indra/newview/scripts/lua/test_group_chat.lua
parent9e24b300d02e5627ea0d304d412cb683ec2de3a4 (diff)
parentd3d349ae0f17a72481f30b9354b9367b1cd3b639 (diff)
Merge pull request #2856 from secondlife/marchcat/c-develop
Develop → Maint C sync
Diffstat (limited to 'indra/newview/scripts/lua/test_group_chat.lua')
-rw-r--r--indra/newview/scripts/lua/test_group_chat.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_group_chat.lua b/indra/newview/scripts/lua/test_group_chat.lua
new file mode 100644
index 0000000000..373411c26c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_group_chat.lua
@@ -0,0 +1,14 @@
+LLChat = require 'LLChat'
+LLAgent = require 'LLAgent'
+UI = require 'UI'
+
+local GROUPS = LLAgent.getGroups()
+
+-- Choose one of the groups randomly and send group message
+math.randomseed(os.time())
+group_info = GROUPS[math.random(#GROUPS)]
+LLChat.startGroupChat(group_info.id)
+response = UI.popup:alertYesCancel('Started group chat with ' .. group_info.name .. ' group. Send greetings?')
+if response == 'OK' then
+ LLChat.sendGroupIM('Greetings', group_info.id)
+end