File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
main/java/io/getstream/chat/java/models
test/java/io/getstream/chat/java Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -758,6 +758,10 @@ public static class BanRequestData {
758758 @ JsonProperty ("ip_ban" )
759759 private Boolean ipBan ;
760760
761+ @ Nullable
762+ @ JsonProperty ("delete_reactions" )
763+ private Boolean deleteReactions ;
764+
761765 public static class BanRequest extends StreamRequest <BanResponse > {
762766 @ Override
763767 protected Call <BanResponse > generateCall (Client client ) {
Original file line number Diff line number Diff line change @@ -836,6 +836,10 @@ public static class UserBanRequestData {
836836 @ JsonProperty ("channel_cid" )
837837 private String channelCid ;
838838
839+ @ Nullable
840+ @ JsonProperty ("delete_reactions" )
841+ private Boolean deleteReactions ;
842+
839843 public static class UserBanRequest extends StreamRequest <StreamResponseObject > {
840844 @ Override
841845 protected Call <StreamResponseObject > generateCall (Client client ) {
Original file line number Diff line number Diff line change @@ -191,6 +191,25 @@ void whenBanUser_thenIsBanned() {
191191 Assertions .assertTrue (bans .stream ().anyMatch (ban -> ban .getUser ().getId ().equals (userId )));
192192 }
193193
194+ @ DisplayName ("Can ban user with delete reactions" )
195+ @ Test
196+ void whenBanUserWithDeleteReactions_thenIsBanned () {
197+ String userId = RandomStringUtils .randomAlphabetic (10 );
198+ UserUpsertRequest usersUpsertRequest = User .upsert ();
199+ usersUpsertRequest .user (
200+ UserRequestObject .builder ().id (userId ).name ("User to ban with delete reactions" ).build ());
201+ Assertions .assertDoesNotThrow (() -> usersUpsertRequest .request ());
202+ Assertions .assertDoesNotThrow (
203+ () ->
204+ User .ban ()
205+ .userId (testUserRequestObject .getId ())
206+ .targetUserId (userId )
207+ .deleteReactions (true )
208+ .request ());
209+ List <Ban > bans = Assertions .assertDoesNotThrow (() -> User .queryBanned ().request ()).getBans ();
210+ Assertions .assertTrue (bans .stream ().anyMatch (ban -> ban .getUser ().getId ().equals (userId )));
211+ }
212+
194213 @ DisplayName ("Can shadow ban user" )
195214 @ Test
196215 void whenShadowBanUser_thenIsShadowBanned () {
You can’t perform that action at this time.
0 commit comments