profanity icon indicating copy to clipboard operation
profanity copied to clipboard

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

Open squeaktoy opened this issue 2 years ago • 2 comments

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

  • List the command anyway.
  • Simplify it to be easy to type.
  • Provide a menu to execute the commands in a GUI-way just like clients such as Gajim, Psi+, or Cheogram do it.

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

  • Profanity, version 0.14.0dev.master.609fde09
  • Gentoo
  • dev-libs/glib-2.78.3::gentoo

squeaktoy avatar Jan 18 '24 21:01 squeaktoy

In room configuration, enable hats support.

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

jubalh avatar Jan 22 '24 08:01 jubalh

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

squeaktoy avatar Jan 23 '24 09:01 squeaktoy