Skip to content
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
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{erl_opts, [debug_info]}.
{deps, [
{restc, {git, "git://github.com/kivra/restclient.git", {branch, "master"}}}
{restc, {git, "https://github.com/balcruz/restclient.git", {branch, "Upgrade_hackney_to_1.15.2"}}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hackney is already upgraded on kivra/restclient main branch I believe.

]}.
{cover_enabled, true}.
{cover_print_enabled, true}.
Expand Down
60 changes: 30 additions & 30 deletions src/slacker_channel.erl → src/slacker_conversation.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-module(slacker_channel).
-module(slacker_conversation).

-include("spec.hrl").

Expand All @@ -7,17 +7,17 @@
set_purpose/3, set_topic/3, unarchive/2]).


%% @doc Archives a channel.
%% @doc Archives a conversation.
-spec archive(Token :: string(), Channel :: string()) -> http_response().
archive(Token, Channel) ->
slacker_request:send("channels.archive", [{"token", Token},{"channel", Channel}]).
slacker_request:send("conversations.archive", [{"token", Token},{"channel", Channel}]).

%% @doc Creates a channel.
%% @doc Creates a conversation.
-spec create(Token :: string(), Name :: string()) -> http_response().
create(Token, Name) ->
slacker_request:send("channels.create", [{"token", Token},{"name", Name}]).
slacker_request:send("conversations.create", [{"token", Token},{"name", Name}]).

%% @doc Fetches history of messages and events from a channel.
%% @doc Fetches history of messages and events from a conversation.
%%
%% Options can be:
%% latest: end of time range of messages to include in results
Expand All @@ -28,63 +28,63 @@ create(Token, Name) ->
%%
-spec history(Token :: string(), Channel :: string(), Options :: list()) -> http_response().
history(Token, Channel, Options) ->
slacker_request:send("channels.history", [{"token", Token},{"channel", Channel}], Options).
slacker_request:send("conversations.history", [{"token", Token},{"channel", Channel}], Options).

%% @doc Returns information about a team channel.
%% @doc Returns information about a team conversation.
-spec info(Token :: string(), Channel :: string()) -> http_response().
info(Token, Channel) ->
slacker_request:send("channels.info", [{"token", Token},{"channel", Channel}]).
slacker_request:send("conversations.info", [{"token", Token},{"channel", Channel}]).

%% @doc Invites a user to a channel.
%% @doc Invites a user to a conversation.
-spec invite(Token :: string(), Channel :: string(), User :: string()) -> http_response().
invite(Token, Channel, User) ->
slacker_request:send("channels.invite", [{"token", Token},{"channel", Channel},{"user", User}]).
slacker_request:send("conversations.invite", [{"token", Token},{"channel", Channel},{"user", User}]).

%% @doc Join a channel. If the channel does not exist, it is created.
%% @doc Join a conversation. If the conversation does not exist, it is created.
-spec join(Token :: string(), Channel :: string()) -> http_response().
join(Token, Channel) ->
slacker_request:send("channels.join", [{"token", Token},{"channel", Channel}]).
slacker_request:send("conversations.join", [{"token", Token},{"channel", Channel}]).

%% @doc Removes a user from a channel.
%% @doc Removes a user from a conversation.
-spec kick(Token :: string(), Channel :: string(), User :: string()) -> http_response().
kick(Token, Channel, User) ->
slacker_request:send("channels.kick", [{"token", Token},{"channel", Channel},{"user", User}]).
slacker_request:send("conversations.kick", [{"token", Token},{"channel", Channel},{"user", User}]).

%% @doc Leave a channel.
%% @doc Leave a conversation.
-spec leave(Token :: string(), Channel :: string()) -> http_response().
leave(Token, Channel) ->
slacker_request:send("channels.leave", [{"token", Token},{"channel", Channel}]).
slacker_request:send("conversations.leave", [{"token", Token},{"channel", Channel}]).

%% @doc List of all channels in the team.
%% @doc List of all conversations in the team.
%%
%% Options can be:
%% exclude_archived: do not return archived channels (default: 0)
%% exclude_archived: do not return archived conversations (default: 0)
%%
-spec list(Token :: string(), Options :: list()) -> http_response().
list(Token, Options) ->
slacker_request:send("channels.list", [{"token", Token}], Options).
slacker_request:send("conversations.list", [{"token", Token}], Options).

%% @doc Set read cursor in a channel.
%% @doc Set read cursor in a conversation.
-spec mark(Token :: string(), Channel :: string(), Timestamp :: string()) -> http_response().
mark(Token, Channel, Timestamp) ->
slacker_request:send("channels.mark", [{"token", Token},{"channel", Channel},{"ts", Timestamp}]).
slacker_request:send("conversations.mark", [{"token", Token},{"channel", Channel},{"ts", Timestamp}]).

%% @doc Rename a channel.
%% @doc Rename a conversation.
-spec rename(Token :: string(), Channel :: string(), Name :: string()) -> http_response().
rename(Token, Channel, Name) ->
slacker_request:send("channels.rename", [{"token", Token},{"channel", Channel},{"name", Name}]).
slacker_request:send("conversations.rename", [{"token", Token},{"channel", Channel},{"name", Name}]).

%% @doc Sets the purpose for a channel.
%% @doc Sets the purpose for a conversation.
-spec set_purpose(Token :: string(), Channel :: string(), Purpose :: string()) -> http_response().
set_purpose(Token, Channel, Purpose) ->
slacker_request:send("channels.setPurpose", [{"token", Token},{"channel", Channel},{"purpose", Purpose}]).
slacker_request:send("conversations.setPurpose", [{"token", Token},{"channel", Channel},{"purpose", Purpose}]).

%% @doc Sets the topic for a channel.
%% @doc Sets the topic for a conversation.
-spec set_topic(Token :: string(), Channel :: string(), Topic :: string()) -> http_response().
set_topic(Token, Channel, Topic) ->
slacker_request:send("channels.setTopic", [{"token", Token},{"channel", Channel},{"topic", Topic}]).
slacker_request:send("conversations.setTopic", [{"token", Token},{"channel", Channel},{"topic", Topic}]).

%% @doc Unarchives a channel.
%% @doc Unarchives a conversation.
-spec unarchive(Token :: string(), Channel :: string()) -> http_response().
unarchive(Token, Channel) ->
slacker_request:send("channels.unarchive", [{"token", Token},{"channel", Channel}]).
slacker_request:send("conversations.unarchive", [{"token", Token},{"channel", Channel}]).
100 changes: 0 additions & 100 deletions src/slacker_group.erl

This file was deleted.

39 changes: 0 additions & 39 deletions src/slacker_im.erl

This file was deleted.

39 changes: 0 additions & 39 deletions src/slacker_mpim.erl

This file was deleted.