aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-04-12 00:49:32 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2010-04-12 00:49:32 +0200
commiteabc9d2c1b1d29aeb47162da64ce2b607c3d43ff (patch)
tree0f6258df41bf50a6b3bb5e7eefbba0bcfa687443 /protocols
parentd986463c9e026b2a5f003f44db3105aa5449fc27 (diff)
Fixed cleanup issues when turning off an account. Also fixed syntax of
*_user_free().
Diffstat (limited to 'protocols')
-rw-r--r--protocols/bee.h2
-rw-r--r--protocols/bee_user.c6
-rw-r--r--protocols/nogaim.c9
3 files changed, 9 insertions, 8 deletions
diff --git a/protocols/bee.h b/protocols/bee.h
index 6f896c51..e87bb762 100644
--- a/protocols/bee.h
+++ b/protocols/bee.h
@@ -84,7 +84,7 @@ void bee_free( bee_t *b );
/* bee_user.c */
bee_user_t *bee_user_new( bee_t *bee, struct im_connection *ic, const char *handle );
-int bee_user_free( bee_t *bee, struct im_connection *ic, const char *handle );
+int bee_user_free( bee_t *bee, bee_user_t *bu );
bee_user_t *bee_user_by_handle( bee_t *bee, struct im_connection *ic, const char *handle );
int bee_user_msg( bee_t *bee, bee_user_t *bu, const char *msg, int flags );
diff --git a/protocols/bee_user.c b/protocols/bee_user.c
index 20c760a9..f856e7a2 100644
--- a/protocols/bee_user.c
+++ b/protocols/bee_user.c
@@ -45,11 +45,9 @@ bee_user_t *bee_user_new( bee_t *bee, struct im_connection *ic, const char *hand
return bu;
}
-int bee_user_free( bee_t *bee, struct im_connection *ic, const char *handle )
+int bee_user_free( bee_t *bee, bee_user_t *bu )
{
- bee_user_t *bu;
-
- if( ( bu = bee_user_by_handle( bee, ic, handle ) ) == NULL )
+ if( !bu )
return 0;
if( bee->ui->user_free )
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index cbfbe00a..4dd60ea6 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -326,12 +326,15 @@ void imc_logout( struct im_connection *ic, int allow_reconnect )
g_free( ic->away );
ic->away = NULL;
- for( l = bee->users; l; l = l->next )
+ for( l = bee->users; l; )
{
bee_user_t *bu = l->data;
+ GSList *next = l->next;
if( bu->ic == ic )
- bee_user_free( bee, ic, bu->handle );
+ bee_user_free( bee, bu );
+
+ l = next;
}
//query_del_by_conn( ic->irc, ic );
@@ -402,7 +405,7 @@ void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char
void imcb_remove_buddy( struct im_connection *ic, const char *handle, char *group )
{
- bee_user_free( ic->bee, ic, handle );
+ bee_user_free( ic->bee, bee_user_by_handle( ic->bee, ic, handle ) );
}
/* Mainly meant for ICQ (and now also for Jabber conferences) to allow IM