Add /roster room use command

`/roster room use name` to use the name of the MUC in the roster list.
`/roster room use jid` to use the jid of the MUC in the roster list.

Display it only in case `/roster room by none` is set so far.
This commit is contained in:
Michael Vetter
2020-01-23 16:50:43 +01:00
parent 3066fd77fc
commit 9e35861001
6 changed files with 48 additions and 2 deletions

View File

@@ -775,13 +775,29 @@ _rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin)
jid_destroy(jidp);
} else {
gboolean show_server = prefs_get_boolean(PREF_ROSTER_ROOMS_SERVER);
char *use_as_name = prefs_get_string(PREF_ROSTER_ROOMS_USE_AS_NAME);
if (show_server) {
g_string_append(msg, mucwin->roomjid);
if (mucwin->room_name == NULL ||
(g_strcmp0(use_as_name, "jid") == 0)) {
g_string_append(msg, mucwin->roomjid);
} else {
g_string_append(msg, mucwin->room_name);
}
} else {
Jid *jidp = jid_create(mucwin->roomjid);
g_string_append(msg, jidp->localpart);
if (mucwin->room_name == NULL ||
(g_strcmp0(use_as_name, "jid") == 0)) {
g_string_append(msg, jidp->localpart);
} else {
g_string_append(msg, mucwin->room_name);
}
jid_destroy(jidp);
}
prefs_free_string(use_as_name);
}
prefs_free_string(roombypref);
if ((g_strcmp0(unreadpos, "after") == 0) && mucwin->unread > 0) {