aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-08 01:45:10 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-08 01:45:10 +0100
commitb17ce85d2c4e69637531a7989b30c7011832ccb9 (patch)
tree6002b01b62fd3edfaa7632529e7e551face07f43
parent27e2c66f28bc196d766ac179aa5eae0d190565d5 (diff)
Users leaving really show up again.
-rw-r--r--irc_im.c11
-rw-r--r--protocols/bee_chat.c29
2 files changed, 23 insertions, 17 deletions
diff --git a/irc_im.c b/irc_im.c
index 27822349..c71f30be 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -249,6 +249,8 @@ gboolean bee_irc_chat_log( bee_t *bee, struct groupchat *c, const char *text )
irc_channel_t *ic = c->ui_data;
irc_channel_printf( ic, "%s", text );
+
+ return TRUE;
}
gboolean bee_irc_chat_msg( bee_t *bee, struct groupchat *c, bee_user_t *bu, const char *msg, time_t sent_at )
@@ -272,10 +274,17 @@ gboolean bee_irc_chat_add_user( bee_t *bee, struct groupchat *c, bee_user_t *bu
irc_t *irc = bee->ui_data;
irc_channel_add_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data );
+
+ return TRUE;
}
gboolean bee_irc_chat_remove_user( bee_t *bee, struct groupchat *c, bee_user_t *bu )
{
+ irc_t *irc = bee->ui_data;
+
+ irc_channel_del_user( c->ui_data, bu == bee->user ? irc->user : bu->ui_data );
+
+ return TRUE;
}
@@ -318,7 +327,7 @@ const struct bee_ui_funcs irc_ui_funcs = {
bee_irc_chat_log,
bee_irc_chat_msg,
bee_irc_chat_add_user,
- NULL,
+ bee_irc_chat_remove_user,
bee_irc_ft_in_start,
bee_irc_ft_out_start,
diff --git a/protocols/bee_chat.c b/protocols/bee_chat.c
index 0c7bebd9..f1d1a2c1 100644
--- a/protocols/bee_chat.c
+++ b/protocols/bee_chat.c
@@ -197,34 +197,31 @@ void imcb_chat_add_buddy( struct groupchat *c, const char *handle )
c->joined = 1;
}
-/* This function is one BIG hack... :-( EREWRITE */
-void imcb_chat_remove_buddy( struct groupchat *b, const char *handle, const char *reason )
+void imcb_chat_remove_buddy( struct groupchat *c, const char *handle, const char *reason )
{
-#if 0
- user_t *u;
- int me = 0;
+ struct im_connection *ic = c->ic;
+ bee_t *bee = ic->bee;
+ bee_user_t *bu = NULL;
- if( set_getbool( &b->ic->bee->set, "debug" ) )
- imcb_log( b->ic, "User %s removed from conversation %p (%s)", handle, b, reason ? reason : "" );
+ if( set_getbool( &bee->set, "debug" ) )
+ imcb_log( ic, "User %s removed from conversation %p (%s)", handle, c, reason ? reason : "" );
/* It might be yourself! */
- if( g_strcasecmp( handle, b->ic->acc->user ) == 0 )
+ if( g_strcasecmp( handle, ic->acc->user ) == 0 )
{
- if( b->joined == 0 )
+ if( c->joined == 0 )
return;
- u = user_find( b->ic->irc, b->ic->irc->nick );
- b->joined = 0;
- me = 1;
+ bu = bee->user;
+ c->joined = 0;
}
else
{
- u = user_findhandle( b->ic, handle );
+ bu = bee_user_by_handle( bee, ic, handle );
}
- if( me || ( remove_chat_buddy_silent( b, handle ) && b->joined && u ) )
- irc_part( b->ic->irc, u, b->channel );
-#endif
+ if( bee->ui->chat_remove_user )
+ bee->ui->chat_remove_user( bee, c, bu );
}
#if 0