changeset 1592:1802b926e3fa

Display a warning when using /request while disconnected
author Mikael Berthe <mikael@lilotux.net>
date Tue, 06 Oct 2009 21:22:51 +0200
parents 44fef962f572
children 06fdfff29175
files mcabber/src/commands.c mcabber/src/jabglue.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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";