From af8e49c0a31330389e2ecbad53a3408816226b8e Mon Sep 17 00:00:00 2001 From: Denis Suchok <35270280+DeNcHiK3713@users.noreply.github.com> Date: Tue, 11 May 2021 11:40:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BD=D0=B5=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20MarkAsUnreadConversation.=20(#?= =?UTF-8?q?1159)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Category/Async/IMessagesCategoryAsync.cs | 13 +++++++++++++ VkNet/Abstractions/Category/IMessagesCategory.cs | 3 +++ VkNet/Categories/Async/MessagesCategoryAsync.cs | 6 ++++++ VkNet/Categories/MessagesCategory.cs | 10 ++++++++++ 4 files changed, 32 insertions(+) diff --git a/VkNet/Abstractions/Category/Async/IMessagesCategoryAsync.cs b/VkNet/Abstractions/Category/Async/IMessagesCategoryAsync.cs index 5731c59c3..75dc310a8 100644 --- a/VkNet/Abstractions/Category/Async/IMessagesCategoryAsync.cs +++ b/VkNet/Abstractions/Category/Async/IMessagesCategoryAsync.cs @@ -1000,6 +1000,19 @@ Task GetRecentCallsAsync(IEnumerable fields, ulong /// Task GetIntentUsersAsync(MessagesGetIntentUsersParams getIntentUsersParams, CancellationToken token); + + /// + /// Помечает диалог пользователя непрочитанным. + /// + /// + /// Идентификатор назначения. Для групповой беседы: 2000000000 + id беседы. Для + /// сообщества: -id сообщества. + /// + /// + /// После успешного выполнения возвращает true. + /// + Task MarkAsUnreadConversationAsync(long peerId); + #region Obsoleted /// diff --git a/VkNet/Abstractions/Category/IMessagesCategory.cs b/VkNet/Abstractions/Category/IMessagesCategory.cs index 75328a664..91a95658f 100644 --- a/VkNet/Abstractions/Category/IMessagesCategory.cs +++ b/VkNet/Abstractions/Category/IMessagesCategory.cs @@ -151,6 +151,9 @@ GetRecentCallsResult GetRecentCalls(IEnumerable fields, ulong? count = n /// bool SendMessageEventAnswer(string eventId, long userId, long peerId, EventData eventData = null); + /// + bool MarkAsUnreadConversation(long peerId); + /// GetIntentUsersResult GetIntentUsers(MessagesGetIntentUsersParams getIntentUsersParams); diff --git a/VkNet/Categories/Async/MessagesCategoryAsync.cs b/VkNet/Categories/Async/MessagesCategoryAsync.cs index a04a7e27a..adab0fd58 100644 --- a/VkNet/Categories/Async/MessagesCategoryAsync.cs +++ b/VkNet/Categories/Async/MessagesCategoryAsync.cs @@ -346,5 +346,11 @@ public Task SendMessageEventAnswerAsync(string eventId, long userId, long { return TypeHelper.TryInvokeMethodAsync(() => SendMessageEventAnswer(eventId, userId, peerId, eventData)); } + + /// + public Task MarkAsUnreadConversationAsync(long peerId) + { + return TypeHelper.TryInvokeMethodAsync(() => MarkAsUnreadConversation(peerId)); + } } } \ No newline at end of file diff --git a/VkNet/Categories/MessagesCategory.cs b/VkNet/Categories/MessagesCategory.cs index 71897b6c0..b436296ab 100644 --- a/VkNet/Categories/MessagesCategory.cs +++ b/VkNet/Categories/MessagesCategory.cs @@ -869,6 +869,16 @@ public bool SendMessageEventAnswer(string eventId, long userId, long peerId, Eve }); } + /// + public bool MarkAsUnreadConversation(long peerId) + { + return _vk.Call("messages.markAsUnreadConversation", + new VkParameters + { + { "peer_id", peerId } + }); + } + /// /// Ворзвращает указанное сообщение по его идентификатору. ///