mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Merge branch 'master' into osx-functional
This commit is contained in:
commit
1754937211
@ -281,6 +281,7 @@ static struct cmd_t command_defs[] =
|
|||||||
"/roster hide [offline|resource|presence|status|empty|count|priority|rooms]",
|
"/roster hide [offline|resource|presence|status|empty|count|priority|rooms]",
|
||||||
"/roster by group|presence|none",
|
"/roster by group|presence|none",
|
||||||
"/roster order name|presence",
|
"/roster order name|presence",
|
||||||
|
"/roster room order name|unread",
|
||||||
"/roster header char <char>|none",
|
"/roster header char <char>|none",
|
||||||
"/roster presence indent <indent>",
|
"/roster presence indent <indent>",
|
||||||
"/roster contact char <char>|none",
|
"/roster contact char <char>|none",
|
||||||
@ -323,6 +324,8 @@ static struct cmd_t command_defs[] =
|
|||||||
{ "by none", "No grouping in the roster panel." },
|
{ "by none", "No grouping in the roster panel." },
|
||||||
{ "order name", "Order roster items by name only." },
|
{ "order name", "Order roster items by name only." },
|
||||||
{ "order presence", "Order roster items by presence, and then by name." },
|
{ "order presence", "Order roster items by presence, and then by name." },
|
||||||
|
{ "room order name", "Order roster rooms by name." },
|
||||||
|
{ "room order unread", "Order roster rooms by unread messages, and then by name." },
|
||||||
{ "header char <char>", "Prefix roster headers with specified character." },
|
{ "header char <char>", "Prefix roster headers with specified character." },
|
||||||
{ "header char none", "Remove roster header character prefix." },
|
{ "header char none", "Remove roster header character prefix." },
|
||||||
{ "contact char <char>", "Prefix roster contacts with specified character." },
|
{ "contact char <char>", "Prefix roster contacts with specified character." },
|
||||||
@ -1895,6 +1898,8 @@ static Autocomplete roster_resource_ac;
|
|||||||
static Autocomplete roster_presence_ac;
|
static Autocomplete roster_presence_ac;
|
||||||
static Autocomplete roster_char_ac;
|
static Autocomplete roster_char_ac;
|
||||||
static Autocomplete roster_remove_all_ac;
|
static Autocomplete roster_remove_all_ac;
|
||||||
|
static Autocomplete roster_room_ac;
|
||||||
|
static Autocomplete roster_room_order_ac;
|
||||||
static Autocomplete group_ac;
|
static Autocomplete group_ac;
|
||||||
static Autocomplete bookmark_ac;
|
static Autocomplete bookmark_ac;
|
||||||
static Autocomplete bookmark_property_ac;
|
static Autocomplete bookmark_property_ac;
|
||||||
@ -2155,6 +2160,7 @@ cmd_init(void)
|
|||||||
autocomplete_add(roster_ac, "hide");
|
autocomplete_add(roster_ac, "hide");
|
||||||
autocomplete_add(roster_ac, "by");
|
autocomplete_add(roster_ac, "by");
|
||||||
autocomplete_add(roster_ac, "order");
|
autocomplete_add(roster_ac, "order");
|
||||||
|
autocomplete_add(roster_ac, "room");
|
||||||
autocomplete_add(roster_ac, "size");
|
autocomplete_add(roster_ac, "size");
|
||||||
autocomplete_add(roster_ac, "wrap");
|
autocomplete_add(roster_ac, "wrap");
|
||||||
autocomplete_add(roster_ac, "header");
|
autocomplete_add(roster_ac, "header");
|
||||||
@ -2199,6 +2205,13 @@ cmd_init(void)
|
|||||||
autocomplete_add(roster_order_ac, "name");
|
autocomplete_add(roster_order_ac, "name");
|
||||||
autocomplete_add(roster_order_ac, "presence");
|
autocomplete_add(roster_order_ac, "presence");
|
||||||
|
|
||||||
|
roster_room_ac = autocomplete_new();
|
||||||
|
autocomplete_add(roster_room_ac, "order");
|
||||||
|
|
||||||
|
roster_room_order_ac = autocomplete_new();
|
||||||
|
autocomplete_add(roster_room_order_ac, "name");
|
||||||
|
autocomplete_add(roster_room_order_ac, "unread");
|
||||||
|
|
||||||
roster_remove_all_ac = autocomplete_new();
|
roster_remove_all_ac = autocomplete_new();
|
||||||
autocomplete_add(roster_remove_all_ac, "contacts");
|
autocomplete_add(roster_remove_all_ac, "contacts");
|
||||||
|
|
||||||
@ -2472,6 +2485,8 @@ cmd_uninit(void)
|
|||||||
autocomplete_free(roster_show_ac);
|
autocomplete_free(roster_show_ac);
|
||||||
autocomplete_free(roster_by_ac);
|
autocomplete_free(roster_by_ac);
|
||||||
autocomplete_free(roster_order_ac);
|
autocomplete_free(roster_order_ac);
|
||||||
|
autocomplete_free(roster_room_ac);
|
||||||
|
autocomplete_free(roster_room_order_ac);
|
||||||
autocomplete_free(roster_remove_all_ac);
|
autocomplete_free(roster_remove_all_ac);
|
||||||
autocomplete_free(group_ac);
|
autocomplete_free(group_ac);
|
||||||
autocomplete_free(bookmark_ac);
|
autocomplete_free(bookmark_ac);
|
||||||
@ -2681,6 +2696,8 @@ cmd_reset_autocomplete(ProfWin *window)
|
|||||||
autocomplete_reset(roster_show_ac);
|
autocomplete_reset(roster_show_ac);
|
||||||
autocomplete_reset(roster_by_ac);
|
autocomplete_reset(roster_by_ac);
|
||||||
autocomplete_reset(roster_order_ac);
|
autocomplete_reset(roster_order_ac);
|
||||||
|
autocomplete_reset(roster_room_ac);
|
||||||
|
autocomplete_reset(roster_room_order_ac);
|
||||||
autocomplete_reset(roster_remove_all_ac);
|
autocomplete_reset(roster_remove_all_ac);
|
||||||
autocomplete_reset(group_ac);
|
autocomplete_reset(group_ac);
|
||||||
autocomplete_reset(titlebar_ac);
|
autocomplete_reset(titlebar_ac);
|
||||||
@ -3087,6 +3104,10 @@ _roster_autocomplete(ProfWin *window, const char *const input)
|
|||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
result = autocomplete_param_with_ac(input, "/roster room order", roster_room_order_ac, TRUE);
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
if (conn_status == JABBER_CONNECTED) {
|
if (conn_status == JABBER_CONNECTED) {
|
||||||
@ -3124,6 +3145,10 @@ _roster_autocomplete(ProfWin *window, const char *const input)
|
|||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
result = autocomplete_param_with_ac(input, "/roster room", roster_room_ac, TRUE);
|
||||||
|
if (result) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
result = autocomplete_param_with_func(input, "/roster wrap", prefs_autocomplete_boolean_choice);
|
result = autocomplete_param_with_func(input, "/roster wrap", prefs_autocomplete_boolean_choice);
|
||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -2184,6 +2184,31 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (g_strcmp0(args[0], "room") == 0) {
|
||||||
|
if (g_strcmp0(args[1], "order") == 0) {
|
||||||
|
if (g_strcmp0(args[2], "name") == 0) {
|
||||||
|
cons_show("Ordering roster rooms by name");
|
||||||
|
prefs_set_string(PREF_ROSTER_ROOMS_ORDER, "name");
|
||||||
|
if (conn_status == JABBER_CONNECTED) {
|
||||||
|
rosterwin_roster();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
} else if (g_strcmp0(args[2], "unread") == 0) {
|
||||||
|
cons_show("Ordering roster rooms by unread messages");
|
||||||
|
prefs_set_string(PREF_ROSTER_ROOMS_ORDER, "unread");
|
||||||
|
if (conn_status == JABBER_CONNECTED) {
|
||||||
|
rosterwin_roster();
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
cons_bad_cmd_usage(command);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cons_bad_cmd_usage(command);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
// add contact
|
// add contact
|
||||||
} else if (strcmp(args[0], "add") == 0) {
|
} else if (strcmp(args[0], "add") == 0) {
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
|
@ -1047,6 +1047,7 @@ _get_group(preference_t pref)
|
|||||||
case PREF_ROSTER_WRAP:
|
case PREF_ROSTER_WRAP:
|
||||||
case PREF_ROSTER_RESOURCE_JOIN:
|
case PREF_ROSTER_RESOURCE_JOIN:
|
||||||
case PREF_ROSTER_ROOMS:
|
case PREF_ROSTER_ROOMS:
|
||||||
|
case PREF_ROSTER_ROOMS_ORDER:
|
||||||
case PREF_RESOURCE_TITLE:
|
case PREF_RESOURCE_TITLE:
|
||||||
case PREF_RESOURCE_MESSAGE:
|
case PREF_RESOURCE_MESSAGE:
|
||||||
case PREF_ENC_WARN:
|
case PREF_ENC_WARN:
|
||||||
@ -1243,6 +1244,8 @@ _get_key(preference_t pref)
|
|||||||
return "roster.resource.join";
|
return "roster.resource.join";
|
||||||
case PREF_ROSTER_ROOMS:
|
case PREF_ROSTER_ROOMS:
|
||||||
return "roster.rooms";
|
return "roster.rooms";
|
||||||
|
case PREF_ROSTER_ROOMS_ORDER:
|
||||||
|
return "roster.rooms.order";
|
||||||
case PREF_RESOURCE_TITLE:
|
case PREF_RESOURCE_TITLE:
|
||||||
return "resource.title";
|
return "resource.title";
|
||||||
case PREF_RESOURCE_MESSAGE:
|
case PREF_RESOURCE_MESSAGE:
|
||||||
@ -1330,6 +1333,8 @@ _get_default_string(preference_t pref)
|
|||||||
return "presence";
|
return "presence";
|
||||||
case PREF_ROSTER_ORDER:
|
case PREF_ROSTER_ORDER:
|
||||||
return "presence";
|
return "presence";
|
||||||
|
case PREF_ROSTER_ROOMS_ORDER:
|
||||||
|
return "name";
|
||||||
case PREF_TIME_CONSOLE:
|
case PREF_TIME_CONSOLE:
|
||||||
return "%H:%M:%S";
|
return "%H:%M:%S";
|
||||||
case PREF_TIME_CHAT:
|
case PREF_TIME_CHAT:
|
||||||
|
@ -74,6 +74,7 @@ typedef enum {
|
|||||||
PREF_ROSTER_WRAP,
|
PREF_ROSTER_WRAP,
|
||||||
PREF_ROSTER_RESOURCE_JOIN,
|
PREF_ROSTER_RESOURCE_JOIN,
|
||||||
PREF_ROSTER_ROOMS,
|
PREF_ROSTER_ROOMS,
|
||||||
|
PREF_ROSTER_ROOMS_ORDER,
|
||||||
PREF_MUC_PRIVILEGES,
|
PREF_MUC_PRIVILEGES,
|
||||||
PREF_PRESENCE,
|
PREF_PRESENCE,
|
||||||
PREF_WRAP,
|
PREF_WRAP,
|
||||||
|
@ -120,6 +120,8 @@ static struct colours_t {
|
|||||||
NCURSES_COLOR_T otrtrusted;
|
NCURSES_COLOR_T otrtrusted;
|
||||||
NCURSES_COLOR_T otruntrusted;
|
NCURSES_COLOR_T otruntrusted;
|
||||||
NCURSES_COLOR_T rosterheader;
|
NCURSES_COLOR_T rosterheader;
|
||||||
|
NCURSES_COLOR_T rosterroom;
|
||||||
|
NCURSES_COLOR_T rosterroomunread;
|
||||||
NCURSES_COLOR_T occupantsheader;
|
NCURSES_COLOR_T occupantsheader;
|
||||||
NCURSES_COLOR_T receiptsent;
|
NCURSES_COLOR_T receiptsent;
|
||||||
} colour_prefs;
|
} colour_prefs;
|
||||||
@ -284,19 +286,23 @@ theme_init_colours(void)
|
|||||||
init_pair(43, colour_prefs.otrtrusted, colour_prefs.bkgnd);
|
init_pair(43, colour_prefs.otrtrusted, colour_prefs.bkgnd);
|
||||||
init_pair(44, colour_prefs.otruntrusted, colour_prefs.bkgnd);
|
init_pair(44, colour_prefs.otruntrusted, colour_prefs.bkgnd);
|
||||||
|
|
||||||
// subwin headers
|
// roster
|
||||||
init_pair(45, colour_prefs.rosterheader, colour_prefs.bkgnd);
|
init_pair(45, colour_prefs.rosterheader, colour_prefs.bkgnd);
|
||||||
init_pair(46, colour_prefs.occupantsheader, colour_prefs.bkgnd);
|
init_pair(46, colour_prefs.rosterroom, colour_prefs.bkgnd);
|
||||||
|
init_pair(47, colour_prefs.rosterroomunread, colour_prefs.bkgnd);
|
||||||
|
|
||||||
|
// occupants
|
||||||
|
init_pair(48, colour_prefs.occupantsheader, colour_prefs.bkgnd);
|
||||||
|
|
||||||
// raw
|
// raw
|
||||||
init_pair(47, COLOR_WHITE, colour_prefs.bkgnd);
|
init_pair(49, COLOR_WHITE, colour_prefs.bkgnd);
|
||||||
init_pair(48, COLOR_GREEN, colour_prefs.bkgnd);
|
init_pair(50, COLOR_GREEN, colour_prefs.bkgnd);
|
||||||
init_pair(49, COLOR_RED, colour_prefs.bkgnd);
|
init_pair(51, COLOR_RED, colour_prefs.bkgnd);
|
||||||
init_pair(50, COLOR_YELLOW, colour_prefs.bkgnd);
|
init_pair(52, COLOR_YELLOW, colour_prefs.bkgnd);
|
||||||
init_pair(51, COLOR_BLUE, colour_prefs.bkgnd);
|
init_pair(53, COLOR_BLUE, colour_prefs.bkgnd);
|
||||||
init_pair(52, COLOR_CYAN, colour_prefs.bkgnd);
|
init_pair(54, COLOR_CYAN, colour_prefs.bkgnd);
|
||||||
init_pair(53, COLOR_BLACK, colour_prefs.bkgnd);
|
init_pair(55, COLOR_BLACK, colour_prefs.bkgnd);
|
||||||
init_pair(54, COLOR_MAGENTA, colour_prefs.bkgnd);
|
init_pair(56, COLOR_MAGENTA, colour_prefs.bkgnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NCURSES_COLOR_T
|
static NCURSES_COLOR_T
|
||||||
@ -401,6 +407,8 @@ _load_colours(void)
|
|||||||
_set_colour("me", &colour_prefs.me, COLOR_YELLOW, THEME_ME);
|
_set_colour("me", &colour_prefs.me, COLOR_YELLOW, THEME_ME);
|
||||||
_set_colour("them", &colour_prefs.them, COLOR_GREEN, THEME_THEM);
|
_set_colour("them", &colour_prefs.them, COLOR_GREEN, THEME_THEM);
|
||||||
_set_colour("roster.header", &colour_prefs.rosterheader, COLOR_YELLOW, THEME_ROSTER_HEADER);
|
_set_colour("roster.header", &colour_prefs.rosterheader, COLOR_YELLOW, THEME_ROSTER_HEADER);
|
||||||
|
_set_colour("roster.room", &colour_prefs.rosterroom, COLOR_GREEN, THEME_ROSTER_ROOM);
|
||||||
|
_set_colour("roster.room.unread", &colour_prefs.rosterroomunread, COLOR_GREEN, THEME_ROSTER_ROOM_UNREAD);
|
||||||
_set_colour("occupants.header", &colour_prefs.occupantsheader, COLOR_YELLOW, THEME_OCCUPANTS_HEADER);
|
_set_colour("occupants.header", &colour_prefs.occupantsheader, COLOR_YELLOW, THEME_OCCUPANTS_HEADER);
|
||||||
_set_colour("receipt.sent", &colour_prefs.receiptsent, COLOR_RED, THEME_RECEIPT_SENT);
|
_set_colour("receipt.sent", &colour_prefs.receiptsent, COLOR_RED, THEME_RECEIPT_SENT);
|
||||||
}
|
}
|
||||||
@ -468,6 +476,7 @@ _load_preferences(void)
|
|||||||
_set_boolean_preference("roster.count", PREF_ROSTER_COUNT);
|
_set_boolean_preference("roster.count", PREF_ROSTER_COUNT);
|
||||||
_set_boolean_preference("roster.priority", PREF_ROSTER_PRIORITY);
|
_set_boolean_preference("roster.priority", PREF_ROSTER_PRIORITY);
|
||||||
_set_boolean_preference("roster.rooms", PREF_ROSTER_ROOMS);
|
_set_boolean_preference("roster.rooms", PREF_ROSTER_ROOMS);
|
||||||
|
_set_string_preference("roster.rooms.order", PREF_ROSTER_ROOMS_ORDER);
|
||||||
if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) {
|
if (g_key_file_has_key(theme, "ui", "roster.size", NULL)) {
|
||||||
gint roster_size = g_key_file_get_integer(theme, "ui", "roster.size", NULL);
|
gint roster_size = g_key_file_get_integer(theme, "ui", "roster.size", NULL);
|
||||||
prefs_set_roster_size(roster_size);
|
prefs_set_roster_size(roster_size);
|
||||||
@ -663,23 +672,25 @@ theme_attrs(theme_item_t attrs)
|
|||||||
case THEME_OTR_TRUSTED: result = COLOR_PAIR(43); break;
|
case THEME_OTR_TRUSTED: result = COLOR_PAIR(43); break;
|
||||||
case THEME_OTR_UNTRUSTED: result = COLOR_PAIR(44); break;
|
case THEME_OTR_UNTRUSTED: result = COLOR_PAIR(44); break;
|
||||||
case THEME_ROSTER_HEADER: result = COLOR_PAIR(45); break;
|
case THEME_ROSTER_HEADER: result = COLOR_PAIR(45); break;
|
||||||
case THEME_OCCUPANTS_HEADER: result = COLOR_PAIR(46); break;
|
case THEME_ROSTER_ROOM: result = COLOR_PAIR(46); break;
|
||||||
case THEME_WHITE: result = COLOR_PAIR(47); break;
|
case THEME_ROSTER_ROOM_UNREAD: result = COLOR_PAIR(47); break;
|
||||||
case THEME_WHITE_BOLD: result = COLOR_PAIR(47); break;
|
case THEME_OCCUPANTS_HEADER: result = COLOR_PAIR(48); break;
|
||||||
case THEME_GREEN: result = COLOR_PAIR(48); break;
|
case THEME_WHITE: result = COLOR_PAIR(49); break;
|
||||||
case THEME_GREEN_BOLD: result = COLOR_PAIR(48); break;
|
case THEME_WHITE_BOLD: result = COLOR_PAIR(49); break;
|
||||||
case THEME_RED: result = COLOR_PAIR(49); break;
|
case THEME_GREEN: result = COLOR_PAIR(50); break;
|
||||||
case THEME_RED_BOLD: result = COLOR_PAIR(49); break;
|
case THEME_GREEN_BOLD: result = COLOR_PAIR(50); break;
|
||||||
case THEME_YELLOW: result = COLOR_PAIR(50); break;
|
case THEME_RED: result = COLOR_PAIR(51); break;
|
||||||
case THEME_YELLOW_BOLD: result = COLOR_PAIR(50); break;
|
case THEME_RED_BOLD: result = COLOR_PAIR(51); break;
|
||||||
case THEME_BLUE: result = COLOR_PAIR(51); break;
|
case THEME_YELLOW: result = COLOR_PAIR(52); break;
|
||||||
case THEME_BLUE_BOLD: result = COLOR_PAIR(51); break;
|
case THEME_YELLOW_BOLD: result = COLOR_PAIR(52); break;
|
||||||
case THEME_CYAN: result = COLOR_PAIR(52); break;
|
case THEME_BLUE: result = COLOR_PAIR(53); break;
|
||||||
case THEME_CYAN_BOLD: result = COLOR_PAIR(52); break;
|
case THEME_BLUE_BOLD: result = COLOR_PAIR(53); break;
|
||||||
case THEME_BLACK: result = COLOR_PAIR(53); break;
|
case THEME_CYAN: result = COLOR_PAIR(54); break;
|
||||||
case THEME_BLACK_BOLD: result = COLOR_PAIR(53); break;
|
case THEME_CYAN_BOLD: result = COLOR_PAIR(54); break;
|
||||||
case THEME_MAGENTA: result = COLOR_PAIR(54); break;
|
case THEME_BLACK: result = COLOR_PAIR(55); break;
|
||||||
case THEME_MAGENTA_BOLD: result = COLOR_PAIR(54); break;
|
case THEME_BLACK_BOLD: result = COLOR_PAIR(55); break;
|
||||||
|
case THEME_MAGENTA: result = COLOR_PAIR(56); break;
|
||||||
|
case THEME_MAGENTA_BOLD: result = COLOR_PAIR(56); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,8 @@ typedef enum {
|
|||||||
THEME_OTR_UNTRUSTED,
|
THEME_OTR_UNTRUSTED,
|
||||||
THEME_OCCUPANTS_HEADER,
|
THEME_OCCUPANTS_HEADER,
|
||||||
THEME_ROSTER_HEADER,
|
THEME_ROSTER_HEADER,
|
||||||
|
THEME_ROSTER_ROOM,
|
||||||
|
THEME_ROSTER_ROOM_UNREAD,
|
||||||
THEME_RECEIPT_SENT,
|
THEME_RECEIPT_SENT,
|
||||||
THEME_NONE,
|
THEME_NONE,
|
||||||
THEME_WHITE,
|
THEME_WHITE,
|
||||||
|
@ -1337,6 +1337,10 @@ cons_roster_setting(void)
|
|||||||
cons_show("Roster order (/roster) : %s", order);
|
cons_show("Roster order (/roster) : %s", order);
|
||||||
prefs_free_string(order);
|
prefs_free_string(order);
|
||||||
|
|
||||||
|
char *rooms_order = prefs_get_string(PREF_ROSTER_ROOMS_ORDER);
|
||||||
|
cons_show("Roster rooms order (/roster) : %s", rooms_order);
|
||||||
|
prefs_free_string(rooms_order);
|
||||||
|
|
||||||
int size = prefs_get_roster_size();
|
int size = prefs_get_roster_size();
|
||||||
cons_show("Roster size (/roster) : %d", size);
|
cons_show("Roster size (/roster) : %d", size);
|
||||||
|
|
||||||
|
@ -373,8 +373,13 @@ void
|
|||||||
_rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin)
|
_rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin)
|
||||||
{
|
{
|
||||||
GString *msg = g_string_new(" ");
|
GString *msg = g_string_new(" ");
|
||||||
theme_item_t presence_colour = theme_main_presence_attrs("online");
|
|
||||||
wattron(layout->subwin, theme_attrs(presence_colour));
|
if (mucwin->unread > 0) {
|
||||||
|
wattron(layout->subwin, theme_attrs(THEME_ROSTER_ROOM_UNREAD));
|
||||||
|
} else {
|
||||||
|
wattron(layout->subwin, theme_attrs(THEME_ROSTER_ROOM));
|
||||||
|
}
|
||||||
|
|
||||||
int indent = prefs_get_roster_contact_indent();
|
int indent = prefs_get_roster_contact_indent();
|
||||||
int current_indent = 0;
|
int current_indent = 0;
|
||||||
if (indent > 0) {
|
if (indent > 0) {
|
||||||
@ -398,11 +403,22 @@ _rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin)
|
|||||||
gboolean wrap = prefs_get_boolean(PREF_ROSTER_WRAP);
|
gboolean wrap = prefs_get_boolean(PREF_ROSTER_WRAP);
|
||||||
win_sub_print(layout->subwin, msg->str, FALSE, wrap, current_indent);
|
win_sub_print(layout->subwin, msg->str, FALSE, wrap, current_indent);
|
||||||
g_string_free(msg, TRUE);
|
g_string_free(msg, TRUE);
|
||||||
wattroff(layout->subwin, theme_attrs(presence_colour));
|
|
||||||
|
if (mucwin->unread > 0) {
|
||||||
|
wattroff(layout->subwin, theme_attrs(THEME_ROSTER_ROOM_UNREAD));
|
||||||
|
} else {
|
||||||
|
wattroff(layout->subwin, theme_attrs(THEME_ROSTER_ROOM));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_compare_rooms(ProfMucWin *a, ProfMucWin *b)
|
_compare_rooms_name(ProfMucWin *a, ProfMucWin *b)
|
||||||
|
{
|
||||||
|
return g_strcmp0(a->roomjid, b->roomjid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_compare_rooms_unread(ProfMucWin *a, ProfMucWin *b)
|
||||||
{
|
{
|
||||||
if (a->unread > b->unread) {
|
if (a->unread > b->unread) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -422,7 +438,13 @@ _rosterwin_rooms(ProfLayoutSplit *layout, gboolean newline)
|
|||||||
while (curr_room) {
|
while (curr_room) {
|
||||||
ProfMucWin *mucwin = wins_get_muc(curr_room->data);
|
ProfMucWin *mucwin = wins_get_muc(curr_room->data);
|
||||||
if (mucwin) {
|
if (mucwin) {
|
||||||
rooms_sorted = g_list_insert_sorted(rooms_sorted, mucwin, (GCompareFunc)_compare_rooms);
|
char *order = prefs_get_string(PREF_ROSTER_ROOMS_ORDER);
|
||||||
|
if (g_strcmp0(order, "unread") == 0) {
|
||||||
|
rooms_sorted = g_list_insert_sorted(rooms_sorted, mucwin, (GCompareFunc)_compare_rooms_unread);
|
||||||
|
} else {
|
||||||
|
rooms_sorted = g_list_insert_sorted(rooms_sorted, mucwin, (GCompareFunc)_compare_rooms_name);
|
||||||
|
}
|
||||||
|
prefs_free_string(order);
|
||||||
}
|
}
|
||||||
curr_room = g_list_next(curr_room);
|
curr_room = g_list_next(curr_room);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,8 @@ roommention=
|
|||||||
me=
|
me=
|
||||||
them=
|
them=
|
||||||
roster.header=
|
roster.header=
|
||||||
|
roster.room=
|
||||||
|
roster.room.unread=
|
||||||
occupants.header=
|
occupants.header=
|
||||||
receipt.sent=
|
receipt.sent=
|
||||||
|
|
||||||
@ -90,6 +92,8 @@ roster.resource.join=
|
|||||||
roster.presence=
|
roster.presence=
|
||||||
roster.presence.indent=
|
roster.presence.indent=
|
||||||
roster.status=
|
roster.status=
|
||||||
|
roster.rooms=
|
||||||
|
roster.rooms.order=
|
||||||
occupants=
|
occupants=
|
||||||
occupants.size=
|
occupants.size=
|
||||||
occupants.jid=
|
occupants.jid=
|
||||||
|
@ -46,5 +46,7 @@ roommention=bold_blue
|
|||||||
me=cyan
|
me=cyan
|
||||||
them=white
|
them=white
|
||||||
roster.header=bold_white
|
roster.header=bold_white
|
||||||
|
roster.room=cyan
|
||||||
|
roster.room.unread=bold_cyan
|
||||||
occupants.header=bold_white
|
occupants.header=bold_white
|
||||||
receipt.sent=white
|
receipt.sent=white
|
||||||
|
@ -46,5 +46,7 @@ subscribed=magenta
|
|||||||
unsubscribed=black_bold
|
unsubscribed=black_bold
|
||||||
roommention=cyan
|
roommention=cyan
|
||||||
roster.header=yellow
|
roster.header=yellow
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=yellow
|
occupants.header=yellow
|
||||||
receipt.sent=red
|
receipt.sent=red
|
||||||
|
@ -46,6 +46,8 @@ roommention=bold_red
|
|||||||
me=blue
|
me=blue
|
||||||
them=bold_green
|
them=bold_green
|
||||||
roster.header=bold_yellow
|
roster.header=bold_yellow
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=bold_green
|
||||||
occupants.header=bold_yellow
|
occupants.header=bold_yellow
|
||||||
receipt.sent=bold_black
|
receipt.sent=bold_black
|
||||||
|
|
||||||
@ -90,6 +92,7 @@ roster.presence=true
|
|||||||
roster.presence.indent=-1
|
roster.presence.indent=-1
|
||||||
roster.status=true
|
roster.status=true
|
||||||
roster.rooms=true
|
roster.rooms=true
|
||||||
|
roster.rooms.order=name
|
||||||
occupants=true
|
occupants=true
|
||||||
occupants.size=15
|
occupants.size=15
|
||||||
occupants.jid=false
|
occupants.jid=false
|
||||||
|
@ -38,6 +38,7 @@ roster.presence=true
|
|||||||
roster.presence.indent=1
|
roster.presence.indent=1
|
||||||
roster.status=true
|
roster.status=true
|
||||||
roster.rooms=true
|
roster.rooms=true
|
||||||
|
roster.rooms.order=unread
|
||||||
privileges=true
|
privileges=true
|
||||||
presence=true
|
presence=true
|
||||||
intype=true
|
intype=true
|
||||||
|
@ -46,5 +46,7 @@ roommention=bold_cyan
|
|||||||
me=blue
|
me=blue
|
||||||
them=bold_blue
|
them=bold_blue
|
||||||
roster.header=bold_green
|
roster.header=bold_green
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=bold_green
|
||||||
occupants.header=bold_green
|
occupants.header=bold_green
|
||||||
receipt.sent=bold_black
|
receipt.sent=bold_black
|
||||||
|
@ -46,5 +46,7 @@ roommention=bold_green
|
|||||||
me=green
|
me=green
|
||||||
them=bold_green
|
them=bold_green
|
||||||
roster.header=bold_green
|
roster.header=bold_green
|
||||||
|
roster.room=green
|
||||||
|
roster.room=bold_green
|
||||||
occupants.header=bold_green
|
occupants.header=bold_green
|
||||||
receipt.sent=bold_black
|
receipt.sent=bold_black
|
||||||
|
@ -46,5 +46,7 @@ roommention=bold_green
|
|||||||
me=white
|
me=white
|
||||||
them=white
|
them=white
|
||||||
roster.header=bold_cyan
|
roster.header=bold_cyan
|
||||||
|
roster.room=red
|
||||||
|
roster.room.unread=bold_red
|
||||||
occupants.header=bold_cyan
|
occupants.header=bold_cyan
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=green
|
|||||||
me=magenta
|
me=magenta
|
||||||
them=green
|
them=green
|
||||||
roster.header=magenta
|
roster.header=magenta
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=magenta
|
occupants.header=magenta
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=white
|
|||||||
me=white
|
me=white
|
||||||
them=white
|
them=white
|
||||||
roster.header=white
|
roster.header=white
|
||||||
|
roster.room=white
|
||||||
|
roster.room.unread=white
|
||||||
occupants.header=white
|
occupants.header=white
|
||||||
receipt.sent=white
|
receipt.sent=white
|
@ -46,5 +46,7 @@ roommention=blue
|
|||||||
me=black
|
me=black
|
||||||
them=black
|
them=black
|
||||||
roster.header=black
|
roster.header=black
|
||||||
|
roster.room=blue
|
||||||
|
roster.room.unread=blue
|
||||||
occupants.header=black
|
occupants.header=black
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=yellow
|
|||||||
me=yellow
|
me=yellow
|
||||||
them=green
|
them=green
|
||||||
roster.header=yellow
|
roster.header=yellow
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=yellow
|
occupants.header=yellow
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=bold_yellow
|
|||||||
me=bold_yellow
|
me=bold_yellow
|
||||||
them=bold_green
|
them=bold_green
|
||||||
roster.header=bold_yellow
|
roster.header=bold_yellow
|
||||||
|
roster.room=bold_green
|
||||||
|
roster.room.unread=bold_green
|
||||||
occupants.header=bold_yellow
|
occupants.header=bold_yellow
|
||||||
receipt.sent=bold_red
|
receipt.sent=bold_red
|
||||||
|
@ -46,5 +46,7 @@ roommention=green
|
|||||||
me=bold_black
|
me=bold_black
|
||||||
them=magenta
|
them=magenta
|
||||||
roster.header=magenta
|
roster.header=magenta
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=magenta
|
occupants.header=magenta
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=red
|
|||||||
me=green
|
me=green
|
||||||
them=yellow
|
them=yellow
|
||||||
roster.header=white
|
roster.header=white
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=white
|
occupants.header=white
|
||||||
receipt.sent=red
|
receipt.sent=red
|
@ -46,5 +46,7 @@ roommention=yellow
|
|||||||
me=black
|
me=black
|
||||||
them=black
|
them=black
|
||||||
roster.header=black
|
roster.header=black
|
||||||
|
roster.room=green
|
||||||
|
roster.room.unread=green
|
||||||
occupants.header=black
|
occupants.header=black
|
||||||
receipt.sent=red
|
receipt.sent=red
|
||||||
|
Loading…
Reference in New Issue
Block a user