added has_jid to roster

This commit is contained in:
Nathan Fritz 2011-04-15 17:43:12 -07:00
parent e919906c8c
commit 8a22597180

View file

@ -179,6 +179,10 @@ class RosterNode(object):
"""Return a list of all subscribed JIDs.""" """Return a list of all subscribed JIDs."""
return self._jids.keys() return self._jids.keys()
def has_jid(self, jid):
"""Returns whether the roster has a JID."""
return jid in self._jids
def __iter__(self): def __iter__(self):
"""Iterate over the roster items.""" """Iterate over the roster items."""
return self._jids.__iter__() return self._jids.__iter__()