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

Add ban/unban user #87

Merged
merged 5 commits into from
Oct 3, 2019
Merged

Conversation

bevzaanton
Copy link
Contributor

Submit a pull request

Description of the pull request

  • add API methods to Client to ban/unban user
  • add methods to Channel to ban/unban user for this channel
  • add methods for end-client to ban/unban user.

Methods for end-client:

ChannelViewModel
public void banUser(@NotNull String targetUserId, @Nullable String reason, @Nullable Integer timeout, @Nullable ResultCallback<Void, String> callback) - bans a user from this channel
public void unBanUser(@NotNull String targetUserId, @Nullable ResultCallback<Void, String> callback) - removes the ban for a user on this channel

…o feature/ban_user

# Conflicts:
#	library/src/main/java/com/getstream/sdk/chat/model/Channel.java
#	library/src/main/java/com/getstream/sdk/chat/rest/core/Client.java
#	library/src/main/java/com/getstream/sdk/chat/viewmodel/ChannelViewModel.java
@@ -83,6 +84,12 @@

@POST("/moderation/unflag")
Call<FlagResponse> unFlag(@Query("api_key") String apiKey, @Query("user_id") String userId, @Query("client_id") String connectionId, @Body Map<String, String> body);

@POST("/moderation/ban")
Call<CompletableResponse> banUser(@Query("api_key") String apiKey, @Query("client_id") String connectionId, @Body BanUserRequest body);
Copy link
Member

Choose a reason for hiding this comment

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

@bevzaanton feel free to replace other endpoints' Completable that have no data with CompletableResponse less code is always better :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I will do it my next PR

@tbarbugli tbarbugli merged commit 4e5fa5d into GetStream:master Oct 3, 2019
@bevzaanton bevzaanton mentioned this pull request Oct 3, 2019
16 tasks
JcMinarro added a commit that referenced this pull request Oct 20, 2020
…oken

[CAS-277] Feature/disable send firebase token
JcMinarro added a commit that referenced this pull request Oct 21, 2020
[CAS-315] Rename directories to avoid conflict when merge different repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants