diff options
author | mathieui <mathieui@mathieui.net> | 2012-02-16 02:24:54 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-02-16 02:24:54 +0100 |
commit | 762bd953cb1c3e8e53857cc22116aa86dd7c259a (patch) | |
tree | 513d9ce7915c26582d681d4c228f481d3aada088 /src | |
parent | 55788f6127c25a549aa93efd5ed147695f875890 (diff) | |
download | poezio-762bd953cb1c3e8e53857cc22116aa86dd7c259a.tar.gz poezio-762bd953cb1c3e8e53857cc22116aa86dd7c259a.tar.bz2 poezio-762bd953cb1c3e8e53857cc22116aa86dd7c259a.tar.xz poezio-762bd953cb1c3e8e53857cc22116aa86dd7c259a.zip |
Add some new events for the plugins
Diffstat (limited to 'src')
-rw-r--r-- | src/events.py | 4 | ||||
-rw-r--r-- | src/tabs.py | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/events.py b/src/events.py index e94acb80..8def6cb0 100644 --- a/src/events.py +++ b/src/events.py @@ -35,6 +35,10 @@ class EventHandler(object): 'private_chatstate': [], 'normal_presence': [], 'muc_presence': [], + 'muc_join': [], + 'muc_kick': [], + 'muc_nickchange': [], + 'muc_ban': [], 'send_normal_presence': [], } diff --git a/src/tabs.py b/src/tabs.py index 55e3154c..17d1e739 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1123,6 +1123,7 @@ class MucTab(ChatTab): if from_nick not in [user.nick for user in self.users] and typ != "unavailable": new_user = User(from_nick, affiliation, show, status, role, jid) self.users.append(new_user) + self.core.events.trigger('muc_join', presence, self) if from_nick == self.own_nick: self.joined = True if self.get_name() in self.core.initial_joins: @@ -1143,14 +1144,18 @@ class MucTab(ChatTab): user = self.get_user_by_name(from_nick) # New user if not user: + self.core.events.trigger('muc_join', presence, self) self.on_user_join(from_nick, affiliation, show, status, role, jid) # nick change elif change_nick: + self.core.events.trigger('muc_nickchange', presence, self) self.on_user_nick_change(presence, user, from_nick, from_room) elif ban: + self.core.events.trigger('muc_ban', presence, self) self.on_user_banned(presence, user, from_nick) # kick elif kick: + self.core.events.trigger('muc_kick', presence, self) self.on_user_kicked(presence, user, from_nick) # user quit elif typ == 'unavailable': |