aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorJonas Wielicki <jonas@wielicki.name>2019-01-06 11:28:54 +0100
committerJonas Wielicki <jonas@wielicki.name>2019-01-06 11:28:54 +0100
commitf61b36e2d32c4e5ea7ed7eb3d800bcc7ef5afee2 (patch)
tree2c4a274e34291efecbda1b8922cc51415cae3d0b /plugins/muc/muc.lib.lua
parent9e01c3ff642670c8b10a20686f7a6e100ad08fe9 (diff)
downloadprosody-f61b36e2d32c4e5ea7ed7eb3d800bcc7ef5afee2.tar.gz
prosody-f61b36e2d32c4e5ea7ed7eb3d800bcc7ef5afee2.zip
MUC: add ID to message if no ID is present
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index bb79cda6..a34e912b 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -23,6 +23,7 @@ local resourceprep = require "util.encodings".stringprep.resourceprep;
local st = require "util.stanza";
local base64 = require "util.encodings".base64;
local md5 = require "util.hashes".md5;
+local id = require "util.id";
local log = module._log;
@@ -1037,6 +1038,9 @@ end
function room_mt:handle_groupchat_to_room(origin, stanza)
local from = stanza.attr.from;
local occupant = self:get_occupant_by_real_jid(from);
+ if not stanza.attr.id then
+ stanza.attr.id = id.medium()
+ end
if module:fire_event("muc-occupant-groupchat", {
room = self; origin = origin; stanza = stanza; from = from; occupant = occupant;
}) then return true; end