def changePasswordTo(disp,newpassword,host=None):
    """ Changes password on specified or current (if not specified) server.
        disp must be connected and authorized dispatcher instance.
        Returns true on success."""
    if not host: host=disp._owner.Server
    resp=disp.SendAndWaitForResponse(Iq('set',NS_REGISTER,to=host,payload=[Node('username',payload=[disp._owner.Server]),Node('password',payload=[newpassword])]))
    if isResultNode(resp): return 1
 Changes password on specified or current (if not specified) server.
        disp must be connected and authorized dispatcher instance.
        Returns true on success.
chrome-cordova/gcmServer/xmpp/features.py