Пример #1
0
        public IEnumerable <Message> GetNewMessages()
        {
            _longPoll = _api.Messages.GetLongPollServer(useSsl: false, needPts: true);

            _longPollHistory = _api.Messages.GetLongPollHistory(new MessagesGetLongPollHistoryParams
            {
                Ts      = _longPoll.Ts,
                Onlines = false,
                Pts     = _pts
            });
            _pts = _longPollHistory.NewPts;
            _account.PhoneNumber = _pts.ToString();
            return(EntytiesMapper.Map(_longPollHistory.Messages, 0).ToList());
        }
Пример #2
0
 /// <summary>
 /// LongPollServer needs to be initiated by initial response,
 /// obtained from vkApi.Messages.GetLongPollServer() call
 /// </summary>
 /// <param name="resp"></param>
 public LongPollServer(VkNet.Model.LongPollServerResponse resp)
 {
     this.Ts     = resp.Ts;
     this.Key    = resp.Key;
     this.Server = resp.Server;
 }