From 238e67da8dc78f77995fbc14814125f07153a7ed Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Wed, 4 May 2011 11:14:22 +0200 Subject: [PATCH] Add method get_full_jids --- jabberbot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jabberbot.py b/jabberbot.py index 870ab02..f239e59 100644 --- a/jabberbot.py +++ b/jabberbot.py @@ -283,6 +283,15 @@ class JabberBot(object): username = "" return username + def get_full_jids(self, jid): + """Returns all full jids, which belong to a bare jid + + Example: A bare jid is bob@jabber.org, with two clients connected, which + have the full jids bob@jabber.org/home and bob@jabber.org/work.""" + for res in self.roster.getResources(jid): + full_jid = "%s/%s" % (jid,res) + yield full_jid + def status_type_changed(self, jid, new_status_type): """Callback for tracking status types (available, away, offline, ...)""" self.log.debug('user %s changed status to %s' % (jid, new_status_type)) -- 2.11.4.GIT