From b75acf6367400ff88428618719cefbbee648b0cb Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 22 Oct 2009 22:55:23 +0100 Subject: Don't include chat.h from bitlbee.h. make install-dev doesn't install chat.h and it shouldn't ... but things broke because bitlbee.h includes it. Fixes #534. --- root_commands.c | 1 + 1 file changed, 1 insertion(+) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index 678ee143..5de616fb 100644 --- a/root_commands.c +++ b/root_commands.c @@ -28,6 +28,7 @@ #include "crypting.h" #include "bitlbee.h" #include "help.h" +#include "chat.h" #include -- cgit v1.2.3 From a0bd4c247472c1997afbe8683ef460dadbb16b46 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 10 Mar 2010 23:58:28 +0000 Subject: Huh, what was that dead code doing there.. :-/ --- root_commands.c | 73 --------------------------------------------------------- 1 file changed, 73 deletions(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index 5de616fb..c79ff325 100644 --- a/root_commands.c +++ b/root_commands.c @@ -1114,79 +1114,6 @@ static void cmd_chat( irc_t *irc, char **cmd ) { irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); } - - - -#if 0 - account_t *a; - struct im_connection *ic; - char *chat, *channel, *nick = NULL, *password = NULL; - struct groupchat *c; - - if( !( a = account_get( irc, cmd[1] ) ) ) - { - irc_usermsg( irc, "Invalid account" ); - return; - } - else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) ) - { - irc_usermsg( irc, "That account is not on-line" ); - return; - } - else if( a->prpl->chat_join == NULL ) - { - irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); - return; - } - ic = a->ic; - - chat = cmd[2]; - if( cmd[3] ) - { - if( strchr( CTYPES, cmd[3][0] ) == NULL ) - channel = g_strdup_printf( "&%s", cmd[3] ); - else - channel = g_strdup( cmd[3] ); - } - else - { - char *s; - - channel = g_strdup_printf( "&%s", chat ); - if( ( s = strchr( channel, '@' ) ) ) - *s = 0; - } - if( cmd[3] && cmd[4] ) - nick = cmd[4]; - else - nick = irc->nick; - if( cmd[3] && cmd[4] && cmd[5] ) - password = cmd[5]; - - if( !nick_ok( channel + 1 ) ) - { - irc_usermsg( irc, "Invalid channel name: %s", channel ); - g_free( channel ); - return; - } - else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) ) - { - irc_usermsg( irc, "Channel already exists: %s", channel ); - g_free( channel ); - return; - } - - if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) ) - { - g_free( c->channel ); - c->channel = channel; - } - else - { - irc_usermsg( irc, "Tried to join chat, not sure if this was successful" ); - g_free( channel ); - } -#endif } const command_t commands[] = { -- cgit v1.2.3 From e9cf291a52097d5b9428b8d1650cc691d5cc5dc8 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 14 Mar 2010 16:42:22 +0000 Subject: Allow the identify command only once. (Bug #509) --- root_commands.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index c79ff325..b3432b9b 100644 --- a/root_commands.c +++ b/root_commands.c @@ -143,6 +143,12 @@ static void cmd_identify( irc_t *irc, char **cmd ) storage_status_t status = storage_load( irc, cmd[1] ); char *account_on[] = { "account", "on", NULL }; + if( strchr( irc->umode, 'R' ) != NULL ) + { + irc_usermsg( irc, "You're already logged in." ); + return; + } + switch (status) { case STORAGE_INVALID_PASSWORD: irc_usermsg( irc, "Incorrect password" ); -- cgit v1.2.3 From 449a51de265cb3b4f0f5003e09fbbb030247c972 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 16 Mar 2010 10:18:02 +0000 Subject: Include non-away status messages in blist and whois responses. The whois change is a complete violation of the IRC protocol but that doesn't seem to be an uncommon thing. --- root_commands.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index b3432b9b..15e6e72a 100644 --- a/root_commands.c +++ b/root_commands.c @@ -913,7 +913,7 @@ static void cmd_blist( irc_t *irc, char **cmd ) else if( cmd[1] && g_strcasecmp( cmd[1], "online" ) == 0 ) online = 1; else - online = away = 1; + online = away = 1; if( strchr( irc->umode, 'b' ) != NULL ) format = "%s\t%s\t%s"; @@ -926,8 +926,13 @@ static void cmd_blist( irc_t *irc, char **cmd ) { if( online == 1 ) { + char st[256] = "Online"; + + if( u->status_msg ) + g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg ); + g_snprintf( s, sizeof( s ) - 1, "%s@%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name, u->ic->acc->user ); - irc_usermsg( irc, format, u->nick, s, "Online" ); + irc_usermsg( irc, format, u->nick, s, st ); } n_online ++; -- cgit v1.2.3