public void LogMessage(Message m) { if (!ContainsMessage(m)) { dtMessages.Rows.Add(MessageToDataRow(m)); LogUser(m.GetSender()); if (m.GetRecipient() != null) { LogUser(m.GetRecipient()); } this.adapterMessages.Update(dtMessages); } }
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); }