public int ProccesChats(string login, string password) { if (_liveTex == null) _liveTex = InitLivetext(LivetexLogin, LivetexPassword); var dayBefore = DateTime.Now.AddDays(-1); var dayTommorow = DateTime.Now.AddDays(1); return _liveTex.ProcessChats(dayBefore, dayTommorow); }
public void InsertChat(string chat, string account, string site, string visitor, string chatid) { if (_liveTex == null) _liveTex = InitLivetext(LivetexLogin, LivetexPassword); if (_liveTex == null) return; if (_siteList == null) _siteList = _liveTex.GetSiteList(); var dayBefore = DateTime.Now.AddDays(-1); var dayTommorow = DateTime.Now.AddDays(1); _liveTex.ProcessChats(dayBefore, dayTommorow, site); var chatId = chat != "" ? (int?)Int32.Parse(chat) : null; var curentChat = chat != null ? _liveTex.CurrentChats.Chats.Where(x => x.Id == chatId) : null; if (curentChat == null) return; var list = curentChat.ToList(); var chats = curentChat as IList<Chat> ?? list; //if (chats.Any() && !IsCashedChat(chat)) { ToCashChat(chat); InsertChat(chats.First()); } }