Transport was not initialized if user have no status message
This commit is contained in:
parent
7c7a8737a0
commit
8e2c03aaae
|
@ -190,7 +190,7 @@ class Session:
|
||||||
self.call("presence_sendUnavailable")
|
self.call("presence_sendUnavailable")
|
||||||
|
|
||||||
def changeStatusMessage(self, statusMessage):
|
def changeStatusMessage(self, statusMessage):
|
||||||
if statusMessage != self.statusMessage:
|
if (statusMessage != self.statusMessage) or (self.initialized == False):
|
||||||
self.statusMessage = statusMessage
|
self.statusMessage = statusMessage
|
||||||
self.call("profile_setStatus", (statusMessage.encode("utf-8"),))
|
self.call("profile_setStatus", (statusMessage.encode("utf-8"),))
|
||||||
self.logger.info("Status message changed: %s", statusMessage)
|
self.logger.info("Status message changed: %s", statusMessage)
|
||||||
|
|
|
@ -63,9 +63,7 @@ class WhatsAppBackend(SpectrumBackend):
|
||||||
|
|
||||||
def handleStatusChangeRequest(self, user, status, statusMessage):
|
def handleStatusChangeRequest(self, user, status, statusMessage):
|
||||||
self.logger.debug("handleStatusChangeRequest(user=%s, status=%d, statusMessage=%s)", 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)
|
self.sessions[user].changeStatus(status)
|
||||||
|
|
||||||
def handleBuddyUpdatedRequest(self, user, buddy, nick, groups):
|
def handleBuddyUpdatedRequest(self, user, buddy, nick, groups):
|
||||||
|
|
Loading…
Reference in a new issue