Small jb_disconnect() improvement
authorMikael Berthe <mikael@lilotux.net>
Sat, 14 Jan 2006 11:02:13 +0100
changeset 668 d0928694c81b
parent 667 86bc3295a4db
child 669 2b87065270f3
Small jb_disconnect() improvement
mcabber/src/jabglue.c
--- a/mcabber/src/jabglue.c	Fri Jan 13 22:05:38 2006 +0100
+++ b/mcabber/src/jabglue.c	Sat Jan 14 11:02:13 2006 +0100
@@ -132,17 +132,17 @@
 {
   if (!jc) return;
 
-  // Announce it to  everyone else
-  jb_setstatus(offline, NULL, "");
-
-  // End the XML flow
-  jb_send_raw("</stream:stream>");
+  if (online) {
+    // Announce it to  everyone else
+    jb_setstatus(offline, NULL, "");
+    // End the XML flow
+    jb_send_raw("</stream:stream>");
+  }
 
   // Announce it to the user
   statehandler(jc, JCONN_STATE_OFF);
 
   jab_delete(jc);
-  //free(jc); XXX
   jc = NULL;
 }