add group info on json message

This commit is contained in:
Jailson Dias 2024-10-24 17:27:51 -03:00 committed by Sebastian Scheibner
parent 5646f65195
commit eac2a47163
5 changed files with 22 additions and 11 deletions

View file

@ -2,6 +2,7 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.api.GroupId;
import org.asamk.signal.manager.api.MessageEnvelope;
import org.asamk.signal.manager.api.RecipientAddress;
@ -23,9 +24,9 @@ record JsonSyncMessage(
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncMessageType type
) {
static JsonSyncMessage from(MessageEnvelope.Sync syncMessage) {
static JsonSyncMessage from(MessageEnvelope.Sync syncMessage, Manager m) {
final var sentMessage = syncMessage.sent().isPresent() && syncMessage.sent().get().story().isEmpty()
? JsonSyncDataMessage.from(syncMessage.sent().get())
? JsonSyncDataMessage.from(syncMessage.sent().get(), m)
: null;
final var sentStoryMessage = syncMessage.sent().isPresent() && syncMessage.sent().get().story().isPresent()
? JsonSyncStoryMessage.from(syncMessage.sent().get())