HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/xmpp.cpython-310.pyc
o

�N�gL
�@s"dZdd�Zdd�Zddd�ZdS)	ax
Sending Messages over XMPP
==========================

.. versionadded:: 2014.1.0

This state is useful for firing messages during state runs, using the XMPP
protocol

.. code-block:: yaml

    server-warning-message:
      xmpp.send_msg:
        - name: 'This is a server warning message'
        - profile: my-xmpp-account
        - recipient: admins@xmpp.example.com/salt
cCsdtvrdSdS)z?
    Only load if the XMPP module is available in __salt__
    z
xmpp.send_msgZxmpp)Fzxmpp module could not be loaded)�__salt__�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/xmpp.py�__virtual__srcCs^|iddd�}tdrd�||�|d<|Std||g|d�d	|d
<d|�d|��|d<|S)
aG
    Send a message to an XMPP user

    .. code-block:: yaml

        server-warning-message:
          xmpp.send_msg:
            - name: 'This is a server warning message'
            - profile: my-xmpp-account
            - recipient: admins@xmpp.example.com/salt

    name
        The message to send to the XMPP user
    N���nameZchanges�result�comment�testzNeed to send message to {}: {}r	�xmpp.send_msg_multi)�message�
recipients�profileTrzSent message to z: )�__opts__�formatr)rZ	recipientr�retrrr�send_msgs��rNcCs�|iddd�}|dur|durd|d<|Sd}|r |d|��7}|r)|d|��7}|d|��7}td	r<d
||d<|Std||||d�d
|d<d||d<|S)a�
    Send a message to an list of recipients or rooms

    .. code-block:: yaml

        server-warning-message:
          xmpp.send_msg:
            - name: 'This is a server warning message'
            - profile: my-xmpp-account
            - recipients:
              - admins@xmpp.example.com/salt
            - rooms:
              - qa@conference.xmpp.example.com

    name
        The message to send to the XMPP user
    Nrrz/Recipients and rooms are empty, no need to sendr	z users z rooms z, message: r
zNeed to sendr)rr
�roomsrTrzSent message to)rr)rrr
rrr	rrr�send_msg_multi=s,�r)NN)�__doc__rrrrrrr�<module>s