about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO_CAPS2
-rw-r--r--src/command/commands.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/TODO_CAPS b/TODO_CAPS
index 05f0e1ab..ed9d37eb 100644
--- a/TODO_CAPS
+++ b/TODO_CAPS
@@ -1,5 +1,5 @@
 Generate own hash only once
 Handle legacy capabilities
-Merge caps and disco info commands, keep disco info
+Move /caps command into /disco info
 Use filesystem cache
 
diff --git a/src/command/commands.c b/src/command/commands.c
index 3be2b7eb..045ad00a 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -1522,7 +1522,6 @@ cmd_caps(gchar **args, struct cmd_help_t help)
     jabber_conn_status_t conn_status = jabber_get_connection_status();
     win_type_t win_type = ui_current_win_type();
     PContact pcontact = NULL;
-    char *recipient;
 
     if (conn_status != JABBER_CONNECTED) {
         cons_show("You are not currently connected.");
@@ -1533,11 +1532,13 @@ cmd_caps(gchar **args, struct cmd_help_t help)
     {
         case WIN_MUC:
             if (args[0] != NULL) {
-                recipient = ui_current_recipient();
-                pcontact = muc_get_participant(recipient, args[0]);
+                char *room = ui_current_recipient();
+                pcontact = muc_get_participant(room, args[0]);
                 if (pcontact != NULL) {
+                    Jid *jidp = jid_create_from_bare_and_resource(room, args[0]);
                     Resource *resource = p_contact_get_resource(pcontact, args[0]);
-                    cons_show_caps(args[0], resource);
+                    cons_show_caps(jidp->fulljid, resource);
+                    jid_destroy(jidp);
                 } else {
                     cons_show("No such participant \"%s\" in room.", args[0]);
                 }
@@ -1574,7 +1575,7 @@ cmd_caps(gchar **args, struct cmd_help_t help)
             if (args[0] != NULL) {
                 cons_show("No parameter needed to /caps when in private chat.");
             } else {
-                recipient = ui_current_recipient();
+                char *recipient = ui_current_recipient();
                 Jid *jid = jid_create(recipient);
                 if (jid) {
                     pcontact = muc_get_participant(jid->barejid, jid->resourcepart);