ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
813 stars 1.49k forks source link

Jabber: don't send <{muc#user}x/> on message #5343

Open Ppjet6 opened 1 year ago

Ppjet6 commented 1 year ago

Summary

The jabber module includes an <x xmlns="http://jabber.org/protocol/muc#user"/> child in groupchat messages it sends when it's not necessary.

Issue Type

Bug Report

Component Name

jabber

Ansible Version

N/A

Community.general Version

496bf27

Configuration

No response

OS / Environment

No response

Steps to Reproduce

- name: Send a message to a room
  community.general.jabber:
    user: mybot@example.net
    password: secret
    to: mychaps@conference.example.net/ansiblebot
    msg: Ansible task finished

Expected Results

The specification says the only necessary steps to broadcast a message are to join the room and to send a message of type groupchat to the room JID. On may want to wait for the room to return confirmation that they're joined, but I guess this is an acceptable trade-off for a fire-and-forget action. It's also how many sendxmpp implementations work.

Actual Results

The jabber module includes an <x xmlns="http://jabber.org/protocol/muc#user"/> child in groupchat messages it sends when it's not necessary.

Fortunately, I doubt this has much negative impact as I would expect a room to strip this child element.

I was hesitant to submit a patch as I don't know why this has been added to the module. If it's a result of a bad deployment I would suggest fixing the deployment instead of introducing workarounds in code.

Code of Conduct

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 1 year ago

cc @bcoca click here for bot help

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help