Handle case when buddy has no status message
This commit is contained in:
parent
bbf5a08697
commit
3781dcfc1c
6
buddy.py
6
buddy.py
|
@ -25,6 +25,7 @@ from Spectrum2 import protocol_pb2
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
import utils
|
||||||
|
|
||||||
|
|
||||||
class Buddy():
|
class Buddy():
|
||||||
|
@ -106,7 +107,10 @@ class BuddyList(dict):
|
||||||
self.logger.debug(u"%s received statuses of: %s", self.user, contacts)
|
self.logger.debug(u"%s received statuses of: %s", self.user, contacts)
|
||||||
for number, (status, time) in contacts.iteritems():
|
for number, (status, time) in contacts.iteritems():
|
||||||
buddy = self[number]
|
buddy = self[number]
|
||||||
buddy.statusMsg = status.decode(u'utf-8')
|
if status is None:
|
||||||
|
buddy.statusMessage = ""
|
||||||
|
else:
|
||||||
|
buddy.statusMsg = utils.softToUni(status)
|
||||||
self.updateSpectrum(buddy)
|
self.updateSpectrum(buddy)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue