Use separate object for multi recipient response
`needsSync` was being sent back from the server in the JSON response which is an unnecessary and constantly false field in multi-recipient message sending endpoint as it's always sealed sender.
This commit is contained in:
parent
417d48c452
commit
07f9bb112e
|
@ -76,6 +76,7 @@ import org.whispersystems.textsecuregcm.entities.MultiRecipientMessage.Recipient
|
||||||
import org.whispersystems.textsecuregcm.entities.OutgoingMessageEntity;
|
import org.whispersystems.textsecuregcm.entities.OutgoingMessageEntity;
|
||||||
import org.whispersystems.textsecuregcm.entities.OutgoingMessageEntityList;
|
import org.whispersystems.textsecuregcm.entities.OutgoingMessageEntityList;
|
||||||
import org.whispersystems.textsecuregcm.entities.SendMessageResponse;
|
import org.whispersystems.textsecuregcm.entities.SendMessageResponse;
|
||||||
|
import org.whispersystems.textsecuregcm.entities.SendMultiRecipientMessageResponse;
|
||||||
import org.whispersystems.textsecuregcm.entities.StaleDevices;
|
import org.whispersystems.textsecuregcm.entities.StaleDevices;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeException;
|
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeException;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeManager;
|
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeManager;
|
||||||
|
@ -417,7 +418,7 @@ public class MessageController {
|
||||||
uuids404.add(destinationAccount.getUuid());
|
uuids404.add(destinationAccount.getUuid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Response.ok(new SendMessageResponse(uuids404)).build();
|
return Response.ok(new SendMultiRecipientMessageResponse(uuids404)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkAccessKeys(CombinedUnidentifiedSenderAccessKeys accessKeys, Map<UUID, Account> uuidToAccountMap) {
|
private void checkAccessKeys(CombinedUnidentifiedSenderAccessKeys accessKeys, Map<UUID, Account> uuidToAccountMap) {
|
||||||
|
|
|
@ -6,24 +6,15 @@
|
||||||
package org.whispersystems.textsecuregcm.entities;
|
package org.whispersystems.textsecuregcm.entities;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class SendMessageResponse {
|
public class SendMessageResponse {
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private boolean needsSync;
|
private boolean needsSync;
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private List<UUID> uuids404;
|
|
||||||
|
|
||||||
public SendMessageResponse() {}
|
public SendMessageResponse() {}
|
||||||
|
|
||||||
public SendMessageResponse(boolean needsSync) {
|
public SendMessageResponse(boolean needsSync) {
|
||||||
this.needsSync = needsSync;
|
this.needsSync = needsSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SendMessageResponse(List<UUID> uuids404) {
|
|
||||||
this.uuids404 = uuids404;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2021 Signal Messenger, LLC
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.whispersystems.textsecuregcm.entities;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class SendMultiRecipientMessageResponse {
|
||||||
|
@JsonProperty
|
||||||
|
private List<UUID> uuids404;
|
||||||
|
|
||||||
|
public SendMultiRecipientMessageResponse() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendMultiRecipientMessageResponse(final List<UUID> uuids404) {
|
||||||
|
this.uuids404 = uuids404;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue