plugins/muc/muc.lib.lua

changeset 1736
98f833669d7f
parent 1735
81406277279e
child 1737
31c3eb5797c7
equal deleted inserted replaced
1735:81406277279e 1736:98f833669d7f
92 92
93 -- 93 --
94 94
95 local room_mt = {}; 95 local room_mt = {};
96 96
97 local function room_mt:broadcast_presence(stanza, code, nick) 97 function room_mt:broadcast_presence(stanza, code, nick)
98 stanza = get_filtered_presence(stanza); 98 stanza = get_filtered_presence(stanza);
99 local data = self._participants[stanza.attr.from]; 99 local data = self._participants[stanza.attr.from];
100 stanza:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) 100 stanza:tag("x", {xmlns='http://jabber.org/protocol/muc#user'})
101 :tag("item", {affiliation=data.affiliation, role=data.role, nick=nick}):up(); 101 :tag("item", {affiliation=data.affiliation, role=data.role, nick=nick}):up();
102 if code then 102 if code then
119 stanza.attr.to = jid; 119 stanza.attr.to = jid;
120 self:route_stanza(stanza); 120 self:route_stanza(stanza);
121 end 121 end
122 end 122 end
123 end 123 end
124 local function room_mt:broadcast_message(stanza, historic) 124 function room_mt:broadcast_message(stanza, historic)
125 for occupant, o_data in pairs(self._participants) do 125 for occupant, o_data in pairs(self._participants) do
126 for jid in pairs(o_data.sessions) do 126 for jid in pairs(o_data.sessions) do
127 stanza.attr.to = jid; 127 stanza.attr.to = jid;
128 self:route_stanza(stanza); 128 self:route_stanza(stanza);
129 end 129 end

mercurial