aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-21 20:34:17 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-21 20:34:17 +0100
commit180ab31c09a9990a135b78fd6d52de5b093550f2 (patch)
tree9dbe34973631c6ade89190bfeb78f151a05fa982
parent5613af716212defcf5ee51f8dc13525f54323382 (diff)
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
-rw-r--r--doc/user-guide/misc.xml42
-rw-r--r--irc.c3
-rw-r--r--irc_channel.c1
-rw-r--r--root_commands.c45
-rw-r--r--set.h9
5 files changed, 96 insertions, 4 deletions
diff --git a/doc/user-guide/misc.xml b/doc/user-guide/misc.xml
index 7829a432..dc0ce5ed 100644
--- a/doc/user-guide/misc.xml
+++ b/doc/user-guide/misc.xml
@@ -233,4 +233,46 @@ everything in the handle up to the first @.
</sect1>
+<sect1 id="news1.3">
+<title>New stuff in BitlBee 1.3dev</title>
+
+<para>
+Most of the core of BitlBee was rewritten since the last release. This entry
+should sum up the majority of the changes.
+</para>
+
+<para>
+First of all, you can now have as many control channels as you want. Or you
+can have none, it's finally possible to leave &amp;bitlbee and still talk to
+all your contacts. Or you can have a &amp;work with all your work-related
+contacts, or a &amp;msn with all your MSN Messenger contacts. See <emphasis>help
+channels</emphasis> for more information about this.
+</para>
+
+<para>
+Also, you can change how nicknames are generated for your contacts. Like
+automatically adding a [fb] tag to the nicks of all your Facebook contacts.
+See <emphasis>help nick_format</emphasis>.
+</para>
+
+<para>
+When you're already connected to a BitlBee server and you connect from
+elsewhere, you can take over the old session.
+</para>
+
+<para>
+Instead of account numbers, accounts now also get tags. These are
+automatically generated but can be changed (<emphasis>help set
+tag</emphasis>). You can now use them instead of accounts numbers.
+(Example: <emphasis>acc gtalk on</emphasis>)
+</para>
+
+<para>
+Last of all: You can finally change your nickname and
+shorten root commands (try <emphasis>acc li</emphasis> instead
+of <emphasis>account list</emphasis>).
+</para>
+
+</sect1>
+
</chapter>
diff --git a/irc.c b/irc.c
index e4af555c..4bbaee37 100644
--- a/irc.c
+++ b/irc.c
@@ -108,6 +108,8 @@ irc_t *irc_new( int fd )
s = set_add( &b->set, "display_namechanges", "false", set_eval_bool, irc );
s = set_add( &b->set, "display_timestamps", "true", set_eval_bool, irc );
s = set_add( &b->set, "handle_unknown", "add_channel", NULL, irc );
+ s = set_add( &b->set, "last_version", NULL, NULL, irc );
+ s->flags |= SET_HIDDEN;
s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc );
s = set_add( &b->set, "nick_format", "%-@nick", NULL, irc );
s = set_add( &b->set, "offline_user_quits", "true", set_eval_bool, irc );
@@ -121,6 +123,7 @@ irc_t *irc_new( int fd )
s = set_add( &b->set, "private", "true", set_eval_bool, irc );
s = set_add( &b->set, "query_order", "lifo", NULL, irc );
s = set_add( &b->set, "root_nick", ROOT_NICK, set_eval_root_nick, irc );
+ s->flags |= SET_HIDDEN;
s = set_add( &b->set, "show_offline", "false", set_eval_bw_compat, irc );
s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc );
s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc );
diff --git a/irc_channel.c b/irc_channel.c
index 118fef74..80b1cb62 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -758,6 +758,7 @@ static gboolean control_channel_free( irc_channel_t *ic )
set_del( &ic->set, "fill_by" );
set_del( &ic->set, "group" );
set_del( &ic->set, "protocol" );
+ set_del( &ic->set, "show_users" );
g_free( icc );
ic->data = NULL;
diff --git a/root_commands.c b/root_commands.c
index ad886f57..280c93a2 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -99,6 +99,7 @@ static void cmd_help( irc_t *irc, char **cmd )
}
static void cmd_account( irc_t *irc, char **cmd );
+static void bitlbee_whatsnew( irc_t *irc );
static void cmd_identify( irc_t *irc, char **cmd )
{
@@ -155,6 +156,8 @@ static void cmd_identify( irc_t *irc, char **cmd )
irc->status |= USTATUS_IDENTIFIED;
irc_umode_set( irc, "+R", 1 );
+ bitlbee_whatsnew( irc );
+
/* The following code is a bit hairy now. With takeover
support, we shouldn't immediately auto_connect in case
we're going to offer taking over an existing session.
@@ -335,7 +338,8 @@ static int cmd_set_real( irc_t *irc, char **cmd, set_t **head, cmd_set_checkflag
set_t *s = *head;
while( s )
{
- cmd_showset( irc, &s, s->key );
+ if( !( s->flags & SET_HIDDEN ) )
+ cmd_showset( irc, &s, s->key );
s = s->next;
}
}
@@ -1279,6 +1283,45 @@ static void cmd_transfer( irc_t *irc, char **cmd )
}
}
+/* Maybe this should be a stand-alone command as well? */
+static void bitlbee_whatsnew( irc_t *irc )
+{
+ int last = set_getint( &irc->b->set, "last_version" );
+ GString *msg = g_string_new( "" );
+ char s[16];
+
+ if( last >= BITLBEE_VERSION_CODE )
+ return;
+
+ if( last < 0x010206 ) /* 1.2.6 */
+ {
+ g_string_append( msg,
+ "Twitter support. See \x02help account add twitter\x02.\n" );
+ }
+ if( last < 0x010300 ) /* 1.3dev */
+ {
+ g_string_append( msg,
+ "Support for multiple configurable control channels, "
+ "each with a subset of your contact list. See "
+ "\x02help channels\x02 for more information.\n"
+ "File transfer support for some protocols (more if "
+ "you use libpurple). Just /DCC SEND stuff. Incoming "
+ "files also become DCC transfers.\n"
+ "Many more things, briefly described in "
+ "\x02help news1.3\x02.\n" );
+ }
+
+ if( msg->len > 0 )
+ irc_usermsg( irc, "%s: This seems to be your first time using this "
+ "this version of BitlBee. Here's a list of new "
+ "features you may like to know about:\n\n%s\n",
+ irc->user->nick, msg->str );
+
+ g_string_free( msg, TRUE );
+ g_snprintf( s, sizeof( s ), "%d", BITLBEE_VERSION_CODE );
+ set_setstr( &irc->b->set, "last_version", s );
+}
+
/* IMPORTANT: Keep this list sorted! The short command logic needs that. */
const command_t commands[] = {
{ "account", 1, cmd_account, 0 },
diff --git a/set.h b/set.h
index 4bd1ce18..d5be7644 100644
--- a/set.h
+++ b/set.h
@@ -42,7 +42,11 @@ typedef char *(*set_eval) ( struct set *set, char *value );
extern char *SET_INVALID;
-#define SET_NULL_OK 0x0100
+typedef enum
+{
+ SET_NULL_OK = 0x0100,
+ SET_HIDDEN = 0x0200,
+} set_flags_t;
typedef struct set
{
@@ -59,8 +63,7 @@ typedef struct set
In fact, you should only read values using
set_getstr/int(). */
- int flags; /* See account.h, for example. set.c doesn't use
- this (yet?). */
+ set_flags_t flags; /* Mostly defined per user. */
/* Eval: Returns SET_INVALID if the value is incorrect, exactly
the passed value variable, or a corrected value. In case of