Add command to show single bookmark details

`/bookmark list` lists all bookmarks with its details.
`/bookmark list <jid>` shows the details of a single bookmark.

Implement https://github.com/profanity-im/profanity/issues/1558
This commit is contained in:
Michael Vetter
2021-06-09 15:45:09 +02:00
parent d7adec69ce
commit 8ef35290bd
9 changed files with 68 additions and 5 deletions

View File

@@ -744,6 +744,34 @@ cons_show_bookmarks(const GList* list)
cons_alert(NULL);
}
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)
{