diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-06-30 11:48:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 11:48:50 +0200 |
commit | f30a9e125649b4a7623845d520bdb40ef39dfd8f (patch) | |
tree | bb3bb408aa10edb2bf1d5970f36d907b35a2f28d /src/ui/console.c | |
parent | 3c648ee2f5715998e440c316ea9eadfd8205463c (diff) | |
parent | 3d5e59895b05ed611860aa55569ecfa893b73d64 (diff) | |
download | profani-tty-f30a9e125649b4a7623845d520bdb40ef39dfd8f.tar.gz |
Merge pull request #1567 from profanity-im/feature/1524-contact
Add support for XEP-0157 server contact information discovery
Diffstat (limited to 'src/ui/console.c')
-rw-r--r-- | src/ui/console.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index ad13f0cc..a99769b1 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -837,6 +837,26 @@ cons_show_disco_items(GSList* items, const char* const jid) cons_alert(NULL); } +static void _cons_print_contact_information_item(gpointer data, gpointer user_data) +{ + cons_show(" %s", (char*)data); +} + +static void _cons_print_contact_information_hashlist_item(gpointer key, gpointer value, gpointer userdata) +{ + cons_show(" %s:", (char*)key); + g_slist_foreach((GSList*)value, _cons_print_contact_information_item, NULL); +} + +void +cons_show_disco_contact_information(GHashTable* addresses) +{ + cons_show(""); + cons_show("Server contact information:"); + + g_hash_table_foreach(addresses, _cons_print_contact_information_hashlist_item, NULL); +} + void cons_show_status(const char* const barejid) { |