about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-30 10:42:36 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-06-30 10:45:59 +0200
commitef96bea82e945d2c00426cac21b6578fdce62eb2 (patch)
treeac1223e030696800020fc2ed91785f439144e200 /src/ui
parent2f5aa124cacae454e4b49c2ecbc7ca72bdf63d1c (diff)
downloadprofani-tty-ef96bea82e945d2c00426cac21b6578fdce62eb2.tar.gz
XEP-0157: Print contact addresses
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c14
-rw-r--r--src/ui/ui.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index ad13f0cc..f3993424 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -837,6 +837,20 @@ cons_show_disco_items(GSList* items, const char* const jid)
     cons_alert(NULL);
 }
 
+static void _cons_print_contact_information_item(gpointer key, gpointer value, gpointer userdata)
+{
+    cons_show("%s: %s", (char*)key, (char*)value);
+}
+
+void
+cons_show_disco_contact_information(GHashTable* addresses)
+{
+    cons_show("");
+    cons_show("Server contact information:");
+
+    g_hash_table_foreach(addresses, _cons_print_contact_information_item, NULL);
+}
+
 void
 cons_show_status(const char* const barejid)
 {
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 0c58b09c..441c9adf 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -276,6 +276,7 @@ void cons_show_bookmarks(const GList* list);
 void cons_show_bookmarks_ignore(gchar** list, gsize len);
 void cons_show_disco_items(GSList* items, const char* const jid);
 void cons_show_disco_info(const char* from, GSList* identities, GSList* features);
+void cons_show_disco_contact_information(GHashTable* addresses);
 void cons_show_room_invite(const char* const invitor, const char* const room, const char* const reason);
 void cons_check_version(gboolean not_available_msg);
 void cons_show_typing(const char* const barejid);