changeset 436:802da817a684

Add /rawxml command
author Mikael Berthe <mikael@lilotux.net>
date Thu, 15 Sep 2005 23:22:12 +0200
parents c918c1831d58
children 170f1aa12989
files mcabber/doc/mcabber.1 mcabber/doc/mcabber.1.html mcabber/doc/mcabber.1.txt mcabber/src/commands.c mcabber/src/jabglue.c mcabber/src/jabglue.h
diffstat 6 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/doc/mcabber.1	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/doc/mcabber.1	Thu Sep 15 23:22:12 2005 +0200
@@ -172,6 +172,10 @@
  \fBabort\fR	leave multi\-line mode without sending the message
 
 .TP
+\fB/rawxml\fR send
+ \fBsend\fR string: send string (raw XML format) to the Jabber server\&. No check is done on the string provided\&. BEWARE! Use this only if you know what you are doing, or you could terminate the connection\&.
+
+.TP
 \fB/rename\fR nickname
 Rename current buddy to the given nickname\&. This command does not work for groups, at the moment (but you can move the buddies to another group with the /move command)\&.
 
--- a/mcabber/doc/mcabber.1.html	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/doc/mcabber.1.html	Thu Sep 15 23:22:12 2005 +0200
@@ -401,6 +401,12 @@
         Disconnect and leave <tt>mcabber(1)</tt>.
 </dd>
 <dt><b>
+/rawxml send
+</b></dt>
+<dd>
+        <b>send</b> string: send string (raw XML format) to the Jabber server.  No check is done on the string provided.  BEWARE! Use this only if you know what you are doing, or you could terminate the connection.
+</dd>
+<dt><b>
 /rename nickname
 </b></dt>
 <dd>
@@ -549,8 +555,8 @@
 License (GPL).</p>
 <div id="footer">
 <p>
-Version 0.6.8<br />
-Last updated 12-Sep-2005 19:31:21 CEST
+Version 0.6.9-dev<br />
+Last updated 15-Sep-2005 23:02:56 CEST
 </p>
 </div>
 </div>
--- a/mcabber/doc/mcabber.1.txt	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/doc/mcabber.1.txt	Thu Sep 15 23:22:12 2005 +0200
@@ -163,6 +163,9 @@
 /quit::
         Disconnect and leave `mcabber(1)`.
 
+/rawxml send::
+        'send' string: send string (raw XML format) to the Jabber server.  No check is done on the string provided.  BEWARE! Use this only if you know what you are doing, or you could terminate the connection.
+
 /rename nickname::
         Rename current buddy to the given nickname.
         This command does not work for groups, at the moment (but you can move
--- a/mcabber/src/commands.c	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/src/commands.c	Thu Sep 15 23:22:12 2005 +0200
@@ -49,6 +49,7 @@
 static void do_bind(char *arg);
 static void do_connect(char *arg);
 static void do_disconnect(char *arg);
+static void do_rawxml(char *arg);
 
 // Global variable for the commands list
 static GSList *Commands;
@@ -92,6 +93,7 @@
           COMPL_MULTILINE, 0, &do_msay);
   //cmd_add("nick");
   cmd_add("quit", "Exit the software", 0, 0, NULL);
+  cmd_add("rawxml", "Send a raw XML string", 0, 0, &do_rawxml);
   cmd_add("rename", "Rename the current buddy", 0, 0, &do_rename);
   //cmd_add("request_auth");
   cmd_add("roster", "Manipulate the roster/buddylist", COMPL_ROSTER, 0,
@@ -823,6 +825,19 @@
     settings_set(SETTINGS_TYPE_BINDING, keycode, value);
 }
 
+static void do_rawxml(char *arg)
+{
+  if (!strncasecmp(arg, "send ", 5))  {
+    for (arg += 5; *arg && *arg == ' '; arg++)
+      ;
+    scr_LogPrint(LPRINT_NORMAL, "Sending XML string");
+    jb_send_raw(arg);
+  } else {
+    scr_LogPrint(LPRINT_NORMAL, "Please read the manual page"
+                 " before using /rawxml :-)");
+  }
+}
+
 static void do_connect(char *arg)
 {
   mcabber_connect();
--- a/mcabber/src/jabglue.c	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/src/jabglue.c	Thu Sep 15 23:22:12 2005 +0200
@@ -173,6 +173,12 @@
   time(&LastPingTime);
 }
 
+void jb_send_raw(const char *str)
+{
+  if (jc && online)
+    jab_send_raw(jc, str);
+}
+
 void jb_keepalive()
 {
   if (jc && online)
--- a/mcabber/src/jabglue.h	Thu Sep 15 21:51:00 2005 +0200
+++ b/mcabber/src/jabglue.h	Thu Sep 15 23:22:12 2005 +0200
@@ -48,6 +48,7 @@
 inline enum imstatus jb_getstatus();
 void jb_setstatus(enum imstatus st, const char *msg);
 void jb_send_msg(const char *, const char *);
+void jb_send_raw(const char *str);
 void jb_keepalive();
 inline void jb_reset_keepalive();
 void jb_set_keepalive_delay(unsigned int delay);