# HG changeset patch # User Mikael Berthe # Date 1126819332 -7200 # Node ID 802da817a684289b814fbdb4cf7b97df71f9b4f6 # Parent c918c1831d586ff58f7847b4fe6edddf5108d8ce Add /rawxml command diff -r c918c1831d58 -r 802da817a684 mcabber/doc/mcabber.1 --- 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)\&. diff -r c918c1831d58 -r 802da817a684 mcabber/doc/mcabber.1.html --- 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 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
@@ -549,8 +555,8 @@ License (GPL).

diff -r c918c1831d58 -r 802da817a684 mcabber/doc/mcabber.1.txt --- 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 diff -r c918c1831d58 -r 802da817a684 mcabber/src/commands.c --- 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(); diff -r c918c1831d58 -r 802da817a684 mcabber/src/jabglue.c --- 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) diff -r c918c1831d58 -r 802da817a684 mcabber/src/jabglue.h --- 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);