Beispiel #1
0
        /// <summary>
        /// Sends a message stanza to the server.
        /// </summary>
        /// <param name="xmpp">XMPP connection to use</param>
        /// <param name="to">JID of the intended recipient</param>
        /// <param name="body">Human-readable textual contents of the message</param>
        public static void SendMessage(this XmppConnection xmpp, string to, string body)
        {
            Encode(ref to, ref body);

            xmpp.SendCustom($@"
                <message type='chat' to='{to}'>
                    <body>{body}</body>
                </message>
            ");
        }
Beispiel #2
0
 /// <summary>
 /// Sends an empty presence stanza.
 /// </summary>
 /// <param name="xmpp">XMPP connection to use</param>
 public static void SendPresence(this XmppConnection xmpp) => xmpp.SendCustom("<presence />");