diff options
Diffstat (limited to 'protocols/jabber')
-rw-r--r-- | protocols/jabber/io.c | 4 | ||||
-rw-r--r-- | protocols/jabber/jabber.c | 3 | ||||
-rw-r--r-- | protocols/jabber/s5bytestream.c | 7 |
3 files changed, 9 insertions, 5 deletions
diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index ef7d5c13..a28eea90 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -211,7 +211,7 @@ static gboolean jabber_read_callback( gpointer data, gint fd, b_input_condition /* If there's no version attribute, assume this is an old server that can't do SASL authentication. */ - if( !sasl_supported( ic ) ) + if( !set_getbool( &ic->acc->set, "sasl") || !sasl_supported( ic ) ) { /* If there's no version= tag, we suppose this server does NOT implement: XMPP 1.0, @@ -374,7 +374,7 @@ static xt_status jabber_pkt_features( struct xt_node *node, gpointer data ) support it after all, we should try to do authentication the other way. jabber.com doesn't seem to do SASL while it pretends to be XMPP 1.0 compliant! */ - else if( !( jd->flags & JFLAG_AUTHENTICATED ) && sasl_supported( ic ) ) + else if( !( jd->flags & JFLAG_AUTHENTICATED ) && set_getbool( &ic->acc->set, "sasl") && sasl_supported( ic ) ) { if( !jabber_init_iq_auth( ic ) ) return XT_ABORT; diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index e7692484..9b94b21d 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -83,6 +83,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, "sasl", "true", set_eval_bool, acc ); + s->flags |= ACC_SET_OFFLINE_ONLY | SET_HIDDEN_DEFAULT; + s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc ); s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc ); diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c index 3304d99e..f4618cef 100644 --- a/protocols/jabber/s5bytestream.c +++ b/protocols/jabber/s5bytestream.c @@ -876,7 +876,8 @@ jabber_streamhost_t *jabber_si_parse_proxy( struct im_connection *ic, char *prox jabber_streamhost_t *sh; if( ( ( host = strchr( proxy, ',' ) ) == 0 ) || - ( ( port = strchr( host+1, ',' ) ) == 0 ) ) { + ( ( port = strchr( host+1, ',' ) ) == 0 ) ) + { imcb_log( ic, "Error parsing proxy setting: \"%s\" (ignored)", proxy ); return NULL; } @@ -888,7 +889,7 @@ jabber_streamhost_t *jabber_si_parse_proxy( struct im_connection *ic, char *prox sh = g_new0( jabber_streamhost_t, 1 ); sh->jid = g_strdup( jid ); sh->host = g_strdup( host ); - strcpy( sh->port, port ); + g_snprintf( sh->port, sizeof( sh->port ), "%s", port ); return sh; } @@ -914,7 +915,7 @@ void jabber_si_set_proxies( struct bs_transfer *bt ) sh = g_new0( jabber_streamhost_t, 1 ); sh->jid = g_strdup( tf->ini_jid ); sh->host = g_strdup( host ); - strcpy( sh->port, port ); + g_snprintf( sh->port, sizeof( sh->port ), "%s", port ); bt->streamhosts = g_slist_append( bt->streamhosts, sh ); bt->tf->watch_in = b_input_add( tf->fd, B_EV_IO_READ, jabber_bs_send_handshake, bt ); |