diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-18 14:38:06 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-18 14:38:06 +0000 |
commit | 638feab58aebc97d646820dd1bc9b8d9fbeec29d (patch) | |
tree | c4022afb6ffef2b672f3aaf16c8bd7a9f7b23ea8 /protocols/jabber/jabber.c | |
parent | 6ce01bec119c96243a8d43e28681cc512fbd0950 (diff) | |
parent | 842cd8dbfb98b61af33b5fe481364c3cfbeaca04 (diff) |
Merging in Jabber resource selection fix. This adds the activity_timeout
setting, which makes BitlBee send a message to bare JIDs if there was no
recent seen activity from any of the person's resources. This should fix
most issues with messages going to the wrong resource (i.e. someone's
mobile phone instead of something more sensible).
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index a1fb8817..86320ada 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -57,6 +57,8 @@ static void jabber_init( account_t *acc ) set_t *s; char str[16]; + s = set_add( &acc->set, "activity_timeout", "600", set_eval_int, acc ); + g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] ); s = set_add( &acc->set, "port", str, set_eval_int, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; @@ -306,7 +308,7 @@ static int jabber_buddy_msg( struct im_connection *ic, char *who, char *message, if( ( s = strchr( who, '=' ) ) && jabber_chat_by_jid( ic, s + 1 ) ) bud = jabber_buddy_by_ext_jid( ic, who, 0 ); else - bud = jabber_buddy_by_jid( ic, who, 0 ); + bud = jabber_buddy_by_jid( ic, who, GET_BUDDY_BARE_OK ); node = xt_new_node( "body", message, NULL ); node = jabber_make_packet( "message", "chat", bud ? bud->full_jid : who, node ); @@ -351,17 +353,9 @@ static GList *jabber_away_states( struct im_connection *ic ) static void jabber_get_info( struct im_connection *ic, char *who ) { - struct jabber_data *jd = ic->proto_data; struct jabber_buddy *bud; - if( strchr( who, '/' ) ) - bud = jabber_buddy_by_jid( ic, who, 0 ); - else - { - char *s = jabber_normalize( who ); - bud = g_hash_table_lookup( jd->buddies, s ); - g_free( s ); - } + bud = jabber_buddy_by_jid( ic, who, GET_BUDDY_FIRST ); while( bud ) { |