From a6df0b5d21370549328c7929a008abb68f2ed4db Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 14 Nov 2007 23:29:43 +0000 Subject: Added "xmlconsole" setting so it can be enabled at login time already. --- doc/user-guide/commands.xml | 13 +++++++++++++ protocols/jabber/jabber.c | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index cf40782f..8f97558f 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -680,6 +680,19 @@ + + false + + + + The Jabber module allows you to add a buddy xmlconsole to your contact list, which will then show you the raw XMPP stream between you and the server. You can also send XMPP packets to this buddy, which will then be sent to the server. + + + If you want to enable this XML console permanently (and at login time already), you can set this setting. + + + + Rename (renick) a buddy rename <oldnick> <newnick> diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 9176cd68..ab26efc9 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -54,6 +54,9 @@ static void jabber_init( account_t *acc ) s = set_add( &acc->set, "tls", "try", set_eval_tls, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; + + s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc ); + s->flags |= ACC_SET_OFFLINE_ONLY; } static void jabber_login( account_t *acc ) @@ -188,6 +191,14 @@ static void jabber_login( account_t *acc ) imcb_error( ic, "Could not connect to server" ); imc_logout( ic, TRUE ); } + + if( set_getbool( &acc->set, "xmlconsole" ) ) + { + jd->flags |= JFLAG_XMLCONSOLE; + /* Shouldn't really do this at this stage already, maybe. But + I think this shouldn't break anything. */ + imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); + } } static void jabber_logout( struct im_connection *ic ) -- cgit v1.2.3