120 function room_mt:leave(message) |
120 function room_mt:leave(message) |
121 self.bot:event("groupchat/leaving", room); |
121 self.bot:event("groupchat/leaving", room); |
122 self:send(st.presence({type="unavailable"})); |
122 self:send(st.presence({type="unavailable"})); |
123 end |
123 end |
124 |
124 |
|
125 function room_mt:set_role(nick, role, reason) |
|
126 self:send(st.iq({type="set"}) |
|
127 :query(xmlns_muc .. "#admin") |
|
128 :tag("item", {nick = nick, role = role}) |
|
129 :tag("reason"):text(reason or "")); |
|
130 end |
|
131 |
|
132 function room_mt:set_affiliation(nick, affiliation, reason) |
|
133 self:send(st.iq({type="set"}) |
|
134 :query(xmlns_muc .. "#admin") |
|
135 :tag("item", {nick = nick, affiliation = affiliation}) |
|
136 :tag("reason"):text(reason or "")); |
|
137 end |
|
138 |
125 function room_mt:event(name, arg) |
139 function room_mt:event(name, arg) |
126 self.bot.stream:debug("Firing room event: %s", name); |
140 self.bot.stream:debug("Firing room event: %s", name); |
127 return self.events.fire_event(name, arg); |
141 return self.events.fire_event(name, arg); |
128 end |
142 end |
129 |
143 |