MUC: add ID to message if no ID is present

vault/master
Jonas Wielicki 8 years ago
parent 9e01c3ff64
commit f61b36e2d3
  1. 4
      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

Loading…
Cancel
Save