Handle chat notifications even if the JID has no resource
authorfranky
Mon, 20 Apr 2009 19:58:06 +0200
changeset 1582 b5861a0fcd30
parent 1581 b29ac1f171ea
child 1583 c431fa9e2876
child 1587 0a1f59dc503d
Handle chat notifications even if the JID has no resource
mcabber/src/jabglue.c
--- a/mcabber/src/jabglue.c	Sat Apr 18 12:00:16 2009 +0200
+++ b/mcabber/src/jabglue.c	Mon Apr 20 19:58:06 2009 +0200
@@ -2686,6 +2686,10 @@
   } which_jep = JEP_none;
 
   rname = strchr(from, JID_RESOURCE_SEPARATOR);
+  if (rname)
+    ++rname;
+  else
+    rname = from + strlen(from);
   bjid  = jidtodisp(from);
   sl_buddy = roster_find(bjid, jidsearch, ROSTER_TYPE_USER);
   g_free(bjid);
@@ -2693,7 +2697,7 @@
   /* XXX Actually that's wrong, since it filters out server "offline"
      messages (for JEP-0022).  This JEP is (almost) deprecated so
      we don't really care. */
-  if (!sl_buddy || !rname++) {
+  if (!sl_buddy) {
     return;
   }