From 39f93f0ce1c0a179b51f5ff6474d57509e9e0d17 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 31 Aug 2008 14:42:33 +0100 Subject: /join can now be used to join chatrooms, join_chat should not be used anymore. /join should not be used for unnamed groupchats anymore, use "chat with" instead. --- irc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 9b4e0020..d6b11dca 100644 --- a/irc.c +++ b/irc.c @@ -780,7 +780,9 @@ void irc_login( irc_t *irc ) irc_reply( irc, 2, ":Host %s is running BitlBee " BITLBEE_VERSION " " ARCH "/" CPU ".", irc->myhost ); irc_reply( irc, 3, ":%s", IRCD_INFO ); irc_reply( irc, 4, "%s %s %s %s", irc->myhost, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES ); - irc_reply( irc, 5, "PREFIX=(ov)@+ CHANTYPES=#& CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", CMODES, MAX_NICK_LENGTH - 1 ); + irc_reply( irc, 5, "PREFIX=(ov)@+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee " + "CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", + CTYPES, CMODES, MAX_NICK_LENGTH - 1 ); irc_motd( irc ); irc->umode[0] = '\0'; irc_umode_set( irc, "+" UMODE, 1 ); @@ -1021,7 +1023,7 @@ int irc_send( irc_t *irc, char *nick, char *s, int flags ) struct groupchat *c = NULL; user_t *u = NULL; - if( *nick == '#' || *nick == '&' ) + if( strchr( CTYPES, *nick ) ) { if( !( c = irc_chat_by_channel( irc, nick ) ) ) { -- cgit v1.2.3 From e1720ce8958ae014ce38d03b7b9ab129d947921b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 14 Dec 2008 01:38:59 +0000 Subject: Fixed a bug in the IRC parser where lines that start with a colon and don't contain any spaces could make BitlBee read uninitialized memory (and possibly even parse it as if it were a command). Also fixed a small memory leak around there. --- irc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 10b4fd83..2dcc625d 100644 --- a/irc.c +++ b/irc.c @@ -406,10 +406,8 @@ void irc_process( irc_t *irc ) lines[i] = conv; } - if( lines[i] ) + if( lines[i] && ( cmd = irc_parse_line( lines[i] ) ) ) { - if( ( cmd = irc_parse_line( lines[i] ) ) == NULL ) - continue; irc_exec( irc, cmd ); g_free( cmd ); } @@ -484,7 +482,7 @@ char **irc_parse_line( char *line ) /* Move the line pointer to the start of the command, skipping spaces and the optional prefix. */ if( line[0] == ':' ) { - for( i = 0; line[i] != ' '; i ++ ); + for( i = 0; line[i] && line[i] != ' '; i ++ ); line = line + i; } for( i = 0; line[i] == ' '; i ++ ); -- cgit v1.2.3