community.general icon indicating copy to clipboard operation
community.general copied to clipboard

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

Open Ppjet6 opened this issue 2 years ago • 2 comments

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: [email protected]
    password: secret
    to: [email protected]/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

  • [X] I agree to follow the Ansible Code of Conduct

Ppjet6 avatar Oct 09 '22 14:10 Ppjet6

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 avatar Oct 09 '22 14:10 ansibullbot

cc @bcoca click here for bot help

ansibullbot avatar Oct 09 '22 14:10 ansibullbot

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 avatar Nov 10 '22 14:11 ansibullbot