All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.whatsapp.model.info.NotificationMessageInfo Maven / Gradle / Ivy

There is a newer version: 0.0.7
Show newest version
package it.auties.whatsapp.model.info;

import it.auties.protobuf.annotation.ProtobufMessageName;
import it.auties.protobuf.annotation.ProtobufProperty;
import it.auties.protobuf.model.ProtobufMessage;
import it.auties.protobuf.model.ProtobufType;
import it.auties.whatsapp.model.message.model.ChatMessageKey;
import it.auties.whatsapp.model.message.model.MessageContainer;
import it.auties.whatsapp.util.Clock;

import java.time.ZonedDateTime;
import java.util.Optional;

@ProtobufMessageName("NotificationMessageInfo")
public record NotificationMessageInfo(
        @ProtobufProperty(index = 1, type = ProtobufType.OBJECT)
        ChatMessageKey key,
        @ProtobufProperty(index = 2, type = ProtobufType.OBJECT)
        MessageContainer message,
        @ProtobufProperty(index = 3, type = ProtobufType.UINT64)
        long messageTimestampSeconds,
        @ProtobufProperty(index = 4, type = ProtobufType.STRING)
        Optional participant
) implements Info, ProtobufMessage {
    /**
     * Returns when the message was sent
     *
     * @return an optional
     */
    public Optional messageTimestamp() {
        return Clock.parseSeconds(messageTimestampSeconds);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy