public DataRow MessageToDataRow(Message m) { DataRow dr = dtMessages.NewRow(); dr["cbid"] = m.GetID(); dr["sender"] = m.GetSender().GetUid(); dr["message"] = m.GetMessage(); dr["private"] = m.IsPrivate(); dr["heure"] = (m.GetTimestamp() / 1000); dr["channel"] = m.GetChannel(); if (m.GetRecipient() != null) { dr["recipient"] = m.GetRecipient().GetUid(); } return(dr); }
public void InsertMessage(string channel) { Ponybox.Message m = client.GetMessages(channel).Last(); string[] items = new string[4] { m.GetSender().GetUsername(), m.GetMessage(), Functions.UnixTimeStampToDateTime(m.GetTimestamp()).ToString("yyy-MM-dd hh:mm:ss"), m.GetID().ToString() }; ListViewItem lvi = new ListViewItem(items); channels[channel].Invoke((MethodInvoker) delegate { channels[channel].Items.Add(lvi); }); }
public bool ContainsMessage(Message m) { DataRow[] res = dtMessages.Select("sender = " + m.GetSender().GetUid() + " AND heure = " + (m.GetTimestamp() / 1000)); return(res.Count() > 0); }