Skip to content

Commit

Permalink
Добавлен недокументированный метод MarkAsUnreadConversation. (#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeNcHiK3713 authored May 11, 2021
1 parent 35bbe51 commit af8e49c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
13 changes: 13 additions & 0 deletions VkNet/Abstractions/Category/Async/IMessagesCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,19 @@ Task<GetRecentCallsResult> GetRecentCallsAsync(IEnumerable<string> fields, ulong
/// </remarks>
Task<GetIntentUsersResult> GetIntentUsersAsync(MessagesGetIntentUsersParams getIntentUsersParams, CancellationToken token);


/// <summary>
/// Помечает диалог пользователя непрочитанным.
/// </summary>
/// <param name="peerId">
/// Идентификатор назначения. Для групповой беседы: 2000000000 + id беседы. Для
/// сообщества: -id сообщества.
/// </param>
/// <returns>
/// После успешного выполнения возвращает true.
/// </returns>
Task<bool> MarkAsUnreadConversationAsync(long peerId);

#region Obsoleted

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions VkNet/Abstractions/Category/IMessagesCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ GetRecentCallsResult GetRecentCalls(IEnumerable<string> fields, ulong? count = n
/// <inheritdoc cref="IMessagesCategoryAsync.SendMessageEventAnswerAsync"/>
bool SendMessageEventAnswer(string eventId, long userId, long peerId, EventData eventData = null);

/// <inheritdoc cref="IMessagesCategoryAsync.MarkAsUnreadConversationAsync"/>
bool MarkAsUnreadConversation(long peerId);

/// <inheritdoc cref="IMessagesCategoryAsync.GetIntentUsersAsync"/>
GetIntentUsersResult GetIntentUsers(MessagesGetIntentUsersParams getIntentUsersParams);

Expand Down
6 changes: 6 additions & 0 deletions VkNet/Categories/Async/MessagesCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,5 +346,11 @@ public Task<bool> SendMessageEventAnswerAsync(string eventId, long userId, long
{
return TypeHelper.TryInvokeMethodAsync(() => SendMessageEventAnswer(eventId, userId, peerId, eventData));
}

/// <inheritdoc />
public Task<bool> MarkAsUnreadConversationAsync(long peerId)
{
return TypeHelper.TryInvokeMethodAsync(() => MarkAsUnreadConversation(peerId));
}
}
}
10 changes: 10 additions & 0 deletions VkNet/Categories/MessagesCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,16 @@ public bool SendMessageEventAnswer(string eventId, long userId, long peerId, Eve
});
}

/// <inheritdoc />
public bool MarkAsUnreadConversation(long peerId)
{
return _vk.Call<bool>("messages.markAsUnreadConversation",
new VkParameters
{
{ "peer_id", peerId }
});
}

/// <summary>
/// Ворзвращает указанное сообщение по его идентификатору.
/// </summary>
Expand Down

0 comments on commit af8e49c

Please sign in to comment.