mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 08:08:02 +01:00
Adjust routing for stories.
This commit is contained in:
@@ -165,11 +165,10 @@ public class MessageController {
|
||||
@HeaderParam("User-Agent") String userAgent,
|
||||
@HeaderParam("X-Forwarded-For") String forwardedFor,
|
||||
@PathParam("destination") UUID destinationUuid,
|
||||
@QueryParam("story") boolean isStory,
|
||||
@NotNull @Valid IncomingMessageList messages)
|
||||
throws RateLimitExceededException {
|
||||
|
||||
boolean isStory = messages.story();
|
||||
|
||||
if (source.isEmpty() && accessKey.isEmpty() && !isStory) {
|
||||
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@@ -11,15 +11,14 @@ import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public record IncomingMessageList(@NotNull @Valid List<@NotNull IncomingMessage> messages,
|
||||
boolean online, boolean urgent, boolean story, long timestamp) {
|
||||
boolean online, boolean urgent, long timestamp) {
|
||||
|
||||
@JsonCreator
|
||||
public IncomingMessageList(@JsonProperty("messages") @NotNull @Valid List<@NotNull IncomingMessage> messages,
|
||||
@JsonProperty("online") boolean online,
|
||||
@JsonProperty("urgent") Boolean urgent,
|
||||
@JsonProperty("story") Boolean story,
|
||||
@JsonProperty("timestamp") long timestamp) {
|
||||
|
||||
this(messages, online, urgent == null || urgent, story != null && story, timestamp);
|
||||
this(messages, online, urgent == null || urgent, timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user