changeset 1433:0c030b00306d

Allow the special JID "." in command say_to
author Mikael Berthe <mikael@lilotux.net>
date Sat, 23 Feb 2008 11:49:34 +0100
parents 46e5eb9917bc
children bed2f0caa952
files mcabber/src/commands.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/commands.c	Sat Feb 23 11:42:07 2008 +0100
+++ b/mcabber/src/commands.c	Sat Feb 23 11:49:34 2008 +0100
@@ -1443,7 +1443,16 @@
   fjid = *paramlst;
   msg = *(paramlst+1);
 
-  if (!strcmp(fjid, ".") || check_jid_syntax(fjid)) {
+  if (!strcmp(fjid, ".")) {
+    // Send the message to the current buddy
+    if (current_buddy)
+      fjid = (char*)buddy_getjid(BUDDATA(current_buddy));
+    if (!fjid) {
+      scr_LogPrint(LPRINT_NORMAL, "Please specify a Jabber ID.");
+      free_arg_lst(paramlst);
+      return;
+    }
+  } else if (check_jid_syntax(fjid)) {
     scr_LogPrint(LPRINT_NORMAL, "Please specify a valid Jabber ID.");
     free_arg_lst(paramlst);
     return;