From b36ada0f5ba6fced75ecc2e269d99c09a4178f0f Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Thu, 4 Jun 2015 16:46:30 -0400 Subject: [PATCH] remove obsolete prune command --- src/execute.c | 1 - src/group_commands.c | 20 ++------------------ src/groupchat.c | 6 +++--- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/execute.c b/src/execute.c index 8bd8ac3..9ba68c7 100644 --- a/src/execute.c +++ b/src/execute.c @@ -93,7 +93,6 @@ static struct cmd_func group_commands[] = { { "/passwd", cmd_set_passwd }, { "/peerlimit", cmd_set_peerlimit }, { "/privacy", cmd_set_privacy }, - { "/prune", cmd_prune }, { "/rejoin", cmd_rejoin }, { "/silence", cmd_silence }, { "/topic", cmd_set_topic }, diff --git a/src/group_commands.c b/src/group_commands.c index 871c510..4ffb763 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -205,33 +205,17 @@ void cmd_mod(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX line_info_add(self, NULL, NULL, NULL, SYS_MSG, 1, BLUE, "You have promoted %s to moderator.", nick); return; } - case -1: { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to promote peer to moderator"); - return; - } case -2: { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "You do not have permission to promote moderators."); return; } - case -3: { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Moderator list is full. Use the \"/prune\" command to remove all offline mods from the mod list."); + default: { + line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to promote peer to moderator"); return; } } } -void cmd_prune(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) -{ - int num_pruned = tox_group_prune_moderator_list(m, self->num); - - if (num_pruned == -1) { - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Failed to prune moderator list."); - return; - } - - line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "%d offline moderators have been pruned from the list.", num_pruned); -} - void cmd_unmod(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { if (argc < 1) { diff --git a/src/groupchat.c b/src/groupchat.c index b140f25..a3a6aa7 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -604,13 +604,13 @@ static void groupchat_onGroupModeration(ToxWindow *self, Tox *m, int groupnum, u line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, RED, "-!- %s has been banned by %s", tgt_name, src_name); break; case TOX_GROUP_MOD_EVENT_OBSERVER: - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has been silenced by %s", tgt_name, src_name); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has set %s's role to observer", src_name, tgt_name); break; case TOX_GROUP_MOD_EVENT_USER: - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has been made a normal user by %s", tgt_name, src_name); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has set %s's role to user", src_name, tgt_name); break; case TOX_GROUP_MOD_EVENT_MODERATOR: - line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has been promoted to moderator by %s", tgt_name, src_name); + line_info_add(self, timefrmt, NULL, NULL, SYS_MSG, 1, BLUE, "-!- %s has set %s's role to moderator", src_name, tgt_name); break; default: return;