about summary refs log tree commit diff stats
path: root/src/ui/console.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-09 16:19:45 +0200
committerGitHub <noreply@github.com>2021-06-09 16:19:45 +0200
commit343d970e3da319afe4109ad1c9d664ffe09dedfa (patch)
tree4bdebbc7cd297460d76603667b90a5993b7ad46b /src/ui/console.c
parentd7adec69cefedce8949ead1309e9a8e56a8c4d8f (diff)
parent8ef35290bdde58c6a0e7231c1870152f946d78e0 (diff)
downloadprofani-tty-343d970e3da319afe4109ad1c9d664ffe09dedfa.tar.gz
Merge pull request #1559 from profanity-im/feature/1558-bookmark
Add command to show single bookmark details
Diffstat (limited to 'src/ui/console.c')
-rw-r--r--src/ui/console.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 74a7740f..4494bce0 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -745,6 +745,34 @@ cons_show_bookmarks(const GList* list)
 }
 
 void
+cons_show_bookmark(Bookmark* item)
+{
+    cons_show("");
+    if (!item) {
+        cons_show("No such bookmark");
+    } else {
+        cons_show("Bookmark details:");
+        cons_show("Room jid           : %s", item->barejid);
+        if (item->name) {
+            cons_show("name               : %s", item->name);
+        }
+        if (item->nick) {
+            cons_show("nick               : %s", item->nick);
+        }
+        if (item->password) {
+            cons_show("password           : %s", item->password);
+        }
+        if (item->autojoin) {
+            cons_show("autojoin           : ON");
+        } else {
+            cons_show("autojoin           : OFF");
+        }
+    }
+
+    cons_alert(NULL);
+}
+
+void
 cons_show_disco_info(const char* jid, GSList* identities, GSList* features)
 {
     if ((identities && (g_slist_length(identities) > 0)) || (features && (g_slist_length(features) > 0))) {