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.
This commit is contained in:
parent
53bcd33e1d
commit
830db11b41
@ -674,11 +674,15 @@ class BaseXMPP(XMLStream):
|
|||||||
|
|
||||||
def _handle_available(self, presence):
|
def _handle_available(self, presence):
|
||||||
pto = presence['to'].bare
|
pto = presence['to'].bare
|
||||||
|
if not pto:
|
||||||
|
pto = self.boundjid.bare
|
||||||
pfrom = presence['from'].bare
|
pfrom = presence['from'].bare
|
||||||
self.roster[pto][pfrom].handle_available(presence)
|
self.roster[pto][pfrom].handle_available(presence)
|
||||||
|
|
||||||
def _handle_unavailable(self, presence):
|
def _handle_unavailable(self, presence):
|
||||||
pto = presence['to'].bare
|
pto = presence['to'].bare
|
||||||
|
if not pto:
|
||||||
|
pto = self.boundjid.bare
|
||||||
pfrom = presence['from'].bare
|
pfrom = presence['from'].bare
|
||||||
self.roster[pto][pfrom].handle_unavailable(presence)
|
self.roster[pto][pfrom].handle_unavailable(presence)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user