diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-06-14 00:31:39 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-06-14 00:31:39 +0100 |
commit | 998b1035a6c8349b3661861eeb5d9d1f4082ba0a (patch) | |
tree | 2d7391d972f76b9baf539ceeae872efacecaee7b | |
parent | 43d8cc5909aa45aee0b3368e70275469b0f8de22 (diff) |
Added imcb_remove_buddy() so deletions in Jabber roster pushes actually
work. This also solves the issue of underscores appearing and disappearing
in their nicknames when people leave/join a chat.
-rw-r--r-- | bitlbee.c | 2 | ||||
-rw-r--r-- | protocols/jabber/conference.c | 4 | ||||
-rw-r--r-- | protocols/jabber/iq.c | 5 | ||||
-rw-r--r-- | protocols/jabber/jabber.c | 2 | ||||
-rw-r--r-- | protocols/nogaim.c | 8 |
5 files changed, 14 insertions, 7 deletions
@@ -69,6 +69,7 @@ int bitlbee_daemon_init() #ifdef IPV6 memset( &listen_addr6, 0, sizeof( listen_addr6 ) ); + memset( &listen_addr, 0, sizeof( listen_addr ) ); listen_addr6.sin6_family = AF_INET6; listen_addr6.sin6_port = htons( global.conf->port ); if( ( i = inet_pton( AF_INET6, ipv6_wrap( global.conf->iface ), &listen_addr6.sin6_addr ) ) != 1 ) @@ -76,7 +77,6 @@ int bitlbee_daemon_init() /* Forget about IPv6 in this function. */ use_ipv6 = 0; #endif - memset( &listen_addr, 0, sizeof( listen_addr ) ); listen_addr.sin_family = AF_INET; listen_addr.sin_port = htons( global.conf->port ); if( strcmp( global.conf->iface, "::" ) == 0 ) diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 09a63cbc..1b392655 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -166,11 +166,13 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu imcb_chat_add_buddy( chat, bud->ext_jid ); if( s ) *s = '/'; } - else if( type ) /* This only gets called if type is NULL or "unavailable" */ + else if( type ) /* type can only be NULL or "unavailable" in this function */ { s = strchr( bud->ext_jid, '/' ); if( s ) *s = 0; imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); + if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS ) + imcb_remove_buddy( ic, bud->ext_jid, NULL ); if( s ) *s = '/'; if( bud == jc->me ) diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 0050fb5b..e5c5dde2 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -377,11 +377,8 @@ static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node * } else if( strcmp( sub, "remove" ) == 0 ) { - /* Don't have any API call for this yet! So let's - just try to handle this as well as we can. */ jabber_buddy_remove_bare( ic, jid ); - imcb_buddy_status( ic, jid, 0, NULL, NULL ); - /* FIXME! */ + imcb_remove_buddy( ic, jid, NULL ); } } diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index b70af944..ad28c93c 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -333,7 +333,7 @@ static void jabber_remove_buddy( struct im_connection *ic, char *who, char *grou if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) { jd->flags &= ~JFLAG_XMLCONSOLE; - /* FIXME imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); */ + imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); return; } diff --git a/protocols/nogaim.c b/protocols/nogaim.c index a1a97dc3..4f04993c 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -441,6 +441,14 @@ void imcb_rename_buddy( struct im_connection *ic, char *handle, char *realname ) } } +void imcb_remove_buddy( struct im_connection *ic, char *handle, char *group ) +{ + user_t *u; + + if( ( u = user_findhandle( ic, handle ) ) ) + user_del( ic->irc, u->nick ); +} + /* Mainly meant for ICQ (and now also for Jabber conferences) to allow IM modules to suggest a nickname for a handle. */ void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ) |