mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Show 0 rather than 10 in /wins
This commit is contained in:
parent
c6265adef4
commit
5a3db018dc
@ -248,6 +248,7 @@ cons_show_wins(void)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
int ui_index = 0;
|
||||||
|
|
||||||
cons_show("");
|
cons_show("");
|
||||||
cons_show("Active windows:");
|
cons_show("Active windows:");
|
||||||
@ -265,11 +266,15 @@ cons_show_wins(void)
|
|||||||
if (windows[i] != NULL) {
|
if (windows[i] != NULL) {
|
||||||
ProfWin *window = windows[i];
|
ProfWin *window = windows[i];
|
||||||
win_print_time(console, '-');
|
win_print_time(console, '-');
|
||||||
|
ui_index = i + 1;
|
||||||
|
if (ui_index == 10) {
|
||||||
|
ui_index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch (window->type)
|
switch (window->type)
|
||||||
{
|
{
|
||||||
case WIN_CHAT:
|
case WIN_CHAT:
|
||||||
wprintw(console->win, "%d: Chat %s", i + 1, window->from);
|
wprintw(console->win, "%d: Chat %s", ui_index, window->from);
|
||||||
PContact contact = roster_get_contact(window->from);
|
PContact contact = roster_get_contact(window->from);
|
||||||
|
|
||||||
if (contact != NULL) {
|
if (contact != NULL) {
|
||||||
@ -286,7 +291,7 @@ cons_show_wins(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WIN_PRIVATE:
|
case WIN_PRIVATE:
|
||||||
wprintw(console->win, "%d: Private %s", i + 1, window->from);
|
wprintw(console->win, "%d: Private %s", ui_index, window->from);
|
||||||
|
|
||||||
if (window->unread > 0) {
|
if (window->unread > 0) {
|
||||||
wprintw(console->win, ", %d unread", window->unread);
|
wprintw(console->win, ", %d unread", window->unread);
|
||||||
@ -295,7 +300,7 @@ cons_show_wins(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WIN_MUC:
|
case WIN_MUC:
|
||||||
wprintw(console->win, "%d: Room %s", i + 1, window->from);
|
wprintw(console->win, "%d: Room %s", ui_index, window->from);
|
||||||
|
|
||||||
if (window->unread > 0) {
|
if (window->unread > 0) {
|
||||||
wprintw(console->win, ", %d unread", window->unread);
|
wprintw(console->win, ", %d unread", window->unread);
|
||||||
@ -304,7 +309,7 @@ cons_show_wins(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WIN_DUCK:
|
case WIN_DUCK:
|
||||||
wprintw(console->win, "%d: DuckDuckGo search", i + 1);
|
wprintw(console->win, "%d: DuckDuckGo search", ui_index);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user