/// <summary> /// Marks message history as read. /// </summary> /// <param name="peer">User or group to receive the message</param> /// <param name="maxId">If a positive value is passed, only messages with identifiers less or equal than the given one will be read</param> /// <returns>Returns a <see cref="IAffectedMessages"/> object containing a affected messages</returns> public async Task <IAffectedMessages> ReadHistoryAsync(IInputPeer peer, int maxId) { EnsureUserAuthorized(); var readHistory = new RequestReadHistory { Peer = peer, MaxId = maxId }; return(await SenderService.SendRequestAsync(readHistory).ConfigureAwait(false)); }
/// <inheritdoc /> public async Task <IAffectedMessages> ReadHistoryAsync(IInputPeer peer, int maxId, CancellationToken cancellationToken = default(CancellationToken)) { ClientSettings.EnsureUserAuthorized(); var readHistory = new RequestReadHistory { Peer = peer, MaxId = maxId }; return(await RequestSender.SendRequestAsync(readHistory, cancellationToken).ConfigureAwait(false)); }