aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-04-05 14:03:31 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-04-05 14:03:31 +0100
commit1195cecc99315c9c38e05c8dd0981792e7663583 (patch)
treed7c90c89b22b928fa8069e6a966d00821ec731f5 /root_commands.c
parentf35aee7fdfc66138d0525a0a7b9e02ccb1aaaec7 (diff)
Changed root nicknames are now saved. (Bug #378)
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/root_commands.c b/root_commands.c
index aec91455..4b27afe3 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -602,6 +602,9 @@ static void cmd_rename( irc_t *irc, char **cmd )
{
g_free( irc->mynick );
irc->mynick = g_strdup( cmd[2] );
+
+ if( strcmp( cmd[0], "set_rename" ) != 0 )
+ set_setstr( &irc->set, "root_nick", cmd[2] );
}
else if( u->send_handler == buddy_send_handler )
{
@@ -612,6 +615,20 @@ static void cmd_rename( irc_t *irc, char **cmd )
}
}
+char *set_eval_root_nick( set_t *set, char *new_nick )
+{
+ irc_t *irc = set->data;
+
+ if( strcmp( irc->mynick, new_nick ) != 0 )
+ {
+ char *cmd[] = { "set_rename", irc->mynick, new_nick, NULL };
+
+ cmd_rename( irc, cmd );
+ }
+
+ return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : NULL;
+}
+
static void cmd_remove( irc_t *irc, char **cmd )
{
user_t *u;