Added roster rooms order preference

This commit is contained in:
James Booth
2016-01-09 22:21:09 +00:00
parent cd2458c019
commit de90243401
7 changed files with 74 additions and 1 deletions

View File

@@ -2184,6 +2184,31 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
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
} else if (strcmp(args[0], "add") == 0) {
if (conn_status != JABBER_CONNECTED) {