aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/jabber')
-rw-r--r--protocols/jabber/iq.c4
-rw-r--r--protocols/jabber/jabber.c5
-rw-r--r--protocols/jabber/message.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c
index 2930e75f..82c90d39 100644
--- a/protocols/jabber/iq.c
+++ b/protocols/jabber/iq.c
@@ -64,7 +64,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
/* Of course this is a very essential query to support. ;-) */
if( strcmp( s, XMLNS_VERSION ) == 0 )
{
- xt_add_child( reply, xt_new_node( "name", "BitlBee", NULL ) );
+ xt_add_child( reply, xt_new_node( "name", set_getstr( &ic->acc->set, "user_agent" ), NULL ) );
xt_add_child( reply, xt_new_node( "version", BITLBEE_VERSION, NULL ) );
xt_add_child( reply, xt_new_node( "os", ARCH, NULL ) );
}
@@ -107,7 +107,7 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
c = xt_new_node( "identity", NULL, NULL );
xt_add_attr( c, "category", "client" );
xt_add_attr( c, "type", "pc" );
- xt_add_attr( c, "name", "BitlBee" );
+ xt_add_attr( c, "name", set_getstr( &ic->acc->set, "user_agent" ) );
xt_add_child( reply, c );
for( f = features; *f; f ++ )
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index d5948958..7147a628 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -81,6 +81,8 @@ 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, "user_agent", "BitlBee", NULL, acc );
+
s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc );
s->flags |= ACC_SET_OFFLINE_ONLY;
@@ -485,7 +487,8 @@ static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg )
static void jabber_keepalive( struct im_connection *ic )
{
/* Just any whitespace character is enough as a keepalive for XMPP sessions. */
- jabber_write( ic, "\n", 1 );
+ if( !jabber_write( ic, "\n", 1 ) )
+ return;
/* This runs the garbage collection every minute, which means every packet
is in the cache for about a minute (which should be enough AFAIK). */
diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c
index e8161029..fa915bd8 100644
--- a/protocols/jabber/message.c
+++ b/protocols/jabber/message.c
@@ -54,7 +54,7 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
char *ns = xt_find_attr( c, "xmlns" ), *room;
struct xt_node *inv, *reason;
- if( strcmp( ns, XMLNS_MUC_USER ) == 0 &&
+ if( ns && strcmp( ns, XMLNS_MUC_USER ) == 0 &&
( inv = xt_find_node( c->children, "invite" ) ) )
{
room = from;