From 06bdb0d16713dd41a4a38b20dba68362f953c917 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Thu, 11 Nov 2021 09:59:54 -0500 Subject: [PATCH] Add groupchat help menu It seems to have disappeared after a recent rebase --- src/help.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/help.c b/src/help.c index 17bd908..be6403f 100644 --- a/src/help.c +++ b/src/help.c @@ -285,6 +285,42 @@ static void help_draw_chat(ToxWindow *self) wnoutrefresh(win); } +static void help_draw_groupchats(ToxWindow *self) +{ + WINDOW *win = self->help->win; + + wmove(win, 1, 1); + + wattron(win, A_BOLD | COLOR_PAIR(RED)); + wprintw(win, "Groupchat commands:\n"); + wattroff(win, A_BOLD | COLOR_PAIR(RED)); + + wprintw(win, " /chatid : Print this group's ID\n"); + wprintw(win, " /close : Leave the group with an optional part message\n"); + wprintw(win, " /disconnect : Disconnect from the group (credentials retained)\n"); + wprintw(win, " /ignore : Ignore a peer\n"); + wprintw(win, " /unignore : Unignore an ignored peer\n"); + wprintw(win, " /kick : Remove a peer from the group\n"); + wprintw(win, " /mod : Promote a peer to moderator\n"); + wprintw(win, " /mykey : Print your groupchat ID\n"); + wprintw(win, " /passwd : Set a password needed to join the group\n"); + wprintw(win, " /peerlimit : Set the maximum number of peers that can join\n"); + wprintw(win, " /privacy : Set the group privacy state: private | public\n"); + wprintw(win, " /rejoin : Reconnect to the groupchat\n"); + wprintw(win, " /silence : Silence a peer for the entire group\n"); + wprintw(win, " /unsilence : Unsilence a silenced peer\n"); + wprintw(win, " /status : Set your status\n"); + wprintw(win, " /topic : Set the group topic\n"); + wprintw(win, " /unmod : Demote a moderator\n"); + wprintw(win, " /whisper : Send a private message to a peer\n"); + wprintw(win, " /whois : Print whois info for a peer\n"); + + help_draw_bottom_menu(win); + + box(win, ACS_VLINE, ACS_HLINE); + wnoutrefresh(win); +} + static void help_draw_keys(ToxWindow *self) { WINDOW *win = self->help->win; @@ -450,6 +486,11 @@ void help_onKey(ToxWindow *self, wint_t key) help_init_menu(self); self->help->type = HELP_MENU; break; + + case L'r': + help_init_window(self, 24, 80); + self->help->type = HELP_GROUP; + break; } } @@ -486,5 +527,9 @@ void help_onDraw(ToxWindow *self) help_draw_plugin(self); break; #endif /* PYTHON */ + + case HELP_GROUP: + help_draw_groupchats(self); + break; } }