# HG changeset patch # User Matthew Wild # Date 1409131808 -3600 # Node ID dfcc5a0f5c799191b117db188f27aceed1357b9b # Parent 34b878d58948833baf0d3beee1d00631f09fae75 plugins.groupchat: Use verse.eventable (room objects were missing :unhook() ) diff -r 34b878d58948 -r dfcc5a0f5c79 plugins/groupchat.lua --- a/plugins/groupchat.lua Sat Jul 06 08:40:18 2013 +0200 +++ b/plugins/groupchat.lua Wed Aug 27 10:30:08 2014 +0100 @@ -43,12 +43,11 @@ return false, "no nickname supplied" end opts = opts or {}; - local room = setmetatable({ + local room = setmetatable(verse.eventable{ stream = stream, jid = jid, nick = nick, subject = nil, occupants = {}, opts = opts, - events = events.new() }, room_mt); if opts.source then self.rooms[opts.source.." "..jid] = room; @@ -176,12 +175,3 @@ function room_mt:ban(nick, reason) self:set_affiliation(nick, "outcast", reason); end - -function room_mt:event(name, arg) - self.stream:debug("Firing room event: %s", name); - return self.events.fire_event(name, arg); -end - -function room_mt:hook(name, callback, priority) - return self.events.add_handler(name, callback, priority); -end