changeset 845:51829325fe21

MUC: Fix a strange bug when a user isn't in a room anymore (network issue) When the Jabber server cannot reach a server anymore, it considers the users of this server have left, but doesn't send type=unavailable. Mcabber didn't understand and still believed the users were in the room. This patch should fix that.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 07 May 2006 15:40:09 +0200
parents 5002948c7360
children 683516b450be
files mcabber/src/jabglue.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/jabglue.c	Sat May 06 18:41:24 2006 +0200
+++ b/mcabber/src/jabglue.c	Sun May 07 15:40:09 2006 +0200
@@ -1109,10 +1109,17 @@
           mbuf = g_strdup_printf("You have left %s", roomjid);
         }
       } else {
-        if (ustmsg)
-          mbuf = g_strdup_printf("%s has left: %s", rname, ustmsg);
-        else
-          mbuf = g_strdup_printf("%s has left", rname);
+        if (ust != offline) {
+          // This can happen when a network failure occurs,
+          // this isn't an official leave but the user isn't there anymore.
+          mbuf = g_strdup_printf("%s has disappeared!", rname);
+          ust = offline;
+        } else {
+          if (ustmsg)
+            mbuf = g_strdup_printf("%s has left: %s", rname, ustmsg);
+          else
+            mbuf = g_strdup_printf("%s has left", rname);
+        }
       }
     }