Add /occupants indent command

Roster has a `/roster contact indent` option.
Now we have the same for occupants. So contacts in roster and in MUC can
have configurable indentation.

Regards https://github.com/boothj5/profanity/issues/690
This commit is contained in:
Michael Vetter
2019-04-18 20:53:02 +02:00
parent 7e4e9e6688
commit 0c248a0b16
7 changed files with 80 additions and 3 deletions

View File

@@ -1232,6 +1232,9 @@ cons_occupants_setting(void)
else
cons_show("Occupant jids (/occupants) : hide");
gint occupant_indent = prefs_get_occupants_indent();
cons_show("Occupant indent (/occupants) : %d", occupant_indent);
int size = prefs_get_occupants_size();
cons_show("Occupants size (/occupants) : %d", size);
}

View File

@@ -46,7 +46,18 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh
theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
wattron(layout->subwin, theme_attrs(presence_colour));
GString *msg = g_string_new(" ");
GString *msg = g_string_new(" ");
int indent = prefs_get_occupants_indent();
int current_indent = 0;
if (indent > 0) {
current_indent += indent;
while (indent > 0) {
g_string_append(msg, " ");
indent--;
}
}
g_string_append(msg, occupant->nick);
win_sub_print(layout->subwin, msg->str, TRUE, FALSE, 0);
g_string_free(msg, TRUE);