about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c11
1 files changed, 6 insertions, 5 deletions
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);