Changeset d088ee8


Ignore:
Timestamp:
2015-11-26T04:46:51Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
47ab9a9
Parents:
1ec454c
Message:

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.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    r1ec454c rd088ee8  
    255255
    256256        if (!(icu = irc_channel_has_user(ic, iu))) {
     257                if (iu == ic->irc->user && type == IRC_CDU_KICK) {
     258                        /* an error happened before joining, inform the client with a numeric */
     259                        irc_send_num(ic->irc, 403, "%s :Error joining channel (check control channel?)", ic->name);
     260                }
    257261                return 0;
    258262        }
  • irc_im.c

    r1ec454c rd088ee8  
    883883            acc->prpl->chat_join) {
    884884                char *nick;
     885                struct groupchat *gc;
    885886
    886887                if (!(nick = set_getstr(&ic->set, "nick"))) {
     
    889890
    890891                ic->flags |= IRC_CHANNEL_CHAT_PICKME;
    891                 acc->prpl->chat_join(acc->ic, room, nick, NULL, &ic->set);
     892                gc = acc->prpl->chat_join(acc->ic, room, nick, NULL, &ic->set);
    892893                ic->flags &= ~IRC_CHANNEL_CHAT_PICKME;
     894
     895                if (!gc) {
     896                        irc_send_num(ic->irc, 403, "%s :Error joining channel (check control channel?)", ic->name);
     897                }
    893898
    894899                return FALSE;
Note: See TracChangeset for help on using the changeset viewer.