changeset 831:dd865cc57aa2

Fix joining a room when the buddylist is empty
author Mikael Berthe <mikael@lilotux.net>
date Thu, 04 May 2006 10:35:45 +0200
parents 80434fde7cfa
children 7c210263c661
files mcabber/src/commands.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/commands.c	Wed May 03 11:28:41 2006 +0200
+++ b/mcabber/src/commands.c	Thu May 04 10:35:45 2006 +0200
@@ -1862,9 +1862,6 @@
     return;
   }
 
-  if (!current_buddy) return;
-  bud = BUDDATA(current_buddy);
-
   paramlst = split_arg(arg, 2, 1); // subcmd, arg
   subcmd = *paramlst;
   arg = *(paramlst+1);
@@ -1875,6 +1872,16 @@
     return;
   }
 
+  if (current_buddy) {
+    bud = BUDDATA(current_buddy);
+  } else {
+    if (strcasecmp(subcmd, "join"))
+      return;
+    // "room join" is a special case, we don't need to have a valid
+    // current_buddy.
+    bud = NULL;
+  }
+
   if (!strcasecmp(subcmd, "join"))  {
     if ((arg = check_room_subcommand(arg, TRUE, NULL)) != NULL)
       room_join(bud, arg);