Changeset 81ee561 for root_commands.c


Ignore:
Timestamp:
2010-03-20T18:03:18Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
85693e6
Parents:
3330468 (diff), 0baed0d (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:

Merging head. Most changes are not so relevant because they're to IM
modules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r3330468 r81ee561  
    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
     
    654654                irc_usermsg( irc, "Nick `%s' can't be changed", cmd[1] );
    655655        }
     656        else if( g_strcasecmp( cmd[1], irc->channel ) == 0 )
     657        {
     658                if( strchr( CTYPES, cmd[2][0] ) && nick_ok( cmd[2] + 1 ) )
     659                {
     660                        u = user_find( irc, irc->nick );
     661                       
     662                        irc_part( irc, u, irc->channel );
     663                        g_free( irc->channel );
     664                        irc->channel = g_strdup( cmd[2] );
     665                        irc_join( irc, u, irc->channel );
     666                       
     667                        if( strcmp( cmd[0], "set_rename" ) != 0 )
     668                                set_setstr( &irc->set, "control_channel", cmd[2] );
     669                }
     670        }
    656671        else if( user_find( irc, cmd[2] ) && ( nick_cmp( cmd[1], cmd[2] ) != 0 ) )
    657672        {
     
    701716       
    702717        return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : SET_INVALID;
     718}
     719
     720char *set_eval_control_channel( set_t *set, char *new_name )
     721{
     722        irc_t *irc = set->data;
     723       
     724        if( strcmp( irc->channel, new_name ) != 0 )
     725        {
     726                char *cmd[] = { "set_rename", irc->channel, new_name, NULL };
     727               
     728                cmd_rename( irc, cmd );
     729        }
     730       
     731        return strcmp( irc->channel, new_name ) == 0 ? new_name : SET_INVALID;
    703732}
    704733
     
    914943                online = 1;
    915944        else
    916                 online =  away = 1;
     945                online = away = 1;
    917946       
    918947        if( strchr( irc->umode, 'b' ) != NULL )
     
    927956                if( online == 1 )
    928957                {
     958                        char st[256] = "Online";
     959                       
     960                        if( u->status_msg )
     961                                g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg );
     962                       
    929963                        g_snprintf( s, sizeof( s ) - 1, "%s@%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name, u->ic->acc->user );
    930                         irc_usermsg( irc, format, u->nick, s, "Online" );
     964                        irc_usermsg( irc, format, u->nick, s, st );
    931965                }
    932966               
Note: See TracChangeset for help on using the changeset viewer.