LiveCodingChat.Xmpp.XmppTest.Send C# (CSharp) Method

Send() public method

public Send ( string xml, string type = null, string id = null, XMPPMessage del = null ) : void
xml string
type string
id string
del XMPPMessage
return void
        public void Send(string xml,string type=null,string id=null,XMPPMessage del=null)
        {
            if (type != null && del != null) {
                if (type == "iq") {
                    iqMethods.Add (id, del);
                }
            }
            Console.ForegroundColor = ConsoleColor.Red;
            //Console.WriteLine (xml);//TODO:
            Console.ForegroundColor = ConsoleColor.White;
            socket.Send (xml);
        }

Usage Example

Beispiel #1
0
        public void JoinRoom()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<presence to='" + ID + "@chat.livecoding.tv/" + xmpp.Nick + "' id='pres:" + xmpp.IDManager.SendPresenceId().ToString() + "' xmlns='jabber:client'>");
            sb.Append(" <x xmlns='http://jabber.org/protocol/muc'/>");
            sb.Append(" <c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://candy-chat.github.io/candy/' ver='kR9jljQwQFoklIvoOmy/GAli0gA='/>");
            sb.Append("</presence>");

            xmpp.Send(sb.ToString());
        }