profanity-im / profanity

Ncurses based XMPP client
https://profanity-im.github.io/
Other
1.33k stars 188 forks source link

`/cmd list <muc>` doesn't list MUC adhoc commands #1949

Open squeaktoy opened 10 months ago

squeaktoy commented 10 months ago

Some MUCs have special adhoc commands, however while these commands do enter the _command_list_result_handler and win_handle_command_list functions, and they end up inside the cmds GSList object, somehow win_println refuses to print them to the console. I tried debugging it, but it didn't make sense to me. What I think might be happening is that if the node attribute is a URL or contains special characters like http://prosody.im/protocol/hats#add or p1:hats#list, Profanity won't print them for reasons I don't yet understand. As far as I can see, Profanity uses the node attribute inside the item element in the adhoc commands IQ stanza as the name for the command. For simple server commands, node might be ping, however for MUC commands it's often more complex like http://prosody.im/protocol/hats#add or p1:hats#list. While running /cmd exec http://prosody.im/protocol/hats#add <muc> does work, it's not listed in /cmd list <muc> which bothers me.

Expected Behavior

The /cmd list displays the commands regardless of the complex node attribute. Perhaps internally Profanity might simplify the commands to make them less of a hurdle to type out, or even tab completion?

Current Behavior

Profanity does not list the commands despite their existence as evidenced in /xmlconsole.

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a MUC on an ejabberd server.
  2. In room configuration, enable hats support.
  3. /cmd list <muc> where <muc> is your MUC.
  4. You won't see any commands.
  5. Check /xmlconsole and observe how the ejabberd server did actually supply valid commands.

Context

I want to make use of MUC adhoc commands, but this makes the process of finding them very cumbersome.

Environment

jubalh commented 10 months ago

In room configuration, enable hats support.

Could you tell me a public MUC which has this enabled?

squeaktoy commented 10 months ago

[Sporani.ca Project @.***?join) has a Giphy adhoc command.