aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/root_commands.c b/root_commands.c
index e0bf2e8f..62fe1f39 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -295,6 +295,11 @@ static void cmd_save(irc_t *irc, char **cmd)
irc_rootmsg(irc, "Please create an account first (see \x02help register\x02)");
} else if (storage_save(irc, NULL, TRUE) == STORAGE_OK) {
irc_rootmsg(irc, "Configuration saved");
+
+ if (irc->save_source_id != -1) {
+ b_event_remove(irc->save_source_id);
+ irc->save_source_id = -1;
+ }
} else {
irc_rootmsg(irc, "Configuration could not be saved!");
}
@@ -368,6 +373,10 @@ static int cmd_set_real(irc_t *irc, char **cmd, set_t **head, cmd_set_checkflags
} else {
cmd_showset(irc, head, set_name);
}
+
+ if (st /* XXX: && !(s->flags & SET_NOSAVE)*/) {
+ storage_setup_auto_save(irc);
+ }
} else if (set_name) {
cmd_showset(irc, head, set_name);
} else {
@@ -654,6 +663,23 @@ static void cmd_channel(irc_t *irc, char **cmd)
"channels you're still in cannot be deleted).",
irc->default_channel->name);
}
+ } else if (len >= 1 && g_strncasecmp(cmd[2], "rename", len) == 0) {
+ if (strlen(cmd[3]) < 1) {
+ irc_rootmsg(irc, "You have to specify new name.");
+ } else if (!(ic->flags & IRC_CHANNEL_JOINED) &&
+ ic != ic->irc->default_channel) {
+ if (irc_channel_name_hint(ic, cmd[3])) {
+ irc_rootmsg(irc, "Channel %s renamed to %s.",
+ cmd[1], cmd[3]);
+ } else {
+ irc_rootmsg(irc, "Failed to rename channel %s to %s.",
+ cmd[1], cmd[3]);
+ }
+ } else {
+ irc_rootmsg(irc, "Couldn't rename channel (main channel %s or "
+ "channels you're still in cannot be renamed).",
+ irc->default_channel->name);
+ }
} else {
irc_rootmsg(irc,
"Unknown command: %s [...] %s. Please use \x02help commands\x02 to get a list of available commands.", "channel",
@@ -1471,6 +1497,13 @@ static void cmd_nick(irc_t *irc, char **cmd)
irc_rootmsg(irc, "This command is deprecated. Try: account %s set display_name", cmd[1]);
}
+#ifdef WITH_GNUTLS
+static void cmd_certfp(irc_t *irc, char **cmd)
+{
+ irc_rootmsg(irc, "Show current/set new certfp");
+}
+#endif
+
/* Maybe this should be a stand-alone command as well? */
static void bitlbee_whatsnew(irc_t *irc)
{
@@ -1522,6 +1555,9 @@ command_t root_commands[] = {
{ "set", 0, cmd_set, 0 },
{ "transfer", 0, cmd_transfer, 0 },
{ "yes", 0, cmd_yesno, 0 },
+#ifdef WITH_GNUTLS
+ { "certfp", 1, cmd_certfp, 0 },
+#endif
/* Not expecting too many plugins adding root commands so just make a
dumb array with some empty entried at the end. */
{ NULL },