Transport was not initialized if user have no status message

This commit is contained in:
Vitaly Takmazov 2013-08-06 23:21:37 +04:00
parent 7c7a8737a0
commit 8e2c03aaae
2 changed files with 2 additions and 4 deletions

View file

@ -190,7 +190,7 @@ class Session:
self.call("presence_sendUnavailable")
def changeStatusMessage(self, statusMessage):
if statusMessage != self.statusMessage:
if (statusMessage != self.statusMessage) or (self.initialized == False):
self.statusMessage = statusMessage
self.call("profile_setStatus", (statusMessage.encode("utf-8"),))
self.logger.info("Status message changed: %s", statusMessage)

View file

@ -63,9 +63,7 @@ class WhatsAppBackend(SpectrumBackend):
def handleStatusChangeRequest(self, user, status, statusMessage):
self.logger.debug("handleStatusChangeRequest(user=%s, status=%d, statusMessage=%s)", user, status, statusMessage)
if len(statusMessage):
self.sessions[user].changeStatusMessage(statusMessage)
self.sessions[user].changeStatus(status)
def handleBuddyUpdatedRequest(self, user, buddy, nick, groups):