about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-05-11 19:49:18 +0100
committerJames Booth <boothj5@gmail.com>2014-05-11 19:49:18 +0100
commitfc3046782a7fe82398c51ae6c8a3f60b85175342 (patch)
tree1b057d2b3d4c560dc0d0165424abc20186b7d232 /src/ui
parent9dda7036a9410a6d2124d3eb6c34eefb7a39a13a (diff)
downloadprofani-tty-fc3046782a7fe82398c51ae6c8a3f60b85175342.tar.gz
Added OTR preferences to /account show commmand
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c68
1 files changed, 53 insertions, 15 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index d9caf47f..064f4b71 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -862,39 +862,77 @@ _cons_show_account(ProfAccount *account)
     cons_show("");
     cons_show("Account %s:", account->name);
     if (account->enabled) {
-        cons_show   ("enabled        : TRUE");
+        cons_show   ("enabled           : TRUE");
     } else {
-        cons_show   ("enabled        : FALSE");
+        cons_show   ("enabled           : FALSE");
     }
-    cons_show       ("jid            : %s", account->jid);
+    cons_show       ("jid               : %s", account->jid);
     if (account->password != NULL) {
-        cons_show       ("password       : [redacted]");
+        cons_show   ("password          : [redacted]");
     }
     if (account->resource != NULL) {
-        cons_show   ("resource       : %s", account->resource);
+        cons_show   ("resource          : %s", account->resource);
     }
     if (account->server != NULL) {
-        cons_show   ("server         : %s", account->server);
+        cons_show   ("server            : %s", account->server);
     }
     if (account->port != 0) {
-        cons_show   ("port           : %d", account->port);
+        cons_show   ("port              : %d", account->port);
     }
     if (account->muc_service != NULL) {
-        cons_show   ("muc service    : %s", account->muc_service);
+        cons_show   ("muc service       : %s", account->muc_service);
     }
     if (account->muc_nick != NULL) {
-        cons_show   ("muc nick       : %s", account->muc_nick);
-    }
-    if (account->otr_policy != NULL) {
-        cons_show   ("OTR policy     : %s", account->otr_policy);
+        cons_show   ("muc nick          : %s", account->muc_nick);
     }
     if (account->last_presence != NULL) {
-        cons_show   ("Last presence  : %s", account->last_presence);
+        cons_show   ("Last presence     : %s", account->last_presence);
     }
     if (account->login_presence != NULL) {
-        cons_show   ("Login presence : %s", account->login_presence);
+        cons_show   ("Login presence    : %s", account->login_presence);
+    }
+
+    if (account->otr_policy != NULL) {
+        cons_show   ("OTR policy        : %s", account->otr_policy);
+    }
+    if (g_list_length(account->otr_manual) > 0) {
+        GString *manual = g_string_new("OTR manual        : ");
+        GList *curr = account->otr_manual;
+        while (curr != NULL) {
+            g_string_append(manual, curr->data);
+            if (curr->next != NULL) {
+                g_string_append(manual, ", ");
+            }
+            curr = curr->next;
+        }
+        cons_show(manual->str);
+    }
+    if (g_list_length(account->otr_opportunistic) > 0) {
+        GString *opportunistic = g_string_new("OTR opportunistic : ");
+        GList *curr = account->otr_opportunistic;
+        while (curr != NULL) {
+            g_string_append(opportunistic, curr->data);
+            if (curr->next != NULL) {
+                g_string_append(opportunistic, ", ");
+            }
+            curr = curr->next;
+        }
+        cons_show(opportunistic->str);
+    }
+    if (g_list_length(account->otr_always) > 0) {
+        GString *always = g_string_new("OTR always        : ");
+        GList *curr = account->otr_always;
+        while (curr != NULL) {
+            g_string_append(always, curr->data);
+            if (curr->next != NULL) {
+                g_string_append(always, ", ");
+            }
+            curr = curr->next;
+        }
+        cons_show(always->str);
     }
-    cons_show       ("Priority       : chat:%d, online:%d, away:%d, xa:%d, dnd:%d",
+
+    cons_show       ("Priority          : chat:%d, online:%d, away:%d, xa:%d, dnd:%d",
         account->priority_chat, account->priority_online, account->priority_away,
         account->priority_xa, account->priority_dnd);
 
ess?h=hlt&id=fe67d47aa4598497e295510cf27f702a3e118632'>^
986eebff ^























3ba63579 ^


986eebff ^


















5e938dc1 ^
3c435756 ^
de63f02e ^
5e938dc1 ^





6f5d7864 ^
5e938dc1 ^





3ba63579 ^
5e938dc1 ^

3ba63579 ^
5e938dc1 ^




3ba63579 ^
5e938dc1 ^








124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175