about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-04-21 01:00:03 +0100
committerJames Booth <boothj5@gmail.com>2013-04-21 01:00:03 +0100
commitd7cc54db6302155fe7e1670b510496f8db40c9ac (patch)
treee12e5eb67a0cc513c69dcf130871a8179586509c /src/ui
parentd6c2bd0c6afbfc2e050a11b95a1d36f88a590188 (diff)
downloadprofani-tty-d7cc54db6302155fe7e1670b510496f8db40c9ac.tar.gz
Moved cons_show_disco_info() and cons_show_disco_items() to console
module
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c71
-rw-r--r--src/ui/windows.c62
2 files changed, 71 insertions, 62 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index d9f42e89..41b189c2 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -513,6 +513,77 @@ cons_show_room_list(GSList *rooms, const char * const conference_node)
     }
 }
 
+void
+cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
+{
+    if (((identities != NULL) && (g_slist_length(identities) > 0)) ||
+        ((features != NULL) && (g_slist_length(features) > 0))) {
+        cons_show("");
+        cons_show("Service disovery info for %s", jid);
+
+        if (identities != NULL) {
+            cons_show("  Identities");
+        }
+        while (identities != NULL) {
+            DiscoIdentity *identity = identities->data;  // anme trpe, cat
+            GString *identity_str = g_string_new("    ");
+            if (identity->name != NULL) {
+                identity_str = g_string_append(identity_str, strdup(identity->name));
+                identity_str = g_string_append(identity_str, " ");
+            }
+            if (identity->type != NULL) {
+                identity_str = g_string_append(identity_str, strdup(identity->type));
+                identity_str = g_string_append(identity_str, " ");
+            }
+            if (identity->category != NULL) {
+                identity_str = g_string_append(identity_str, strdup(identity->category));
+            }
+            cons_show(identity_str->str);
+            g_string_free(identity_str, FALSE);
+            identities = g_slist_next(identities);
+        }
+
+        if (features != NULL) {
+            cons_show("  Features:");
+        }
+        while (features != NULL) {
+            cons_show("    %s", features->data);
+            features = g_slist_next(features);
+        }
+
+        dirty = TRUE;
+        if (!win_current_is_console()) {
+            status_bar_new(0);
+        }
+    }
+}
+
+void
+cons_show_disco_items(GSList *items, const char * const jid)
+{
+    if ((items != NULL) && (g_slist_length(items) > 0)) {
+        cons_show("");
+        cons_show("Service discovery items for %s:", jid);
+        while (items != NULL) {
+            DiscoItem *item = items->data;
+            window_show_time(console, '-');
+            wprintw(console->win, "  %s", item->jid);
+            if (item->name != NULL) {
+                wprintw(console->win, ", (%s)", item->name);
+            }
+            wprintw(console->win, "\n");
+            items = g_slist_next(items);
+        }
+    } else {
+        cons_show("");
+        cons_show("No service discovery items for %s", jid);
+    }
+    dirty = TRUE;
+    if (!win_current_is_console()) {
+        status_bar_new(0);
+    }
+}
+
 static void
 _cons_splash_logo(void)
 {
diff --git a/src/ui/windows.c b/src/ui/windows.c
index 66da6316..c8252efa 100644
--- a/src/ui/windows.c
+++ b/src/ui/windows.c
@@ -1107,68 +1107,6 @@ win_show_room_broadcast(const char * const room_jid, const char * const message)
 }
 
 void
-cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
-{
-    if (((identities != NULL) && (g_slist_length(identities) > 0)) ||
-        ((features != NULL) && (g_slist_length(features) > 0))) {
-        cons_show("");
-        cons_show("Service disovery info for %s", jid);
-
-        if (identities != NULL) {
-            cons_show("  Identities");
-        }
-        while (identities != NULL) {
-            DiscoIdentity *identity = identities->data;  // anme trpe, cat
-            GString *identity_str = g_string_new("    ");
-            if (identity->name != NULL) {
-                identity_str = g_string_append(identity_str, strdup(identity->name));
-                identity_str = g_string_append(identity_str, " ");
-            }
-            if (identity->type != NULL) {
-                identity_str = g_string_append(identity_str, strdup(identity->type));
-                identity_str = g_string_append(identity_str, " ");
-            }
-            if (identity->category != NULL) {
-                identity_str = g_string_append(identity_str, strdup(identity->category));
-            }
-            cons_show(identity_str->str);
-            g_string_free(identity_str, FALSE);
-            identities = g_slist_next(identities);
-        }
-
-        if (features != NULL) {
-            cons_show("  Features:");
-        }
-        while (features != NULL) {
-            cons_show("    %s", features->data);
-            features = g_slist_next(features);
-        }
-    }
-}
-
-void
-cons_show_disco_items(GSList *items, const char * const jid)
-{
-    if ((items != NULL) && (g_slist_length(items) > 0)) {
-        cons_show("");
-        cons_show("Service discovery items for %s:", jid);
-        while (items != NULL) {
-            DiscoItem *item = items->data;
-            window_show_time(console, '-');
-            wprintw(console->win, "  %s", item->jid);
-            if (item->name != NULL) {
-                wprintw(console->win, ", (%s)", item->name);
-            }
-            wprintw(console->win, "\n");
-            items = g_slist_next(items);
-        }
-    } else {
-        cons_show("");
-        cons_show("No service discovery items for %s", jid);
-    }
-}
-
-void
 cons_show_status(const char * const contact)
 {
     PContact pcontact = contact_list_get_contact(contact);