diff options
author | Sven Moritz Hallberg <sm@khjk.org> | 2008-02-03 22:30:03 +0100 |
---|---|---|
committer | Sven Moritz Hallberg <sm@khjk.org> | 2008-02-03 22:30:03 +0100 |
commit | 764c7d1009feda7db971ea7ac6bcb2a4acef0efc (patch) | |
tree | f156da4743548d36d0c8ab62633f133c5217fbd5 /root_commands.c | |
parent | b5c8a34aeff244ffe7a9f4bd5edf827495d0deea (diff) |
OTR support, first checkin
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/root_commands.c b/root_commands.c index 26a42a25..61bb5da9 100644 --- a/root_commands.c +++ b/root_commands.c @@ -28,6 +28,7 @@ #include "crypting.h" #include "bitlbee.h" #include "help.h" +#include "otr.h" #include <string.h> @@ -84,19 +85,27 @@ void root_command( irc_t *irc, char *cmd[] ) if( !cmd[0] ) return; + if(!g_mutex_trylock(irc->otr_mutex)) { + irc_usermsg(irc, "keygen in progress, bitlbee comatose - please wait"); + return; + } + for( i = 0; commands[i].command; i++ ) if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 ) { if( !cmd[commands[i].required_parameters] ) { irc_usermsg( irc, "Not enough parameters given (need %d)", commands[i].required_parameters ); + g_mutex_unlock(irc->otr_mutex); return; } commands[i].execute( irc, cmd ); + g_mutex_unlock(irc->otr_mutex); return; } irc_usermsg( irc, "Unknown command: %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[0] ); + g_mutex_unlock(irc->otr_mutex); } static void cmd_help( irc_t *irc, char **cmd ) @@ -240,6 +249,8 @@ static void cmd_account( irc_t *irc, char **cmd ) } irc_usermsg( irc, "Account successfully added" ); + + otr_check_for_key(a); } else if( g_strcasecmp( cmd[1], "del" ) == 0 ) { @@ -990,5 +1001,6 @@ const command_t commands[] = { { "nick", 1, cmd_nick, 0 }, { "qlist", 0, cmd_qlist, 0 }, { "join_chat", 2, cmd_join_chat, 0 }, + { "otr", 1, cmd_otr, 0 }, { NULL } }; |