aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-26 01:46:51 -0300
committerdequis <dx@dxzone.com.ar>2015-11-26 01:46:51 -0300
commitd088ee8bc50cfe13130da745791f533705acd35e (patch)
treee489321b585ec462ce14c0cdef3f02bcd91fec89 /irc_channel.c
parent1ec454cf138125d65b75d4f0516c7e097d22db6b (diff)
irc: Send numeric error when failing to join a channel
This fixes issues like getting a blank window with a channel that the irc client thinks the user is in but bitlbee doesn't. The error is sent either by returning NULL in the chat_join prpl function, or by calling imcb_chat_free() before the user is added to the channel. This wasn't possible before since purple returned NULL in its chat_join, which resulted in other bugs too. Since that's fixed, I can finally apply this, which has been in my stash for a very long while.
Diffstat (limited to 'irc_channel.c')
-rw-r--r--irc_channel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 714e974a..50fa14b3 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -254,6 +254,10 @@ int irc_channel_del_user(irc_channel_t *ic, irc_user_t *iu, irc_channel_del_user
irc_channel_user_t *icu;
if (!(icu = irc_channel_has_user(ic, iu))) {
+ if (iu == ic->irc->user && type == IRC_CDU_KICK) {
+ /* an error happened before joining, inform the client with a numeric */
+ irc_send_num(ic->irc, 403, "%s :Error joining channel (check control channel?)", ic->name);
+ }
return 0;
}