1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-15 04:33:01 +01:00

fix ban command bug

This commit is contained in:
Jfreegman 2015-06-10 19:30:44 -04:00
parent 1ba0891f71
commit 35718db46f
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -169,12 +169,22 @@ void cmd_unban(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M
return;
}
if (tox_group_remove_ban_entry(m, self->num, ban_id) == -1) {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ban ID does not exist.");
return;
}
int ret = tox_group_remove_ban_entry(m, self->num, ban_id);
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ban list entry with id %d has been removed.", ban_id);
switch (ret) {
case 0: {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ban list entry with id %d has been removed.", ban_id);
return;
}
case -2: {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "You do not have permission to unban peers.");
return;
}
default: {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Ban ID does not exist.");
return;
}
}
}
void cmd_mod(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])