summary refs log tree commit diff
path: root/cmdclient/console.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-28 16:52:46 +0100
committerErik Johnston <erik@matrix.org>2014-08-28 16:52:46 +0100
commit54d0a755734f71e38c5cdc0e922422cc4d31ad74 (patch)
tree4d0256be69f304553d0efaa71ec50498f3821683 /cmdclient/console.py
parentUp timeout to 10 minutes (diff)
parentOnly send presence "poll"/"unpoll" EDUs when changing from/to zero remotes (diff)
downloadsynapse-54d0a755734f71e38c5cdc0e922422cc4d31ad74.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into presence_logging
Conflicts:
	synapse/handlers/presence.py
Diffstat (limited to 'cmdclient/console.py')
-rwxr-xr-xcmdclient/console.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmdclient/console.py b/cmdclient/console.py
index a4d8145d72..7bda4000fc 100755
--- a/cmdclient/console.py
+++ b/cmdclient/console.py
@@ -225,8 +225,13 @@ class SynapseCmd(cmd.Cmd):
         json_res = yield self.http_client.do_request("GET", url)
         print json_res
 
-        if ("type" not in json_res or "m.login.password" != json_res["type"] or
-                "stages" in json_res):
+        if "flows" not in json_res:
+            print "Failed to find any login flows."
+            defer.returnValue(False)
+
+        flow = json_res["flows"][0] # assume first is the one we want.
+        if ("type" not in flow or "m.login.password" != flow["type"] or
+                "stages" in flow):
             fallback_url = self._url() + "/login/fallback"
             print ("Unable to login via the command line client. Please visit "
                 "%s to login." % fallback_url)