mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Fixed /caps command for chat room participants
This commit is contained in:
parent
e8a450bc17
commit
f04ed28886
@ -1,5 +1,5 @@
|
|||||||
Generate own hash only once
|
Generate own hash only once
|
||||||
Handle legacy capabilities
|
Handle legacy capabilities
|
||||||
Merge caps and disco info commands, keep disco info
|
Move /caps command into /disco info
|
||||||
Use filesystem cache
|
Use filesystem cache
|
||||||
|
|
||||||
|
@ -1522,7 +1522,6 @@ cmd_caps(gchar **args, struct cmd_help_t help)
|
|||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
win_type_t win_type = ui_current_win_type();
|
win_type_t win_type = ui_current_win_type();
|
||||||
PContact pcontact = NULL;
|
PContact pcontact = NULL;
|
||||||
char *recipient;
|
|
||||||
|
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
cons_show("You are not currently connected.");
|
cons_show("You are not currently connected.");
|
||||||
@ -1533,11 +1532,13 @@ cmd_caps(gchar **args, struct cmd_help_t help)
|
|||||||
{
|
{
|
||||||
case WIN_MUC:
|
case WIN_MUC:
|
||||||
if (args[0] != NULL) {
|
if (args[0] != NULL) {
|
||||||
recipient = ui_current_recipient();
|
char *room = ui_current_recipient();
|
||||||
pcontact = muc_get_participant(recipient, args[0]);
|
pcontact = muc_get_participant(room, args[0]);
|
||||||
if (pcontact != NULL) {
|
if (pcontact != NULL) {
|
||||||
|
Jid *jidp = jid_create_from_bare_and_resource(room, args[0]);
|
||||||
Resource *resource = p_contact_get_resource(pcontact, 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 {
|
} else {
|
||||||
cons_show("No such participant \"%s\" in room.", args[0]);
|
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) {
|
if (args[0] != NULL) {
|
||||||
cons_show("No parameter needed to /caps when in private chat.");
|
cons_show("No parameter needed to /caps when in private chat.");
|
||||||
} else {
|
} else {
|
||||||
recipient = ui_current_recipient();
|
char *recipient = ui_current_recipient();
|
||||||
Jid *jid = jid_create(recipient);
|
Jid *jid = jid_create(recipient);
|
||||||
if (jid) {
|
if (jid) {
|
||||||
pcontact = muc_get_participant(jid->barejid, jid->resourcepart);
|
pcontact = muc_get_participant(jid->barejid, jid->resourcepart);
|
||||||
|
Loading…
Reference in New Issue
Block a user