mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-04-19 08:31:30 +00:00
Revert uneeded changes
This commit is contained in:
parent
afc3c458a9
commit
6810877b4d
@ -7,10 +7,7 @@ import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "AdminDelete")
|
||||
public record JsonAdminDelete(
|
||||
@Deprecated String targetAuthor,
|
||||
String targetAuthorNumber,
|
||||
String targetAuthorUuid,
|
||||
long targetSentTimestamp
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
) {
|
||||
|
||||
static JsonAdminDelete from(MessageEnvelope.Data.AdminDelete adminDelete) {
|
||||
|
||||
@ -25,21 +25,14 @@ record JsonCallMessage(
|
||||
callMessage.iceUpdate().stream().map(IceUpdate::from).toList());
|
||||
}
|
||||
|
||||
record Offer(
|
||||
long id,
|
||||
String type,
|
||||
String opaque
|
||||
) {
|
||||
record Offer(long id, String type, String opaque) {
|
||||
|
||||
public static Offer from(final MessageEnvelope.Call.Offer offer) {
|
||||
return new Offer(offer.id(), offer.type().name(), Base64.getEncoder().encodeToString(offer.opaque()));
|
||||
}
|
||||
}
|
||||
|
||||
public record Answer(
|
||||
long id,
|
||||
String opaque
|
||||
) {
|
||||
public record Answer(long id, String opaque) {
|
||||
|
||||
public static Answer from(final MessageEnvelope.Call.Answer answer) {
|
||||
return new Answer(answer.id(), Base64.getEncoder().encodeToString(answer.opaque()));
|
||||
@ -53,21 +46,14 @@ record JsonCallMessage(
|
||||
}
|
||||
}
|
||||
|
||||
public record Hangup(
|
||||
long id,
|
||||
String type,
|
||||
int deviceId
|
||||
) {
|
||||
public record Hangup(long id, String type, int deviceId) {
|
||||
|
||||
public static Hangup from(final MessageEnvelope.Call.Hangup hangup) {
|
||||
return new Hangup(hangup.id(), hangup.type().name(), hangup.deviceId());
|
||||
}
|
||||
}
|
||||
|
||||
public record IceUpdate(
|
||||
long id,
|
||||
String opaque
|
||||
) {
|
||||
public record IceUpdate(long id, String opaque) {
|
||||
|
||||
public static IceUpdate from(final MessageEnvelope.Call.IceUpdate iceUpdate) {
|
||||
return new IceUpdate(iceUpdate.id(), Base64.getEncoder().encodeToString(iceUpdate.opaque()));
|
||||
|
||||
@ -5,10 +5,7 @@ import io.micronaut.jsonschema.JsonSchema;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "ContactAvatar")
|
||||
public record JsonContactAvatar(
|
||||
JsonAttachment attachment,
|
||||
boolean isProfile
|
||||
) {
|
||||
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
||||
|
||||
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
|
||||
return new JsonContactAvatar(JsonAttachment.from(avatar.attachment()), avatar.isProfile());
|
||||
|
||||
@ -6,11 +6,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactEmail")
|
||||
public record JsonContactEmail(
|
||||
String value,
|
||||
String type,
|
||||
String label
|
||||
) {
|
||||
public record JsonContactEmail(String value, String type, String label) {
|
||||
|
||||
static JsonContactEmail from(MessageEnvelope.Data.SharedContact.Email email) {
|
||||
return new JsonContactEmail(email.value(), email.type().name(), Util.getStringIfNotBlank(email.label()));
|
||||
|
||||
@ -7,12 +7,7 @@ import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactName")
|
||||
public record JsonContactName(
|
||||
String nickname,
|
||||
String given,
|
||||
String family,
|
||||
String prefix,
|
||||
String suffix,
|
||||
String middle
|
||||
String nickname, String given, String family, String prefix, String suffix, String middle
|
||||
) {
|
||||
|
||||
static JsonContactName from(MessageEnvelope.Data.SharedContact.Name name) {
|
||||
|
||||
@ -6,11 +6,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.util.Util;
|
||||
|
||||
@JsonSchema(title = "ContactPhone")
|
||||
public record JsonContactPhone(
|
||||
String value,
|
||||
String type,
|
||||
String label
|
||||
) {
|
||||
public record JsonContactPhone(String value, String type, String label) {
|
||||
|
||||
static JsonContactPhone from(MessageEnvelope.Data.SharedContact.Phone phone) {
|
||||
return new JsonContactPhone(phone.value(), phone.type().name(), Util.getStringIfNotBlank(phone.label()));
|
||||
|
||||
@ -6,12 +6,7 @@ import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "GroupInfo")
|
||||
record JsonGroupInfo(
|
||||
String groupId,
|
||||
String groupName,
|
||||
int revision,
|
||||
String type
|
||||
) {
|
||||
record JsonGroupInfo(String groupId, String groupName, int revision, String type) {
|
||||
|
||||
static JsonGroupInfo from(MessageEnvelope.Data.GroupContext groupContext, Manager m) {
|
||||
return new JsonGroupInfo(groupContext.groupId().toBase64(),
|
||||
|
||||
@ -7,13 +7,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "Mention")
|
||||
public record JsonMention(
|
||||
@Deprecated String name,
|
||||
String number,
|
||||
String uuid,
|
||||
int start,
|
||||
int length
|
||||
) {
|
||||
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
||||
|
||||
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
||||
final var address = mention.recipient();
|
||||
|
||||
@ -8,9 +8,7 @@ import java.util.List;
|
||||
|
||||
@JsonSchema(title = "PollCreate")
|
||||
public record JsonPollCreate(
|
||||
String question,
|
||||
boolean allowMultiple,
|
||||
List<String> options
|
||||
String question, boolean allowMultiple, List<String> options
|
||||
) {
|
||||
|
||||
static JsonPollCreate from(MessageEnvelope.Data.PollCreate pollCreate) {
|
||||
|
||||
@ -7,9 +7,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "QuotedAttachment")
|
||||
public record JsonQuotedAttachment(
|
||||
String contentType,
|
||||
String filename,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||
String contentType, String filename, @JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||
) {
|
||||
|
||||
static JsonQuotedAttachment from(MessageEnvelope.Data.Attachment quotedAttachment) {
|
||||
|
||||
@ -7,13 +7,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import java.util.List;
|
||||
|
||||
@JsonSchema(title = "ReceiptMessage")
|
||||
record JsonReceiptMessage(
|
||||
long when,
|
||||
boolean isDelivery,
|
||||
boolean isRead,
|
||||
boolean isViewed,
|
||||
List<Long> timestamps
|
||||
) {
|
||||
record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
|
||||
|
||||
static JsonReceiptMessage from(MessageEnvelope.Receipt receiptMessage) {
|
||||
final var when = receiptMessage.when();
|
||||
|
||||
@ -7,11 +7,7 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "RecipientAddress")
|
||||
public record JsonRecipientAddress(
|
||||
String uuid,
|
||||
String number,
|
||||
String username
|
||||
) {
|
||||
public record JsonRecipientAddress(String uuid, String number, String username) {
|
||||
|
||||
public static JsonRecipientAddress from(RecipientAddress address) {
|
||||
return new JsonRecipientAddress(address.uuid().map(UUID::toString).orElse(null),
|
||||
|
||||
@ -45,11 +45,7 @@ record JsonStoryMessage(
|
||||
}
|
||||
|
||||
public record Gradient(
|
||||
String startColor,
|
||||
String endColor,
|
||||
List<String> colors,
|
||||
List<Float> positions,
|
||||
Integer angle
|
||||
String startColor, String endColor, List<String> colors, List<Float> positions, Integer angle
|
||||
) {
|
||||
|
||||
static Gradient from(MessageEnvelope.Story.TextAttachment.Gradient gradient) {
|
||||
|
||||
@ -8,10 +8,7 @@ import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "SyncReadMessage")
|
||||
record JsonSyncReadMessage(
|
||||
@Deprecated String sender,
|
||||
String senderNumber,
|
||||
String senderUuid,
|
||||
long timestamp
|
||||
@Deprecated String sender, String senderNumber, String senderUuid, long timestamp
|
||||
) {
|
||||
|
||||
static JsonSyncReadMessage from(MessageEnvelope.Sync.Read readMessage) {
|
||||
|
||||
@ -9,9 +9,7 @@ import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "SyncStoryMessage")
|
||||
record JsonSyncStoryMessage(
|
||||
String destinationNumber,
|
||||
String destinationUuid,
|
||||
@JsonUnwrapped JsonStoryMessage dataMessage
|
||||
String destinationNumber, String destinationUuid, @JsonUnwrapped JsonStoryMessage dataMessage
|
||||
) {
|
||||
|
||||
static JsonSyncStoryMessage from(MessageEnvelope.Sync.Sent transcriptMessage) {
|
||||
|
||||
@ -5,11 +5,7 @@ import io.micronaut.jsonschema.JsonSchema;
|
||||
import org.asamk.signal.manager.api.TextStyle;
|
||||
|
||||
@JsonSchema(title = "TextStyle")
|
||||
public record JsonTextStyle(
|
||||
String style,
|
||||
int start,
|
||||
int length
|
||||
) {
|
||||
public record JsonTextStyle(String style, int start, int length) {
|
||||
|
||||
static JsonTextStyle from(TextStyle textStyle) {
|
||||
return new JsonTextStyle(textStyle.style().name(), textStyle.start(), textStyle.length());
|
||||
|
||||
@ -8,9 +8,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
|
||||
@JsonSchema(title = "TypingMessage")
|
||||
record JsonTypingMessage(
|
||||
String action,
|
||||
long timestamp,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId
|
||||
String action, long timestamp, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId
|
||||
) {
|
||||
|
||||
static JsonTypingMessage from(MessageEnvelope.Typing typingMessage) {
|
||||
|
||||
@ -8,10 +8,7 @@ import java.util.UUID;
|
||||
|
||||
@JsonSchema(title = "UnpinMessage")
|
||||
public record JsonUnpinMessage(
|
||||
@Deprecated String targetAuthor,
|
||||
String targetAuthorNumber,
|
||||
String targetAuthorUuid,
|
||||
long targetSentTimestamp
|
||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||
) {
|
||||
|
||||
static JsonUnpinMessage from(MessageEnvelope.Data.UnpinMessage unpinMessage) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user