about summary refs log tree commit diff stats
path: root/src/command.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-11-28 01:36:04 +0000
committerJames Booth <boothj5@gmail.com>2012-11-28 01:36:04 +0000
commit0756a9cec61649a7294ebffe19c7f756d7dc5892 (patch)
treed45cf85589b90542f5241241caae0b99c13c3118 /src/command.c
parentb7a7be37e954ddf3759cd262d8aec94a99495477 (diff)
downloadprofani-tty-0756a9cec61649a7294ebffe19c7f756d7dc5892.tar.gz
Implemented "/sub sent" to show outstanding sent subscription requests
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c
index 39f6beae..590abed0 100644
--- a/src/command.c
+++ b/src/command.c
@@ -991,7 +991,20 @@ _cmd_sub(gchar **args, struct cmd_help_t help)
     }
 
     if (strcmp(subcmd, "sent") == 0) {
-        cons_show("No pending requests sent.");
+        if (contact_list_has_pending_subscriptions()) {
+            cons_show("Awaiting subscription responses from:");
+            GSList *contacts = get_contact_list();
+            while (contacts != NULL) {
+                PContact contact = (PContact) contacts->data;
+                if (p_contact_pending_out(contact)) {
+                    cons_show(p_contact_jid(contact));
+                }
+                contacts = g_slist_next(contacts);
+            }
+        } else {
+            cons_show("No pending requests sent.");
+        }
+
         return TRUE;
     }
 
@@ -1001,7 +1014,7 @@ _cmd_sub(gchar **args, struct cmd_help_t help)
         if (received == NULL) {
             cons_show("No outstanding subscription requests.");
         } else {
-            cons_show("%d outstanding subscription requests from:",
+            cons_show("Outstanding subscription requests from:",
                 g_list_length(received));
             while (received != NULL) {
                 cons_show(received->data);