Changeset 4022b68 for root_commands.c


Ignore:
Timestamp:
2010-08-21T22:42:01Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
fd424c8
Parents:
327af51 (diff), c00dd71 (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 mainline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r327af51 r4022b68  
    100100
    101101static void cmd_account( irc_t *irc, char **cmd );
     102static void bitlbee_whatsnew( irc_t *irc );
    102103
    103104static void cmd_identify( irc_t *irc, char **cmd )
     
    155156                irc->status |= USTATUS_IDENTIFIED;
    156157                irc_umode_set( irc, "+R", 1 );
     158               
     159                bitlbee_whatsnew( irc );
    157160               
    158161                /* The following code is a bit hairy now. With takeover
     
    267270        if( ( val = set_getstr( head, key ) ) )
    268271                irc_usermsg( irc, "%s = `%s'", key, val );
     272        else if( !set_find( head, key ) )
     273        {
     274                irc_usermsg( irc, "Setting `%s' does not exist.", key );
     275                if( *head == irc->b->set )
     276                        irc_usermsg( irc, "It might be an account or channel setting. "
     277                                     "See \x02help account set\x02 and \x02help channel set\x02." );
     278        }
    269279        else
    270280                irc_usermsg( irc, "%s is empty", key );
     
    304314                        st = set_setstr( head, set_name, value );
    305315               
    306                 if( set_getstr( head, set_name ) == NULL )
     316                if( set_getstr( head, set_name ) == NULL &&
     317                    set_find( head, set_name ) )
    307318                {
    308319                        /* This happens when changing the passwd, for example.
     
    328339                while( s )
    329340                {
    330                         cmd_showset( irc, &s, s->key );
     341                        if( !( s->flags & SET_HIDDEN ) )
     342                                cmd_showset( irc, &s, s->key );
    331343                        s = s->next;
    332344                }
     
    10081020        irc_usermsg( irc, format, "Nick", "Handle/Account", "Status" );
    10091021       
    1010         if( strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 )
     1022        if( irc->root->last_channel &&
     1023            strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 )
    10111024                irc->root->last_channel = NULL;
    10121025       
     
    12711284}
    12721285
     1286/* Maybe this should be a stand-alone command as well? */
     1287static void bitlbee_whatsnew( irc_t *irc )
     1288{
     1289        int last = set_getint( &irc->b->set, "last_version" );
     1290        GString *msg = g_string_new( "" );
     1291        char s[16];
     1292       
     1293        if( last >= BITLBEE_VERSION_CODE )
     1294                return;
     1295       
     1296        if( last < 0x010206 ) /* 1.2.6 */
     1297        {
     1298                g_string_append( msg,
     1299                        "Twitter support. See \x02help account add twitter\x02.\n" );
     1300        }
     1301        if( last < 0x010300 ) /* 1.3dev */
     1302        {
     1303                g_string_append( msg,
     1304                        "Support for multiple configurable control channels, "
     1305                        "each with a subset of your contact list. See "
     1306                        "\x02help channels\x02 for more information.\n"
     1307                        "File transfer support for some protocols (more if "
     1308                        "you use libpurple). Just /DCC SEND stuff. Incoming "
     1309                        "files also become DCC transfers.\n"
     1310                        "Many more things, briefly described in "
     1311                        "\x02help news1.3\x02.\n" );
     1312        }
     1313       
     1314        if( msg->len > 0 )
     1315                irc_usermsg( irc, "%s: This seems to be your first time using this "
     1316                                  "this version of BitlBee. Here's a list of new "
     1317                                  "features you may like to know about:\n\n%s\n",
     1318                                  irc->user->nick, msg->str );
     1319       
     1320        g_string_free( msg, TRUE );
     1321        g_snprintf( s, sizeof( s ), "%d", BITLBEE_VERSION_CODE );
     1322        set_setstr( &irc->b->set, "last_version", s );
     1323}
     1324
    12731325/* IMPORTANT: Keep this list sorted! The short command logic needs that. */
    12741326const command_t commands[] = {
Note: See TracChangeset for help on using the changeset viewer.