1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-22 22:43:25 +01:00

Remove redundant command /mykey

You can get your own key with the /whois command
This commit is contained in:
jfreegman 2021-11-11 10:05:52 -05:00
parent 06bdb0d167
commit cbf3145aee
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
5 changed files with 1 additions and 28 deletions

View File

@ -127,7 +127,6 @@ static struct cmd_func groupchat_commands[] = {
{ "/ignore", cmd_ignore },
{ "/kick", cmd_kick },
{ "/mod", cmd_mod },
{ "/mykey", cmd_mykey },
{ "/passwd", cmd_set_passwd },
{ "/peerlimit", cmd_set_peerlimit },
{ "/privacy", cmd_set_privacy },

View File

@ -271,29 +271,6 @@ void cmd_unmod(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[M
}
}
void cmd_mykey(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
char pk_string[TOX_GROUP_PEER_PUBLIC_KEY_SIZE * 2 + 1] = {0};
char pk[TOX_GROUP_PEER_PUBLIC_KEY_SIZE];
TOX_ERR_GROUP_SELF_QUERY err;
if (!tox_group_self_get_public_key(m, self->num, (uint8_t *) pk, &err)) {
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, "Failed to fetch your public key (error %d)", err);
return;
}
size_t i;
for (i = 0; i < TOX_GROUP_PEER_PUBLIC_KEY_SIZE; ++i) {
char d[3];
snprintf(d, sizeof(d), "%02X", pk[i] & 0xff);
strcat(pk_string, d);
}
line_info_add(self, false, NULL, NULL, SYS_MSG, 0, 0, "%s", pk_string);
}
void cmd_set_passwd(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])
{
const char *passwd = NULL;

View File

@ -31,7 +31,6 @@ void cmd_disconnect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*ar
void cmd_ignore(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_kick(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_mod(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_mykey(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_prune(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_set_passwd(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_set_peerlimit(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);

View File

@ -91,7 +91,6 @@ static const char *group_cmd_list[] = {
"/log",
"/mod",
"/myid",
"/mykey",
#ifdef QRCODE
"/myqr",
#endif /* QRCODE */

View File

@ -302,7 +302,6 @@ static void help_draw_groupchats(ToxWindow *self)
wprintw(win, " /unignore <name> : Unignore an ignored peer\n");
wprintw(win, " /kick <name> : Remove a peer from the group\n");
wprintw(win, " /mod <name> : Promote a peer to moderator\n");
wprintw(win, " /mykey : Print your groupchat ID\n");
wprintw(win, " /passwd <s> : Set a password needed to join the group\n");
wprintw(win, " /peerlimit <n> : Set the maximum number of peers that can join\n");
wprintw(win, " /privacy <type> : Set the group privacy state: private | public\n");
@ -488,7 +487,7 @@ void help_onKey(ToxWindow *self, wint_t key)
break;
case L'r':
help_init_window(self, 24, 80);
help_init_window(self, 23, 80);
self->help->type = HELP_GROUP;
break;
}