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:
@@ -4661,9 +4661,18 @@ cmd_bookmark(ProfWin* window, const char* const command, gchar** args)
|
||||
}
|
||||
|
||||
if (strcmp(cmd, "list") == 0) {
|
||||
GList* bookmarks = bookmark_get_list();
|
||||
cons_show_bookmarks(bookmarks);
|
||||
g_list_free(bookmarks);
|
||||
char* bookmark_jid = args[1];
|
||||
if (bookmark_jid == NULL) {
|
||||
// list all bookmarks
|
||||
GList* bookmarks = bookmark_get_list();
|
||||
cons_show_bookmarks(bookmarks);
|
||||
g_list_free(bookmarks);
|
||||
} else {
|
||||
// list one bookmark
|
||||
Bookmark *bookmark = bookmark_get_by_jid(bookmark_jid);
|
||||
cons_show_bookmark(bookmark);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user