Changeset 180ab31


Ignore:
Timestamp:
2010-08-21T19:34:17Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a758ec1
Parents:
5613af7
Message:

Added some neat whatsnew code that keeps track of the newest version of
BitlBee used by a user, and if it looks like s/he hasn't used this one
before, show a list of new features that may be interesting.

Since I don't think im.bitlbee.org users will read any changelogs ever,
this is probably not a bad idea. If you hate it, the following command
should get rid of it forever: set last_version 9999999

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/misc.xml

    r5613af7 r180ab31  
    234234</sect1>
    235235
     236<sect1 id="news1.3">
     237<title>New stuff in BitlBee 1.3dev</title>
     238
     239<para>
     240Most of the core of BitlBee was rewritten since the last release. This entry
     241should sum up the majority of the changes.
     242</para>
     243
     244<para>
     245First of all, you can now have as many control channels as you want. Or you
     246can have none, it's finally possible to leave &amp;bitlbee and still talk to
     247all your contacts. Or you can have a &amp;work with all your work-related
     248contacts, or a &amp;msn with all your MSN Messenger contacts. See <emphasis>help
     249channels</emphasis> for more information about this.
     250</para>
     251
     252<para>
     253Also, you can change how nicknames are generated for your contacts. Like
     254automatically adding a [fb] tag to the nicks of all your Facebook contacts.
     255See <emphasis>help nick_format</emphasis>.
     256</para>
     257
     258<para>
     259When you're already connected to a BitlBee server and you connect from
     260elsewhere, you can take over the old session.
     261</para>
     262
     263<para>
     264Instead of account numbers, accounts now also get tags. These are
     265automatically generated but can be changed (<emphasis>help set
     266tag</emphasis>). You can now use them instead of accounts numbers.
     267(Example: <emphasis>acc gtalk on</emphasis>)
     268</para>
     269
     270<para>
     271Last of all: You can finally change your nickname and
     272shorten root commands (try <emphasis>acc li</emphasis> instead
     273of <emphasis>account list</emphasis>).
     274</para>
     275
     276</sect1>
     277
    236278</chapter>
  • irc.c

    r5613af7 r180ab31  
    109109        s = set_add( &b->set, "display_timestamps", "true", set_eval_bool, irc );
    110110        s = set_add( &b->set, "handle_unknown", "add_channel", NULL, irc );
     111        s = set_add( &b->set, "last_version", NULL, NULL, irc );
     112        s->flags |= SET_HIDDEN;
    111113        s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc );
    112114        s = set_add( &b->set, "nick_format", "%-@nick", NULL, irc );
     
    122124        s = set_add( &b->set, "query_order", "lifo", NULL, irc );
    123125        s = set_add( &b->set, "root_nick", ROOT_NICK, set_eval_root_nick, irc );
     126        s->flags |= SET_HIDDEN;
    124127        s = set_add( &b->set, "show_offline", "false", set_eval_bw_compat, irc );
    125128        s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc );
  • irc_channel.c

    r5613af7 r180ab31  
    759759        set_del( &ic->set, "group" );
    760760        set_del( &ic->set, "protocol" );
     761        set_del( &ic->set, "show_users" );
    761762       
    762763        g_free( icc );
  • root_commands.c

    r5613af7 r180ab31  
    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
     
    336339                while( s )
    337340                {
    338                         cmd_showset( irc, &s, s->key );
     341                        if( !( s->flags & SET_HIDDEN ) )
     342                                cmd_showset( irc, &s, s->key );
    339343                        s = s->next;
    340344                }
     
    12801284}
    12811285
     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
    12821325/* IMPORTANT: Keep this list sorted! The short command logic needs that. */
    12831326const command_t commands[] = {
  • set.h

    r5613af7 r180ab31  
    4343extern char *SET_INVALID;
    4444
    45 #define SET_NULL_OK        0x0100
     45typedef enum
     46{
     47        SET_NULL_OK = 0x0100,
     48        SET_HIDDEN = 0x0200,
     49} set_flags_t;
    4650
    4751typedef struct set
     
    6064                           set_getstr/int(). */
    6165       
    62         int flags;      /* See account.h, for example. set.c doesn't use
    63                            this (yet?). */
     66        set_flags_t flags; /* Mostly defined per user. */
    6467       
    6568        /* Eval: Returns SET_INVALID if the value is incorrect, exactly
Note: See TracChangeset for help on using the changeset viewer.