about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/preferences.c32
-rw-r--r--src/config/preferences.h3
-rw-r--r--src/config/theme.c10
3 files changed, 43 insertions, 2 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 8a15cccd..0a2ae3cc 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -784,8 +784,6 @@ prefs_clear_roster_private_char(void)
     _save_prefs();
 }
 
-
-
 char
 prefs_get_roster_room_char(void)
 {
@@ -820,9 +818,39 @@ prefs_clear_roster_room_char(void)
     _save_prefs();
 }
 
+char
+prefs_get_roster_room_private_char(void)
+{
+    char result = 0;
+
+    char *resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", NULL);
+    if (!resultstr) {
+        result =  0;
+    } else {
+        result = resultstr[0];
+    }
+    free(resultstr);
+
+    return result;
+}
 
+void
+prefs_set_roster_room_private_char(char ch)
+{
+    char str[2];
+    str[0] = ch;
+    str[1] = '\0';
 
+    g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.private.char", str);
+    _save_prefs();
+}
 
+void
+prefs_clear_roster_room_private_char(void)
+{
+    g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.rooms.pruvate.char", NULL);
+    _save_prefs();
+}
 
 gint
 prefs_get_roster_contact_indent(void)
diff --git a/src/config/preferences.h b/src/config/preferences.h
index 32a924ba..ff8b687d 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -199,6 +199,9 @@ void prefs_clear_roster_private_char(void);
 char prefs_get_roster_room_char(void);
 void prefs_set_roster_room_char(char ch);
 void prefs_clear_roster_room_char(void);
+char prefs_get_roster_room_private_char(void);
+void prefs_set_roster_room_private_char(char ch);
+void prefs_clear_roster_room_private_char(void);
 
 gint prefs_get_roster_contact_indent(void);
 void prefs_set_roster_contact_indent(gint value);
diff --git a/src/config/theme.c b/src/config/theme.c
index b886f9e2..40bf3539 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -470,6 +470,16 @@ _load_preferences(void)
         prefs_clear_roster_room_char();
     }
 
+    if (g_key_file_has_key(theme, "ui", "roster.rooms.private.char", NULL)) {
+        gchar *ch = g_key_file_get_string(theme, "ui", "roster.rooms.private.char", NULL);
+        if (ch && strlen(ch) > 0) {
+            prefs_set_roster_room_private_char(ch[0]);
+            g_free(ch);
+        }
+    } else {
+        prefs_clear_roster_room_private_char();
+    }
+
     if (g_key_file_has_key(theme, "ui", "roster.private.char", NULL)) {
         gchar *ch = g_key_file_get_string(theme, "ui", "roster.private.char", NULL);
         if (ch && strlen(ch) > 0) {
<boothj5@gmail.com> 2015-10-25 22:32:46 +0000 Applied coding style to src/event/' href='/danisanti/profani-tty/commit/src/event/server_events.h?id=afbd2693cd966525b1a0625540b208a33d44b40e'>afbd2693 ^
56697996 ^

afbd2693 ^








8aba52f4 ^
afbd2693 ^


74151e64 ^
87cdbe01 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92