Merge pull request #6 from vitalyster/empty_status
Transport was not initialized if user have no status message
This commit is contained in:
commit
737d2c55b4
|
@ -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)
|
||||
|
|
|
@ -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].changeStatusMessage(statusMessage)
|
||||
self.sessions[user].changeStatus(status)
|
||||
|
||||
def handleBuddyUpdatedRequest(self, user, buddy, nick, groups):
|
||||
|
|
Loading…
Reference in a new issue