Comparison

plugins/muc/affiliation_notify.lib.lua @ 8943:3a416b866c94

MUC: Remove text body from affiliation change notification
author Matthew Wild <mwild1@gmail.com>
date Wed, 27 Jun 2018 15:28:45 +0100
parent 8942:ecb5e13d97bb
comparison
equal deleted inserted replaced
8942:ecb5e13d97bb 8943:3a416b866c94
17 local st = require "util.stanza"; 17 local st = require "util.stanza";
18 18
19 module:hook("muc-set-affiliation", function(event) 19 module:hook("muc-set-affiliation", function(event)
20 local room = event.room; 20 local room = event.room;
21 if not event.in_room then 21 if not event.in_room then
22 local body = string.format("Your affiliation in room %s is now %s.", room.jid, event.affiliation);
23 local stanza = st.message({ 22 local stanza = st.message({
24 type = "headline"; 23 type = "headline";
25 from = room.jid; 24 from = room.jid;
26 to = event.jid; 25 to = event.jid;
27 }, body) 26 })
28 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) 27 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"})
29 :tag("status", {code="101"}):up() 28 :tag("status", {code="101"}):up()
30 :up(); 29 :up();
31 room:route_stanza(stanza); 30 room:route_stanza(stanza);
32 end 31 end