]> www.infradead.org Git - pidgin-chime.git/commitdiff
Abort connection when server kicks us off
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 18 Oct 2017 14:49:54 +0000 (15:49 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 18 Oct 2017 14:50:37 +0000 (15:50 +0100)
Oops, this snuck in with another commit. I'm willing to rewrite
history to fix that, even though I wouldn't do it to fix the stupid
"calender" typo that inexplicably slipped in last week.

chime-juggernaut.c

index efa0c753c647b4b0b851a801275b74a9bfbc76fb..0cecd6652861f01c213209a91438551c8bf3a4b1 100644 (file)
@@ -144,6 +144,14 @@ static void on_websocket_message(SoupWebsocketConnection *ws, gint type,
        chime_connection_log(cxn, CHIME_LOGLVL_MISC,
                             "websocket message received:\n'%s'\n", (char *)data);
 
+       /* DISCONNECT */
+       if (!strcmp(data, "0::")) {
+               /* Do not attempt to reconnect */
+               priv->jugg_online = FALSE;
+               chime_connection_fail(cxn, CHIME_ERROR_NETWORK,
+                                     _("Juggernaut server closed connection"));
+               return;
+       }
        /* CONNECT */
        if (!strcmp(data, "1::")) {
                if (!priv->jugg_online) {