int SyncPrivateMsgs(BonDocument chd) { lastId = chd["lastId"].AsLong; List <IMMsg> newMsgs = new List <IMMsg>(); BonUtil.ToObj(chd["msgs"], newMsgs); for (int i = newMsgs.Count; --i >= 0;) { newMsgs[i].im = im; newMsgs[i].recTgt = IMChatTarget.用户; } im.AddNewMsgs(newMsgs); return(newMsgs.Count); }
int SyncChannelMsgs(BonDocument chd, IMChannel ch) { IMChatSession session = im.GetSession(ch); session.lastId = chd["lastId"].AsLong; newMsgs.Clear(); BonUtil.ToObj(chd["msgs"], newMsgs); for (int i = newMsgs.Count; --i >= 0;) { newMsgs[i].im = im; newMsgs[i].recTgt = IMChatTarget.频道; } im.AddNewMsgs(newMsgs); return(newMsgs.Count); }
public void FromBon(BonValue jv, HashSet <string> fields) { BonUtil.ToObj(jv, this.GetType(), this, fields);//, this as IBonMonitor); }