def changeScreenName(self, newName):
"""
Used to change your current screen name.
A default callback is added to the returned
Deferred which updates the screenName attribute
of the factory and also updates the contact list
version.
@param newName: the new screen name
@return: A Deferred, the callback for which will be called
when the server sends an adequate reply.
The callback argument will be a tuple of 2 elements:
the new list version and the new screen name.
"""
id, d = self._createIDMapping()
self.sendLine("REA %s %s %s" % (id, self.factory.userHandle, quote(newName)))
def _cb(r):
self.factory.contacts.version = r[0]
self.factory.screenName = r[1]
return r
return d.addCallback(_cb)
评论列表
文章目录