Skip to content

MessageReceivedV2 does not contain attachments #1895

@UQuark

Description

@UQuark

It seems like MessageReceivedV2 is sent without attachments, as opposed to MessageReceived which is sent properly.

Please compare these signal bodies:

MessageReceived: [1766395713917,"8fe59ea5-c0d8-4e14-bb2b-3fa5b8f8a4ec","","",["/home/uquark/.local/share/signal-cli/attachments/LN8GvhPhPz3tDLmtvqq0.jpg"]

MessageReceivedV2: [1766395713917,"8fe59ea5-c0d8-4e14-bb2b-3fa5b8f8a4ec","","",{"attachments":{},"expiresInSeconds":{},"isViewOnce":{}}]

In code, I can see construction of the body:

    private HashMap<String, Variant<?>> getMessageExtras(MessageEnvelope.Data message) {
        var extras = new HashMap<String, Variant<?>>();
        if (!message.attachments().isEmpty()) {
            var attachments = message.attachments()
                    .stream()
                    .filter(a -> a.id().isPresent())
                    .map(this::getAttachmentMap)
                    .toList();
            extras.put("attachments", new Variant<>(attachments, "aa{sv}"));
        }
...

attachments here is an array of Attachment records. I am not intimately familiar with DBus type signatures, but it seems like aa{sv} is not correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions