Improve MUC title behaviour for roster, statusbar, and titlebar
## Abstract Continuation of https://github.com/profanity-im/profanity/pull/1881 Give all MUC title commands a consistent command structure and appearance. - `/roster room use name|jid` and `/roster room show|hide server` are now `/roster room title bookmark|jid|localpart|name` - `/statusbar room room|jid` is now `/statusbar room title bookmark|jid|localpart|name` - `/statusbar show|hide jid` and `/statusbar show|hide name` are now `/titlebar room title bookmark|jid|localpart|name` Fix both bugs mentioned in https://github.com/profanity-im/profanity/pull/1881 ### src/ui/mucwin.c:mucwin_generate_title Called by each command to generate a properly formatted title. It checks for "name" first because "name" is the default preference for each command. The last if-statement sets the title to "localpart" for special cases when the title should be "localpart" instead of the user-defined preference. ## Testing ### Preparation Remove preferences that will interfere with testing. ``` sed -i "/roster.rooms.title=/d" profrc sed -i "/statusbar.room.title=/d" profrc sed -i "/titlebar.muc.title=/d" profrc sed -i "/roster.rooms.use.name=/d" profrc sed -i "/roster.rooms.server=/d" profrc sed -i "/statusbar.room=/d" profrc sed -i "/titlebar.muc.title.jid=/d" profrc sed -i "/titlebar.muc.title.name=/d" profrc sed -i "/roster.rooms.by=/d" profrc ``` ### Command Definitions | Test | Window | | :--- | :--- | | `/help roster` | - /roster room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the roster title for MUCs.<br>- *No /roster show\|hide server*<br>- *No /roster room use jid\|name* | | `/help statusbar` | - /statusbar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the title for MUC tabs.<br>- *No /statusbar room jid\|room* | | `/help titlebar` | - /titlebar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the MUC window title.<br>- *No /titlebar show\|hide jid\|name* | ### Autocomplete | Test | Command line | | :--- | :--- | | `/roster room <TAB>` | Autocompletes `title` | | `/roster room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` | | `/statusbar room <TAB>` | Autocompletes `title` | | `/statusbar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` | | `/titlebar room <TAB>` | Autocompletes `title` | | `/titlebar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` | | `/roster room <TAB>` | Does not autocomplete `use`, `show`, or `hide` | | `/roster room use <TAB>` | Does not autocomplete `name` | | `/roster room show <TAB>` | Does not autocomplete `server` | | `/roster room hide <TAB>` | Does not autocomplete `server` | | `/statusbar room <TAB>` | Does not autocomplete `jid` or `room` | | `/titlebar show <TAB>` | Does not autocomplete `jid` or `name` | | `/titlebar hide <TAB>` | Does not autocomplete `jid` or `name` | ### Set Preferences | Test | Window | profrc | | :--- | :--- | :--- | | `/roster room title bookmark` | Roster MUCs will display 'bookmark' as their title. | roster.rooms.title=bookmark | | `/roster room title jid` | Roster MUCs will display 'jid' as their title. | roster.rooms.title=jid | | `/roster room title localpart` | Roster MUCs will display 'localpart' as their title. | roster.rooms.title=localpart | | `/roster room title name` | Roster MUCs will display 'name' as their title. | roster.rooms.title=name | | `/roster room title invalid` | Invalid usage, see '/help roster' for details. | | | `/statusbar room title bookmark` | Displaying 'bookmark' as the title for MUC tabs. | statusbar.room.title=bookmark | | `/statusbar room title jid` | Displaying 'jid' as the title for MUC tabs. | statusbar.room.title=jid | | `/statusbar room title localpart` | Displaying 'localpart' as the title for MUC tabs. | statusbar.room.title=localpart | | `/statusbar room title name` | Displaying 'name' as the title for MUC tabs. | statusbar.room.title=name | | `/statusbar room title invalid` | Invalid usage, see '/help statusbar' for details. | | | `/titlebar room title bookmark` | MUC windows will display 'bookmark' as the window title. | titlebar.muc.title=bookmark | | `/titlebar room title jid` | MUC windows will display 'jid' as the window title. | titlebar.muc.title=jid | | `/titlebar room title localpart` | MUC windows will display 'localpart' as the window title. | titlebar.muc.title=localpart | | `/titlebar room title name` | MUC windows will display 'name' as the window title. | titlebar.muc.title=name | | `/titlebar room title invalid` | Invalid usage, see '/help titlebar' for details. | | | `/roster room use jid` | Invalid usage, see '/help roster' for details. | | | `/roster room use name` | Invalid usage, see '/help roster' for details. | | | `/roster room show server` | Invalid usage, see '/help roster' for details. | | | `/roster room hide server` | Invalid usage, see '/help roster' for details. | | | `/statusbar room jid` | Invalid usage, see '/help statusbar' for details. | | | `/statusbar room room` | Invalid usage, see '/help statusbar' for details. | | | `/titlebar show jid` | Invalid usage, see '/help titlebar' for details. | | | `/titlebar hide jid` | Invalid usage, see '/help titlebar' for details. | | | `/titlebar show name` | Invalid usage, see '/help titlebar' for details. | | | `/titlebar hide name` | Invalid usage, see '/help titlebar' for details. | | ### Display Set Preferences | Test | Window | | :--- | :--- | | /prefs ui | - Roster rooms title (/roster) : name<br>- Room tab display (/statusbar) : name<br>- MUC window title (/titlebar) : name | ### Test MUC Window #### Test: without *name* preference, without *room name* field ``` /join muc@dmn.im /room config /field1 "" /form submit /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im | | `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config | | `/field2 edit` | | | muc<span/>@dmn.im config * | | `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst | | `/roster room by service` | muc | | | #### Test: with *name* preference, without *room name* field ``` /roster room title name /statusbar room title name /titlebar room title name /save /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im | | `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config | | `/field2 edit` | | | muc<span/>@dmn.im config * | | `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst | | `/roster room by service` | muc | | | #### Test: without *name* preference, with *room name* field ``` sed -i "/roster.rooms.title=/d" profrc sed -i "/statusbar.room.title=/d" profrc sed -i "/titlebar.muc.title=/d" profrc /join muc@dmn.im /room config /field1 "my_room" /form submit /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | my_room | my_room | my_room | | `/room config` | | my_room conf | my_room config | | `/field2 edit` | | | my_room config * | | `/msg tst` | tst | my_room/tst | my_room/tst | | `/roster room by service` | my_room | | | #### Test: with *name* preference, with *room name* field ``` /quit /roster room title name /statusbar room title name /titlebar room title name /save /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | my_room | my_room | my_room | | `/room config` | | my_room conf | my_room config | | `/field2 edit` | | | my_room config * | | `/msg tst` | tst | my_room/tst | my_room/tst | | `/roster room by service` | my_room | | | #### Test: with *localpart* preference ``` /quit /roster room title localpart /statusbar room title localpart /titlebar room title localpart /save /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | muc | muc | muc | | `/room config` | | muc conf | muc config | | `/field2 edit` | | | muc config * | | `/msg tst` | tst | muc/tst | muc/tst | | `/roster room by service` | muc | | | #### Test: with *bookmark* preference, without *bookmark name* ``` /quit /roster room title bookmark /statusbar room title bookmark /titlebar room title bookmark /save /quit /bookmark add muc@dmn.im ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/bookmark join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im | | `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config | | `/field2 edit` | | | muc<span/>@dmn.im config * | | `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst | | `/roster room by service` | muc | | | #### Test: with *bookmark* preference, with *bookmark name* ``` /quit /bookmark remove muc@dmn.im /bookmark add muc@dmn.im name "my_bookmark" ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/bookmark join muc@dmn.im` | my_bookmark | my_bookmark | my_bookmark | | `/room config` | | my_bookmark conf | my_bookmark config | | `/field2 edit` | | | my_bookmark config * | | `/msg tst` | tst | my_bookmark/tst | my_bookmark/tst | | `/roster room by service` | my_bookmark | | | #### Test: with *jid* preference ``` /quit /roster room title jid /statusbar room title jid /titlebar room title jid /save /quit ``` | Test | Roster | Statusbar | Titlebar | | :--- | :--- | :--- | :--- | | `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im | | `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config | | `/field2 edit` | | | muc<span/>@dmn.im config * | | `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst | | `/roster room by service` | muc | | | ### Test Contact Chat Window Title #### Test: without contact nick ``` /roster add tst@dmn.im ``` | Test | Titlebar | | :--- | :--- | | `/msg tst@dmn.im` | tst<span/>@dmn.im | #### Test: with contact nick ``` /roster add tst@dmn.im my_tst ``` | Test | Titlebar | | :--- | :--- | | `/msg my_tst` | my_tst <tst<span/>@ike.snikket.chat> | ### Test Preference Upgrade #### Test /roster | Test | profrc | | :--- | :--- | | `sed -i '/\[ui\]/a\roster.rooms.use.name=name' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\roster.rooms.use.name=' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc` | Original key removed.<br>roster.rooms.title=jid | | `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=false' profrc` | Original keys removed.<br>roster.rooms.title=localpart | | `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=true' profrc` | Original keys removed.<br>roster.rooms.title=jid | | `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original keys removed.<br>roster.rooms.title=jid | | `sed -i '/\[ui\]/a\statusbar.room=' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\statusbar.room=room' profrc` | Original key removed.<br>statusbar.room.title=localpart | | `sed -i '/\[ui\]/a\statusbar.room=jid' profrc` | Original key removed.<br>statusbar.room.title=jid | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.name=' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed.<br>titlebar.muc.title=jid | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. | | `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. | ### Test Valgrind No memory leaks detected relating to these changes.
This commit is contained in:
@@ -144,16 +144,6 @@ _prefs_load(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "titlebar.goodbye", NULL);
|
||||
}
|
||||
|
||||
// after 0.8.1: titlebar use jid|name -> titlebar show|hide jid|name
|
||||
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "titlebar.muc.title", NULL)) {
|
||||
auto_gchar gchar* value = g_key_file_get_string(prefs, PREF_GROUP_UI, "titlebar.muc.title", NULL);
|
||||
if (g_strcmp0(value, "name") == 0) {
|
||||
g_key_file_set_boolean(prefs, PREF_GROUP_UI, "titlebar.muc.title.name", TRUE);
|
||||
} else if (g_strcmp0(value, "jid") == 0) {
|
||||
g_key_file_set_boolean(prefs, PREF_GROUP_UI, "titlebar.muc.title.jid", TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
// 0.9.0 introduced /urlopen. It was saved under "logging" section. Now we have a new "executables" section.
|
||||
if (g_key_file_has_key(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL)) {
|
||||
auto_gchar gchar* val = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "urlopen.cmd", NULL);
|
||||
@@ -208,6 +198,50 @@ _prefs_load(void)
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_PLUGINS, "sourcepath", NULL);
|
||||
}
|
||||
|
||||
// after 0.14.0: "/roster room use name|jid" and "/roster room show|hide server"
|
||||
// became "/roster room title bookmark|jid|localpart|name".
|
||||
// The outer-most if-statement is not needed, but it is included for better performance.
|
||||
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "roster.rooms.use.name", NULL) || g_key_file_has_key(prefs, PREF_GROUP_UI, "roster.rooms.server", NULL)) {
|
||||
GError* err = NULL;
|
||||
auto_gchar gchar* pref_use_name = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.use.name", NULL);
|
||||
if (g_strcmp0(pref_use_name, "jid") == 0) {
|
||||
const gboolean pref_show_server = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "roster.rooms.server", &err);
|
||||
if (!pref_show_server && !err) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.title", "localpart");
|
||||
} else {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.title", "jid");
|
||||
}
|
||||
}
|
||||
g_clear_error(&err);
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.rooms.server", NULL);
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.rooms.use.name", NULL);
|
||||
}
|
||||
|
||||
// after 0.14.0: "/statusbar room room|jid" became "/statusbar room title bookmark|jid|localpart|name"
|
||||
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "statusbar.room", NULL)) {
|
||||
auto_gchar gchar* statusbar_room = g_key_file_get_string(prefs, PREF_GROUP_UI, "statusbar.room", NULL);
|
||||
if (g_strcmp0(statusbar_room, "room") == 0) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "statusbar.room.title", "localpart");
|
||||
} else if (g_strcmp0(statusbar_room, "jid") == 0) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "statusbar.room.title", "jid");
|
||||
}
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "statusbar.room", NULL);
|
||||
}
|
||||
|
||||
// after 0.14.0: "/statusbar show jid" and "/statusbar show name"
|
||||
// became "/titlebar room title bookmark|jid|localpart|name"
|
||||
// The outer-most if-statement is not needed, but it is included for better performance.
|
||||
if (g_key_file_has_key(prefs, PREF_GROUP_UI, "titlebar.muc.title.jid", NULL) || g_key_file_has_key(prefs, PREF_GROUP_UI, "titlebar.muc.title.name", NULL)) {
|
||||
GError* err = NULL;
|
||||
const gboolean pref_titlebar_muc_title_jid = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "titlebar.muc.title.jid", NULL);
|
||||
const gboolean pref_titlebar_muc_title_name = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "titlebar.muc.title.name", &err);
|
||||
if (pref_titlebar_muc_title_jid && !pref_titlebar_muc_title_name && !err) {
|
||||
g_key_file_set_string(prefs, PREF_GROUP_UI, "titlebar.muc.title", "jid");
|
||||
}
|
||||
g_clear_error(&err);
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "titlebar.muc.title.jid", NULL);
|
||||
g_key_file_remove_key(prefs, PREF_GROUP_UI, "titlebar.muc.title.name", NULL);
|
||||
}
|
||||
_save_prefs();
|
||||
|
||||
boolean_choice_ac = autocomplete_new();
|
||||
@@ -1731,8 +1765,7 @@ _get_group(preference_t pref)
|
||||
case PREF_ROSTER_ROOMS_BY:
|
||||
case PREF_ROSTER_ROOMS_ORDER:
|
||||
case PREF_ROSTER_ROOMS_UNREAD:
|
||||
case PREF_ROSTER_ROOMS_SERVER:
|
||||
case PREF_ROSTER_ROOMS_USE_AS_NAME:
|
||||
case PREF_ROSTER_ROOMS_TITLE:
|
||||
case PREF_ROSTER_PRIVATE:
|
||||
case PREF_RESOURCE_TITLE:
|
||||
case PREF_RESOURCE_MESSAGE:
|
||||
@@ -1751,10 +1784,9 @@ _get_group(preference_t pref)
|
||||
case PREF_STATUSBAR_SHOW_READ:
|
||||
case PREF_STATUSBAR_SELF:
|
||||
case PREF_STATUSBAR_CHAT:
|
||||
case PREF_STATUSBAR_ROOM:
|
||||
case PREF_STATUSBAR_ROOM_TITLE:
|
||||
case PREF_STATUSBAR_TABMODE:
|
||||
case PREF_TITLEBAR_MUC_TITLE_JID:
|
||||
case PREF_TITLEBAR_MUC_TITLE_NAME:
|
||||
case PREF_TITLEBAR_MUC_TITLE:
|
||||
case PREF_SLASH_GUARD:
|
||||
case PREF_COMPOSE_EDITOR:
|
||||
case PREF_OUTGOING_STAMP:
|
||||
@@ -2022,10 +2054,8 @@ _get_key(preference_t pref)
|
||||
return "roster.rooms.order";
|
||||
case PREF_ROSTER_ROOMS_UNREAD:
|
||||
return "roster.rooms.unread";
|
||||
case PREF_ROSTER_ROOMS_SERVER:
|
||||
return "roster.rooms.server";
|
||||
case PREF_ROSTER_ROOMS_USE_AS_NAME:
|
||||
return "roster.rooms.use.name";
|
||||
case PREF_ROSTER_ROOMS_TITLE:
|
||||
return "roster.rooms.title";
|
||||
case PREF_ROSTER_PRIVATE:
|
||||
return "roster.private";
|
||||
case PREF_RESOURCE_TITLE:
|
||||
@@ -2036,10 +2066,8 @@ _get_key(preference_t pref)
|
||||
return "inpblock.dynamic";
|
||||
case PREF_ENC_WARN:
|
||||
return "enc.warn";
|
||||
case PREF_TITLEBAR_MUC_TITLE_JID:
|
||||
return "titlebar.muc.title.jid";
|
||||
case PREF_TITLEBAR_MUC_TITLE_NAME:
|
||||
return "titlebar.muc.title.name";
|
||||
case PREF_TITLEBAR_MUC_TITLE:
|
||||
return "titlebar.muc.title";
|
||||
case PREF_PGP_LOG:
|
||||
return "log";
|
||||
case PREF_PGP_SENDFILE:
|
||||
@@ -2080,8 +2108,8 @@ _get_key(preference_t pref)
|
||||
return "statusbar.self";
|
||||
case PREF_STATUSBAR_CHAT:
|
||||
return "statusbar.chat";
|
||||
case PREF_STATUSBAR_ROOM:
|
||||
return "statusbar.room";
|
||||
case PREF_STATUSBAR_ROOM_TITLE:
|
||||
return "statusbar.room.title";
|
||||
case PREF_STATUSBAR_TABMODE:
|
||||
return "statusbar.tabmode";
|
||||
case PREF_OMEMO_LOG:
|
||||
@@ -2154,7 +2182,6 @@ _get_default_boolean(preference_t pref)
|
||||
case PREF_ROSTER_CONTACTS:
|
||||
case PREF_ROSTER_UNSUBSCRIBED:
|
||||
case PREF_ROSTER_ROOMS:
|
||||
case PREF_ROSTER_ROOMS_SERVER:
|
||||
case PREF_TLS_SHOW:
|
||||
case PREF_LASTACTIVITY:
|
||||
case PREF_TRAY_READ:
|
||||
@@ -2168,7 +2195,6 @@ _get_default_boolean(preference_t pref)
|
||||
case PREF_CARBONS:
|
||||
case PREF_STATES:
|
||||
case PREF_OUTTYPE:
|
||||
case PREF_TITLEBAR_MUC_TITLE_NAME:
|
||||
case PREF_COLOR_NICK_OWN:
|
||||
case PREF_INTYPE:
|
||||
case PREF_INTYPE_CONSOLE:
|
||||
@@ -2211,7 +2237,7 @@ _get_default_string(preference_t pref)
|
||||
case PREF_STATUSES_CHAT:
|
||||
case PREF_STATUSES_MUC:
|
||||
return "none";
|
||||
case PREF_ROSTER_ROOMS_USE_AS_NAME:
|
||||
case PREF_ROSTER_ROOMS_TITLE:
|
||||
return "name";
|
||||
case PREF_ROSTER_ROOMS_ORDER:
|
||||
return "name";
|
||||
@@ -2247,10 +2273,12 @@ _get_default_string(preference_t pref)
|
||||
return "fulljid";
|
||||
case PREF_STATUSBAR_CHAT:
|
||||
return "user";
|
||||
case PREF_STATUSBAR_ROOM:
|
||||
return "room";
|
||||
case PREF_STATUSBAR_ROOM_TITLE:
|
||||
return "name";
|
||||
case PREF_STATUSBAR_TABMODE:
|
||||
return "default";
|
||||
case PREF_TITLEBAR_MUC_TITLE:
|
||||
return "name";
|
||||
case PREF_OMEMO_LOG:
|
||||
return "on";
|
||||
case PREF_OMEMO_POLICY:
|
||||
|
||||
@@ -91,8 +91,7 @@ typedef enum {
|
||||
PREF_ROSTER_ROOMS_BY,
|
||||
PREF_ROSTER_ROOMS_ORDER,
|
||||
PREF_ROSTER_ROOMS_UNREAD,
|
||||
PREF_ROSTER_ROOMS_SERVER,
|
||||
PREF_ROSTER_ROOMS_USE_AS_NAME,
|
||||
PREF_ROSTER_ROOMS_TITLE,
|
||||
PREF_ROSTER_PRIVATE,
|
||||
PREF_MUC_PRIVILEGES,
|
||||
PREF_PRESENCE,
|
||||
@@ -144,8 +143,7 @@ typedef enum {
|
||||
PREF_RESOURCE_MESSAGE,
|
||||
PREF_INPBLOCK_DYNAMIC,
|
||||
PREF_ENC_WARN,
|
||||
PREF_TITLEBAR_MUC_TITLE_JID,
|
||||
PREF_TITLEBAR_MUC_TITLE_NAME,
|
||||
PREF_TITLEBAR_MUC_TITLE,
|
||||
PREF_PGP_LOG,
|
||||
PREF_PGP_SENDFILE,
|
||||
PREF_PGP_PUBKEY_AUTOIMPORT,
|
||||
@@ -166,7 +164,7 @@ typedef enum {
|
||||
PREF_STATUSBAR_SHOW_READ,
|
||||
PREF_STATUSBAR_SELF,
|
||||
PREF_STATUSBAR_CHAT,
|
||||
PREF_STATUSBAR_ROOM,
|
||||
PREF_STATUSBAR_ROOM_TITLE,
|
||||
PREF_OMEMO_LOG,
|
||||
PREF_OMEMO_POLICY,
|
||||
PREF_OMEMO_TRUST_MODE,
|
||||
|
||||
@@ -321,13 +321,10 @@ _load_preferences(void)
|
||||
_set_boolean_preference("roster.contacts", PREF_ROSTER_CONTACTS);
|
||||
_set_boolean_preference("roster.unsubscribed", PREF_ROSTER_UNSUBSCRIBED);
|
||||
_set_boolean_preference("roster.rooms", PREF_ROSTER_ROOMS);
|
||||
_set_boolean_preference("roster.rooms.server", PREF_ROSTER_ROOMS_SERVER);
|
||||
_set_boolean_preference("privileges", PREF_MUC_PRIVILEGES);
|
||||
_set_boolean_preference("presence", PREF_PRESENCE);
|
||||
_set_boolean_preference("intype", PREF_INTYPE);
|
||||
_set_boolean_preference("enc.warn", PREF_ENC_WARN);
|
||||
_set_boolean_preference("titlebar.muc.title.name", PREF_TITLEBAR_MUC_TITLE_NAME);
|
||||
_set_boolean_preference("titlebar.muc.title.jid", PREF_TITLEBAR_MUC_TITLE_JID);
|
||||
_set_boolean_preference("tls.show", PREF_TLS_SHOW);
|
||||
_set_boolean_preference("statusbar.show.name", PREF_STATUSBAR_SHOW_NAME);
|
||||
_set_boolean_preference("statusbar.show.number", PREF_STATUSBAR_SHOW_NUMBER);
|
||||
@@ -356,10 +353,11 @@ _load_preferences(void)
|
||||
_set_string_preference("roster.rooms.by", PREF_ROSTER_ROOMS_BY);
|
||||
_set_string_preference("roster.private", PREF_ROSTER_PRIVATE);
|
||||
_set_string_preference("roster.count", PREF_ROSTER_COUNT);
|
||||
_set_string_preference("roster.rooms.use.name", PREF_ROSTER_ROOMS_USE_AS_NAME);
|
||||
_set_string_preference("roster.rooms.title", PREF_ROSTER_ROOMS_TITLE);
|
||||
_set_string_preference("statusbar.self", PREF_STATUSBAR_SELF);
|
||||
_set_string_preference("statusbar.chat", PREF_STATUSBAR_CHAT);
|
||||
_set_string_preference("statusbar.room", PREF_STATUSBAR_ROOM);
|
||||
_set_string_preference("statusbar.room.title", PREF_STATUSBAR_ROOM_TITLE);
|
||||
_set_string_preference("titlebar.muc.title", PREF_TITLEBAR_MUC_TITLE);
|
||||
|
||||
// load ints from theme and set them to prefs
|
||||
// with custom set functions
|
||||
|
||||
Reference in New Issue
Block a user