aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitlbee.h3
-rw-r--r--doc/user-guide/misc.xml35
-rw-r--r--help.c24
-rw-r--r--help.h1
-rw-r--r--irc.c1
-rw-r--r--irc_commands.c1
-rw-r--r--irc_send.c2
-rw-r--r--root_commands.c28
8 files changed, 68 insertions, 27 deletions
diff --git a/bitlbee.h b/bitlbee.h
index a137ae43..0ec6406e 100644
--- a/bitlbee.h
+++ b/bitlbee.h
@@ -136,7 +136,6 @@
#include "conf.h"
#include "log.h"
#include "ini.h"
-#include "help.h"
#include "query.h"
#include "sock.h"
#include "misc.h"
@@ -146,7 +145,7 @@ typedef struct global {
/* In forked mode, child processes store the fd of the IPC socket here. */
int listen_socket;
gint listen_watch_source_id;
- help_t *help;
+ struct help *help;
char *conf_file;
conf_t *conf;
GList *storage; /* The first backend in the list will be used for saving */
diff --git a/doc/user-guide/misc.xml b/doc/user-guide/misc.xml
index 979ad026..906b312e 100644
--- a/doc/user-guide/misc.xml
+++ b/doc/user-guide/misc.xml
@@ -267,10 +267,43 @@ everything in the handle up to the first @.
</sect1>
-<sect1 id="news1.3">
+<sect1 id="whatsnew010206">
+<title>New stuff in BitlBee 1.2.6</title>
+
+<para>
+Twitter support. See <emphasis>help account add twitter</emphasis>.
+</para>
+</sect1>
+
+<sect1 id="whatsnew010300">
<title>New stuff in BitlBee 1.3dev</title>
<para>
+Support for multiple configurable control channels, each with a subset of
+your contact list. See <emphasis>help channels</emphasis> for more
+information.
+</para>
+
+<para>
+File transfer support for some protocols (more if you use libpurple). Just
+/DCC SEND stuff. Incoming files also become DCC transfers.
+</para>
+
+<para>
+Only if you run your own BitlBee instance: You can build a BitlBee that uses
+libpurple for connecting to IM networks instead of its own code, adding
+support for some of the more obscure IM protocols and features.
+</para>
+
+<para>
+Many more things, briefly described in <emphasis>help news1.3</emphasis>.
+</para>
+</sect1>
+
+<sect1 id="news1.3">
+<title>New stuff in BitlBee 1.3dev (details)</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>
diff --git a/help.c b/help.c
index 14156eaf..86013cb3 100644
--- a/help.c
+++ b/help.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2009 Wilmer van der Gaast and others *
+ * Copyright 2002-2010 Wilmer van der Gaast and others *
\********************************************************************/
/* Help file control */
@@ -25,6 +25,7 @@
#define BITLBEE_CORE
#include "bitlbee.h"
+#include "help.h"
#undef read
#undef write
@@ -193,3 +194,24 @@ int help_add_mem( help_t **help, const char *title, const char *content )
return 1;
}
+
+char *help_get_whatsnew( help_t **help, int old )
+{
+ GString *ret = NULL;
+ help_t *h;
+ int v;
+
+ for( h = *help; h; h = h->next )
+ if( h->title != NULL && strncmp( h->title, "whatsnew", 8 ) == 0 &&
+ sscanf( h->title + 8, "%x", &v ) == 1 && v > old )
+ {
+ char *s = help_get( &h, h->title );
+ if( ret == NULL )
+ ret = g_string_new( s );
+ else
+ g_string_append_printf( ret, "\n\n%s", s );
+ g_free( s );
+ }
+
+ return ret ? g_string_free( ret, FALSE ) : NULL;
+}
diff --git a/help.h b/help.h
index e689a93d..9f4d1572 100644
--- a/help.h
+++ b/help.h
@@ -46,5 +46,6 @@ G_GNUC_MALLOC help_t *help_init( help_t **help, const char *helpfile );
void help_free( help_t **help );
char *help_get( help_t **help, char *title );
int help_add_mem( help_t **help, const char *title, const char *content_ );
+char *help_get_whatsnew( help_t **help, int old );
#endif
diff --git a/irc.c b/irc.c
index 836d5f81..b18ee612 100644
--- a/irc.c
+++ b/irc.c
@@ -111,6 +111,7 @@ irc_t *irc_new( int fd )
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->value = g_strdup_printf( "%d", BITLBEE_VERSION_CODE );
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 );
diff --git a/irc_commands.c b/irc_commands.c
index 7874f519..ce276051 100644
--- a/irc_commands.c
+++ b/irc_commands.c
@@ -25,6 +25,7 @@
#define BITLBEE_CORE
#include "bitlbee.h"
+#include "help.h"
#include "ipc.h"
static void irc_cmd_pass( irc_t *irc, char **cmd )
diff --git a/irc_send.c b/irc_send.c
index 791ecc75..c992dae1 100644
--- a/irc_send.c
+++ b/irc_send.c
@@ -113,7 +113,7 @@ void irc_usermsg( irc_t *irc, char *format, ... )
{
irc_channel_t *ic = NULL;
irc_user_t *iu = irc->root;
- char text[1024];
+ char text[1100];
va_list params;
char *dst;
diff --git a/root_commands.c b/root_commands.c
index 94d22933..f3186562 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -1292,37 +1292,21 @@ static void cmd_nick( irc_t *irc, char **cmd )
static void bitlbee_whatsnew( irc_t *irc )
{
int last = set_getint( &irc->b->set, "last_version" );
- GString *msg = g_string_new( "" );
- char s[16];
+ char s[16], *msg;
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" );
- }
+ msg = help_get_whatsnew( &(global.help), last );
- if( msg->len > 0 )
+ if( msg )
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 );
+ irc->user->nick, msg );
+
+ g_free( msg );
- g_string_free( msg, TRUE );
g_snprintf( s, sizeof( s ), "%d", BITLBEE_VERSION_CODE );
set_setstr( &irc->b->set, "last_version", s );
}