Changeset 0e7ab64 for root_commands.c


Ignore:
Timestamp:
2007-04-23T02:58:44Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2d317bb
Parents:
43671b9
Message:

Got rid of one HORRIBLE stupidity called chat_by_channel(), which still
used the GLOBAL IM connections list, allowing user A to interfere with
user B's groupchats if running in daemon mode. I can't believe this was
still there...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r43671b9 r0e7ab64  
    918918                char *s;
    919919               
    920                 channel = g_strdup( chat );
     920                channel = g_strdup_printf( "&%s", chat );
    921921                if( ( s = strchr( channel, '@' ) ) )
    922922                        *s = 0;
     
    928928        if( cmd[3] && cmd[4] && cmd[5] )
    929929                password = cmd[5];
     930       
     931        if( channel[0] != '#' && channel[0] != '&' )
     932        {
     933                irc_usermsg( irc, "Invalid channel name: %s", channel );
     934                g_free( channel );
     935                return;
     936        }
     937        else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) )
     938        {
     939                irc_usermsg( irc, "Channel already exists: %s", channel );
     940                g_free( channel );
     941                return;
     942        }
    930943       
    931944        if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) )
Note: See TracChangeset for help on using the changeset viewer.