Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove methods that are no longer available and mark deprecated methods #318

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions SlackAPI/RPCMessages/ChannelListResponse.cs

This file was deleted.

13 changes: 0 additions & 13 deletions SlackAPI/RPCMessages/GroupArchiveResponse.cs

This file was deleted.

15 changes: 0 additions & 15 deletions SlackAPI/RPCMessages/GroupCloseResponse.cs

This file was deleted.

13 changes: 0 additions & 13 deletions SlackAPI/RPCMessages/GroupCreateChildResponse.cs

This file was deleted.

13 changes: 0 additions & 13 deletions SlackAPI/RPCMessages/GroupKickResponse.cs

This file was deleted.

13 changes: 0 additions & 13 deletions SlackAPI/RPCMessages/GroupLeaveResponse.cs

This file was deleted.

14 changes: 0 additions & 14 deletions SlackAPI/RPCMessages/GroupListResponse.cs

This file was deleted.

9 changes: 0 additions & 9 deletions SlackAPI/RPCMessages/GroupMessageHistory.cs

This file was deleted.

14 changes: 0 additions & 14 deletions SlackAPI/RPCMessages/GroupRenameResponse.cs

This file was deleted.

14 changes: 0 additions & 14 deletions SlackAPI/RPCMessages/GroupSetPurposeResponse.cs

This file was deleted.

14 changes: 0 additions & 14 deletions SlackAPI/RPCMessages/GroupSetTopicResponse.cs

This file was deleted.

13 changes: 0 additions & 13 deletions SlackAPI/RPCMessages/GroupUnarchiveResponse.cs

This file was deleted.

3 changes: 1 addition & 2 deletions SlackAPI/RPCMessages/MessageHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

namespace SlackAPI
{
[RequestPath("im.history")]
public class MessageHistory : Response
public abstract class MessageHistory : Response
{
/// <summary>
/// I believe this is where the read cursor is? IE: How far the user has read.
Expand Down
84 changes: 5 additions & 79 deletions SlackAPI/SlackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,7 @@ public void GetConversationsMembers(Action<ConversationsMembersResponse> callbac
APIRequestWithToken(callback, parameters.ToArray());
}

public void GetChannelList(Action<ChannelListResponse> callback, bool ExcludeArchived = true)
{
APIRequestWithToken(callback, new Tuple<string, string>("exclude_archived", ExcludeArchived ? "1" : "0"));
}

public void GetGroupsList(Action<GroupListResponse> callback, bool ExcludeArchived = true)
{
APIRequestWithToken(callback, new Tuple<string, string>("exclude_archived", ExcludeArchived ? "1" : "0"));
}

[Obsolete("Use conversations API")]
public void GetDirectMessageList(Action<DirectMessageConversationListResponse> callback)
{
APIRequestWithToken(callback);
Expand Down Expand Up @@ -260,11 +251,6 @@ public void GetDirectMessageHistory(Action<MessageHistory> callback, DirectMessa
GetHistory(callback, conversationInfo.id, latest, oldest, count, unreads);
}

public void GetGroupHistory(Action<GroupMessageHistory> callback, Channel groupInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false)
{
GetHistory(callback, groupInfo.id, latest, oldest, count, unreads);
}

public void GetConversationsHistory(Action<ConversationsMessageHistory> callback, Channel conversationInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false)
{
GetHistory(callback, conversationInfo.id, latest, oldest, count, unreads);
Expand Down Expand Up @@ -293,26 +279,14 @@ public void GetFileInfo(Action<FileInfoResponse> callback, string fileId, int? p
APIRequestWithToken(callback, parameters.ToArray());
}
#region Groups
public void GroupsArchive(Action<GroupArchiveResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

public void GroupsClose(Action<GroupCloseResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

[Obsolete("Use conversations API")]
public void GroupsCreate(Action<GroupCreateResponse> callback, string name)
{
APIRequestWithToken(callback, new Tuple<string, string>("name", name));
}

public void GroupsCreateChild(Action<GroupCreateChildResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

[Obsolete("Use conversations API")]
public void GroupsInvite(Action<GroupInviteResponse> callback, string userId, string channelId)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>();
Expand All @@ -323,66 +297,18 @@ public void GroupsInvite(Action<GroupInviteResponse> callback, string userId, st
APIRequestWithToken(callback, parameters.ToArray());
}

public void GroupsKick(Action<GroupKickResponse> callback, string userId, string channelId)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>();

parameters.Add(new Tuple<string, string>("channel", channelId));
parameters.Add(new Tuple<string, string>("user", userId));

APIRequestWithToken(callback, parameters.ToArray());
}

public void GroupsLeave(Action<GroupLeaveResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

[Obsolete("Use conversations API")]
public void GroupsMark(Action<GroupMarkResponse> callback, string channelId, DateTime ts)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId), new Tuple<string, string>("ts", ts.ToProperTimeStamp()));
}

[Obsolete("Use conversations API")]
public void GroupsOpen(Action<GroupOpenResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

public void GroupsRename(Action<GroupRenameResponse> callback, string channelId, string name)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>();

parameters.Add(new Tuple<string, string>("channel", channelId));
parameters.Add(new Tuple<string, string>("name", name));

APIRequestWithToken(callback, parameters.ToArray());
}

public void GroupsSetPurpose(Action<GroupSetPurposeResponse> callback, string channelId, string purpose)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>();

parameters.Add(new Tuple<string, string>("channel", channelId));
parameters.Add(new Tuple<string, string>("purpose", purpose));

APIRequestWithToken(callback, parameters.ToArray());
}

public void GroupsSetTopic(Action<GroupSetPurposeResponse> callback, string channelId, string topic)
{
List<Tuple<string, string>> parameters = new List<Tuple<string, string>>();

parameters.Add(new Tuple<string, string>("channel", channelId));
parameters.Add(new Tuple<string, string>("topic", topic));

APIRequestWithToken(callback, parameters.ToArray());
}

public void GroupsUnarchive(Action<GroupUnarchiveResponse> callback, string channelId)
{
APIRequestWithToken(callback, new Tuple<string, string>("channel", channelId));
}

#endregion

#region Conversations
Expand Down
Loading