mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Implement receive handling for story messages
This commit is contained in:
parent
81e36d4f9b
commit
a593051512
12 changed files with 443 additions and 47 deletions
|
@ -20,13 +20,17 @@ record JsonDataMessage(
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSticker sticker,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonRemoteDelete remoteDelete,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) List<JsonSharedContact> contacts,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonGroupInfo groupInfo
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonGroupInfo groupInfo,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonStoryContext storyContext
|
||||
) {
|
||||
|
||||
static JsonDataMessage from(MessageEnvelope.Data dataMessage) {
|
||||
final var timestamp = dataMessage.timestamp();
|
||||
final var groupInfo = dataMessage.groupContext().isPresent() ? JsonGroupInfo.from(dataMessage.groupContext()
|
||||
.get()) : null;
|
||||
final var storyContext = dataMessage.storyContext().isPresent()
|
||||
? JsonStoryContext.from(dataMessage.storyContext().get())
|
||||
: null;
|
||||
final var message = dataMessage.body().orElse(null);
|
||||
final var expiresInSeconds = dataMessage.expiresInSeconds();
|
||||
final var viewOnce = dataMessage.isViewOnce();
|
||||
|
@ -67,6 +71,7 @@ record JsonDataMessage(
|
|||
sticker,
|
||||
remoteDelete,
|
||||
contacts,
|
||||
groupInfo);
|
||||
groupInfo,
|
||||
storyContext);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue