diff options
author | mathieui <mathieui@mathieui.net> | 2012-05-16 02:01:50 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-05-16 02:01:50 +0200 |
commit | c04f0e97837dfc0c73defa3aaeada5c3848e2c59 (patch) | |
tree | 3b8cc6e6ef5ea416d71e60f77c2518f849692a09 /src/roster.py | |
parent | 58a41fe0652021481ebfa96fb3d238cddd93ca95 (diff) | |
download | poezio-c04f0e97837dfc0c73defa3aaeada5c3848e2c59.tar.gz poezio-c04f0e97837dfc0c73defa3aaeada5c3848e2c59.tar.bz2 poezio-c04f0e97837dfc0c73defa3aaeada5c3848e2c59.tar.xz poezio-c04f0e97837dfc0c73defa3aaeada5c3848e2c59.zip |
Prevent the rooms from going “offline”
Add a blacklist inside the roster that contains the bare JIDs of all the
rooms ever joined in this session, so that no JID using this server will
ever be shown as getting “offline”.
If there is a cleaner way to do that (discriminating JIDs), I welcome it.
Diffstat (limited to 'src/roster.py')
-rw-r--r-- | src/roster.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/roster.py b/src/roster.py index 7f93c4b2..e1251024 100644 --- a/src/roster.py +++ b/src/roster.py @@ -19,6 +19,10 @@ from sleekxmpp.xmlstream.stanzabase import JID from sleekxmpp.exceptions import IqError class Roster(object): + + # MUC domains to blacklist from the contacts roster + blacklist = set() + def __init__(self): """ node: the RosterSingle from SleekXMPP @@ -103,7 +107,7 @@ class Roster(object): def jids(self): """List of the contact JIDS""" - return [key for key in self.__node.keys() if key not in self.__mucs and key != self.jid] + return [key for key in self.__node.keys() if JID(key).server not in self.blacklist and key != self.jid] def get_contacts(self): """ |