summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-05 11:08:57 -0800
committerLance Stout <lancestout@gmail.com>2012-03-05 11:08:57 -0800
commit830db11b4164410d792255eb9cf2f96779e86520 (patch)
treef9b3bac125506c7c97f47d22ed843c7f1fbf8ab7 /sleekxmpp/basexmpp.py
parent53bcd33e1d9d829b01aeaa8463fb7cabf01b91ee (diff)
downloadslixmpp-830db11b4164410d792255eb9cf2f96779e86520.tar.gz
slixmpp-830db11b4164410d792255eb9cf2f96779e86520.tar.bz2
slixmpp-830db11b4164410d792255eb9cf2f96779e86520.tar.xz
slixmpp-830db11b4164410d792255eb9cf2f96779e86520.zip
Ensure that roster nodes aren't empty strings.
This would happen when receiving presence without a 'to' field, which happens when receiving presence from other resources for the same account.
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index f729132d..14b99823 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -674,11 +674,15 @@ class BaseXMPP(XMLStream):
def _handle_available(self, presence):
pto = presence['to'].bare
+ if not pto:
+ pto = self.boundjid.bare
pfrom = presence['from'].bare
self.roster[pto][pfrom].handle_available(presence)
def _handle_unavailable(self, presence):
pto = presence['to'].bare
+ if not pto:
+ pto = self.boundjid.bare
pfrom = presence['from'].bare
self.roster[pto][pfrom].handle_unavailable(presence)