From 220c68f364d7ab2233ef0b78d161d5d13235783e Mon Sep 17 00:00:00 2001 From: Ramon Smits Date: Wed, 28 Apr 2021 10:52:26 +0200 Subject: [PATCH] Marked obsolete methods and types with guidance on how to migrate. --- SlackAPI/RPCMessages/ChannelListResponse.cs | 1 + .../RPCMessages/DirectMessageConversationListResponse.cs | 5 +---- SlackAPI/SlackClient.cs | 2 ++ SlackAPI/SlackTaskClient.cs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SlackAPI/RPCMessages/ChannelListResponse.cs b/SlackAPI/RPCMessages/ChannelListResponse.cs index 22280c1f..817f8020 100644 --- a/SlackAPI/RPCMessages/ChannelListResponse.cs +++ b/SlackAPI/RPCMessages/ChannelListResponse.cs @@ -2,6 +2,7 @@ namespace SlackAPI { + [Obsolete] [RequestPath("channels.list")] public class ChannelListResponse : Response { diff --git a/SlackAPI/RPCMessages/DirectMessageConversationListResponse.cs b/SlackAPI/RPCMessages/DirectMessageConversationListResponse.cs index 59746ad0..d2d92664 100644 --- a/SlackAPI/RPCMessages/DirectMessageConversationListResponse.cs +++ b/SlackAPI/RPCMessages/DirectMessageConversationListResponse.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace SlackAPI { + [Obsolete] [RequestPath("im.list")] public class DirectMessageConversationListResponse : Response { diff --git a/SlackAPI/SlackClient.cs b/SlackAPI/SlackClient.cs index a0762e9b..49105548 100644 --- a/SlackAPI/SlackClient.cs +++ b/SlackAPI/SlackClient.cs @@ -156,6 +156,7 @@ public void GetConversationsList(Action callback, str APIRequestWithToken(callback, parameters.ToArray()); } + [Obsolete("Use GetConversationsListAsync instead")] public void GetChannelList(Action callback, bool ExcludeArchived = true) { APIRequestWithToken(callback, new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); @@ -166,6 +167,7 @@ public void GetGroupsList(Action callback, bool ExcludeArchiv APIRequestWithToken(callback, new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); } + [Obsolete("Use JoinDirectMessageChannelAsync instead")] public void GetDirectMessageList(Action callback) { APIRequestWithToken(callback); diff --git a/SlackAPI/SlackTaskClient.cs b/SlackAPI/SlackTaskClient.cs index 11962dfb..7fa03832 100644 --- a/SlackAPI/SlackTaskClient.cs +++ b/SlackAPI/SlackTaskClient.cs @@ -123,7 +123,7 @@ public Task ChannelsInviteAsync(string userId, string cha return APIRequestWithTokenAsync(parameters.ToArray()); } - public Task GetConversationsListAsync(string cursor = "", bool ExcludeArchived = true, int limit = 100, string[] types = null) + public Task GetConversationsListAsync(string cursor = "", bool ExcludeArchived = true, int limit = 1000, string[] types = null) { List> parameters = new List>() { @@ -608,7 +608,7 @@ public Task UpdateAsync(string ts, public Task JoinDirectMessageChannelAsync(string user) { - var param = new Tuple("user", user); + var param = new Tuple("users", user); return APIRequestWithTokenAsync(param); }