Skip to content

Commit

Permalink
Merge pull request #162 from GetStream/flag_custom_var
Browse files Browse the repository at this point in the history
[FEEDS-42]pass custom var to request
  • Loading branch information
itsmeadi authored Dec 27, 2024
2 parents 0899eb9 + 99ea58e commit dba3f13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/main/java/io/getstream/client/ModerationClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ public class ModerationClient {
}

public CompletableFuture<Response> flagUser(
String flaggedUserId,String reportingUser, String reason, Map<String, Object> options) throws StreamException {
return flag("stream:user", flaggedUserId, reportingUser, reason, options);
String flaggedUserId,String reportingUser, String reason, Map<String, Object> custom) throws StreamException {
return flag("stream:user", flaggedUserId, reportingUser, reason, custom);
}

public CompletableFuture<Response> flagActivity(
String entityId, String reportingUser, String reason, Map<String, Object> options)
String entityId, String reportingUser, String reason, Map<String, Object> custom)
throws StreamException {
return flag("stream:feeds:v2:activity", entityId, reportingUser, reason, options);
return flag("stream:feeds:v2:activity", entityId, reportingUser, reason, custom);
}

public CompletableFuture<Response> flagReaction(
String entityId, String reportingUser, String reason, Map<String, Object> options)
String entityId, String reportingUser, String reason, Map<String, Object> custom)
throws StreamException {
return flag("stream:feeds:v2:reaction", entityId, reportingUser, reason, options);
return flag("stream:feeds:v2:reaction", entityId, reportingUser, reason, custom);
}

private CompletableFuture<Response> flag(
String entityType,
String entityId,
String reportingUser,
String reason,
Map<String, Object> options)
Map<String, Object> custom)
throws StreamException {
final Token token = buildModerationToken(secret, Auth.TokenAction.WRITE);
return mod.flag(token, entityType, entityId, reportingUser, reason, options);
return mod.flag(token, entityType, entityId, reportingUser, reason, custom);
}
}
3 changes: 2 additions & 1 deletion src/main/java/io/getstream/core/Moderation.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public CompletableFuture<Response> flag(
String entityId,
String reportingUser,
String Reason,
Map<String, Object> options)
Map<String, Object> Custom)
throws StreamException {
try {
final byte[] payload =
Expand All @@ -43,6 +43,7 @@ public CompletableFuture<Response> flag(
public final String entity_type = entityType;
public final String entity_id = entityId;
public final String reason = Reason;
public final Map<String, Object> custom = Custom;
});

final URL url = buildModerationFlagURL(baseURL);
Expand Down

0 comments on commit dba3f13

Please sign in to comment.