Comparison

plugins/muc/muc.lib.lua @ 10753:925081396c59 0.11

MUC: Always include 'affiliation'/'role' attributes, defaulting to 'none' if nil
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Apr 2020 13:16:25 +0100
parent 10690:27d15097c235
child 10757:9dec7cddb40b
child 11142:552cafd30eb2
comparison
equal deleted inserted replaced
10721:3a1b1d3084fb 10753:925081396c59
141 stanza.attr.to = to; 141 stanza.attr.to = to;
142 end 142 end
143 143
144 -- actor is the attribute table 144 -- actor is the attribute table
145 local function add_item(x, affiliation, role, jid, nick, actor_nick, actor_jid, reason) 145 local function add_item(x, affiliation, role, jid, nick, actor_nick, actor_jid, reason)
146 x:tag("item", {affiliation = affiliation; role = role; jid = jid; nick = nick;}) 146 x:tag("item", {affiliation = affiliation or "none"; role = role; jid = jid; nick = nick;})
147 if actor_nick or actor_jid then 147 if actor_nick or actor_jid then
148 x:tag("actor", {nick = actor_nick; jid = actor_jid;}):up() 148 x:tag("actor", {nick = actor_nick; jid = actor_jid;}):up()
149 end 149 end
150 if reason then 150 if reason then
151 x:tag("reason"):text(reason):up() 151 x:tag("reason"):text(reason):up()