Fix #222: SIPE crashes when groupchat session expires (III)
authorStefan Becker <chemobejk@gmail.com>
Mon, 25 Nov 2013 13:32:38 +0000 (25 15:32 +0200)
committerStefan Becker <chemobejk@gmail.com>
Mon, 25 Nov 2013 14:00:20 +0000 (25 16:00 +0200)
If we get a 481 response to a groupchat command then we re-initialize
groupchat session again.

(cherry picked from commit f53ffbcab95be9007085c9a2056c3e4360af90f4)

src/core/sipe-groupchat.c

index f26ad47..e173214 100644 (file)
@@ -495,6 +495,14 @@ static gboolean chatserver_command_response(struct sipe_core_private *sipe_priva
                        chatserver_command_error_notify(sipe_private,
                                                        chat_session,
                                                        gmsg->content);
+
+               /* 481 Call Leg Does Not Exist -> server dropped session */
+               if (msg->response == 481) {
+                       struct sipe_groupchat *groupchat = sipe_private->groupchat;
+                       groupchat->session = NULL;
+                       groupchat->connected = FALSE;
+                       sipe_groupchat_init(sipe_private);
+               }
        }
        return TRUE;
 }