Display a warning when using /request while disconnected
authorMikael Berthe <mikael@lilotux.net>
Tue, 06 Oct 2009 21:22:51 +0200
changeset 1592 1802b926e3fa
parent 1591 44fef962f572
child 1593 06fdfff29175
Display a warning when using /request while disconnected
mcabber/src/commands.c
mcabber/src/jabglue.c
--- a/mcabber/src/commands.c	Sun Oct 04 20:56:16 2009 +0200
+++ b/mcabber/src/commands.c	Tue Oct 06 21:22:51 2009 +0200
@@ -3114,6 +3114,12 @@
     return;
   }
 
+  if (!jb_getonline()) {
+    scr_LogPrint(LPRINT_NORMAL, "You are not connected.");
+    free_arg_lst(paramlst);
+    return;
+  }
+
   // Allow special jid "" or "." (current buddy)
   if (fjid && (!*fjid || !strcmp(fjid, ".")))
     fjid = NULL;
--- a/mcabber/src/jabglue.c	Sun Oct 04 20:56:16 2009 +0200
+++ b/mcabber/src/jabglue.c	Tue Oct 06 21:22:51 2009 +0200
@@ -1144,6 +1144,8 @@
   void (*request_fn)(const char *);
   const char *strreqtype;
 
+  if (!online) return;
+
   if (reqtype == iqreq_version) {
     request_fn = &request_version;
     strreqtype = "version";