private string sendMessage(string text) { //if (checkBox1.Checked) { // otr_ses.EncryptMessage(this.otherEnd.ToString(), text); //} else { var msg = new agsXMPP.protocol.client.Message(this.otherEnd.Bare, Program.Jabber.conn.MyJID, agsXMPP.protocol.client.MessageType.chat, text); msg.Id = Guid.NewGuid().ToString(); msg.Chatstate = agsXMPP.protocol.extensions.chatstates.Chatstate.active; Program.Jabber.conn.Send(msg); //} Program.db.InsertMessage(room.RoomName, msg.Id, msg.From, msg.Body, ChatDatabase.GetNowString()); messageView1.addMessageToView(msg.From, msg.Body, DateTime.Now, null, msg.From, msg.Id); return(msg.Id); }
public static string GetMessageDt(Message message) { string dt; agsXMPP.Xml.Dom.Element el; if (message.HasTag("delay")) { dt = message.SelectSingleElement("delay").GetAttribute("stamp"); } else if (null != (el = message.SelectSingleElement("x", "jabber:x:tstamp"))) { dt = el.GetAttribute("tstamp"); } else { dt = ChatDatabase.GetNowString(); } return(dt); }