Changeset 814aa52 for root_commands.c


Ignore:
Timestamp:
2010-06-03T11:00:45Z (9 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
a6b2f13
Parents:
5f8ab6a9 (diff), f4bcc22 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge in bitlbee 1.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r5f8ab6a9 r814aa52  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2004 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    659659                irc_usermsg( irc, "Nick `%s' can't be changed", cmd[1] );
    660660        }
     661        else if( g_strcasecmp( cmd[1], irc->channel ) == 0 )
     662        {
     663                if( strchr( CTYPES, cmd[2][0] ) && nick_ok( cmd[2] + 1 ) )
     664                {
     665                        u = user_find( irc, irc->nick );
     666                       
     667                        irc_part( irc, u, irc->channel );
     668                        g_free( irc->channel );
     669                        irc->channel = g_strdup( cmd[2] );
     670                        irc_join( irc, u, irc->channel );
     671                       
     672                        if( strcmp( cmd[0], "set_rename" ) != 0 )
     673                                set_setstr( &irc->set, "control_channel", cmd[2] );
     674                }
     675        }
    661676        else if( user_find( irc, cmd[2] ) && ( nick_cmp( cmd[1], cmd[2] ) != 0 ) )
    662677        {
     
    706721       
    707722        return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : SET_INVALID;
     723}
     724
     725char *set_eval_control_channel( set_t *set, char *new_name )
     726{
     727        irc_t *irc = set->data;
     728       
     729        if( strcmp( irc->channel, new_name ) != 0 )
     730        {
     731                char *cmd[] = { "set_rename", irc->channel, new_name, NULL };
     732               
     733                cmd_rename( irc, cmd );
     734        }
     735       
     736        return strcmp( irc->channel, new_name ) == 0 ? new_name : SET_INVALID;
    708737}
    709738
Note: See TracChangeset for help on using the changeset viewer.