Comparison

plugins/groupchat.lua @ 251:e44ddcd84234

fixed sending of leave message
author mva <mva@mva.name>
date Fri, 02 Dec 2011 11:27:38 +0600
parent 250:a5ac643a7fd6
child 252:7b36e4038377
comparison
equal deleted inserted replaced
250:a5ac643a7fd6 251:e44ddcd84234
143 function room_mt:set_subject(text) 143 function room_mt:set_subject(text)
144 self:send(verse.message():tag("subject"):text(text)); 144 self:send(verse.message():tag("subject"):text(text));
145 end 145 end
146 146
147 function room_mt:leave(message) 147 function room_mt:leave(message)
148 local presence = nil;
148 self.stream:event("groupchat/leaving", self); 149 self.stream:event("groupchat/leaving", self);
149 self:send(verse.presence({type="unavailable"})); 150 if message then
151 presence = verse.presence({type="unavailable"}):tag("status"):text(message);
152 else
153 presence = verse.presence({type="unavailable"});
154 end
155 self:send(presence);
150 end 156 end
151 157
152 function room_mt:admin_set(nick, what, value, reason) 158 function room_mt:admin_set(nick, what, value, reason)
153 self:send(verse.iq({type="set"}) 159 self:send(verse.iq({type="set"})
154 :query(xmlns_muc .. "#admin") 160 :query(xmlns_muc .. "#admin")