about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-21 23:05:27 +0100
committerJames Booth <boothj5@gmail.com>2014-09-21 23:05:27 +0100
commitf04ed288863effd1daa33bb70615ff095b1a60f8 (patch)
tree690b4e208dc73b14e8c80d9b0b4741c4fd4b669b /src
parente8a450bc177d989700f882cd7cce33c931f6d5cd (diff)
downloadprofani-tty-f04ed288863effd1daa33bb70615ff095b1a60f8.tar.gz
Fixed /caps command for chat room participants
Diffstat (limited to 'src')
-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);