Cobalt icon indicating copy to clipboard operation
Cobalt copied to clipboard

Unable to download full image / document content

Open GDB4J opened this issue 2 months ago • 6 comments

Hi,

I'm using version 0.0.10 (java 21) And trying to send a image message to a contact

my code:

        var chat = whatsAppApi.store()
            .findChatByName("contactname")
            .orElseThrow(() -> new NoSuchElementException("Chat does not exist!"));
        var media = Files.readAllBytes(Path.of("C:\\whatsapp\\test.jpg"));
        var imageMessageBuilder = new ImageMessageSimpleBuilder() // Create a new image message builder
            .media(media) // Set the image of this message
            .mimeType("image/jpeg")
            .caption("test image");
        var image = imageMessageBuilder.build();
        whatsAppApi.sendMessage(chat,image).join();

I am (the contactname) receiving the image in a preview status: (preview seems correct) Image

But it's unable to download the full image itself. When i try to download i got the message (translated) Unable to download image. Please try again. Turn off Wi-Fi or VPN, or connect to a different Wi-Fi network if the issue persists.

I have also tested this with the DocumentMessageSimpleBuilder, same behavior. I'm able to retrieve the message but unable to actual download the document itself.

Am i missing something here?

Thanks for helping me out of this!!

GDB4J avatar Oct 15 '25 20:10 GDB4J

Hi, I am facing the same issue, did you find any solutions or workaround for this?

NotaCoder20 avatar Dec 10 '25 15:12 NotaCoder20

Hey @NotaCoder20 , Unfortunately not, and it is unlikely that this will be fixed in the current release / stack. This is due to the status of the current master branch, which is Java 25 and contains a whole series of refactoring packages / content / logic / ...

I am currently looking more at the master branch, but unfortunately, sending a message has not yet been implemented and nothing works at the moment as sending is concerned. https://github.com/Auties00/Cobalt/blob/c2392d9af6c2c96fb8fa2a7f88f6c6c80d3c75c6/src/main/java/com/github/auties00/cobalt/client/WhatsAppClient.java#L1689

    // TODO: Implement message sending
    private <T extends MessageInfo> T sendMessage0(T info, Map<String, ?> attributes) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

I have also been blocked by this for a while, as no version seems to work (able to send a image correctly) at the moment. Any help is welcome.

@Auties00 I'm also willing to help if possible, hence my request: https://github.com/Auties00/Cobalt/discussions/661

GDB4J avatar Dec 10 '25 19:12 GDB4J

Hey @GDB4J Thanks for the update, I was able to make normal send message work with the help of examples but not for the images, I am trying https://github.com/WhiskeySockets/Baileys you can maybe try this as well if sending media is blocker for you.

NotaCoder20 avatar Dec 10 '25 21:12 NotaCoder20

Hey @NotaCoder20 , Unfortunately not, and it is unlikely that this will be fixed in the current release / stack. This is due to the status of the current master branch, which is Java 25 and contains a whole series of refactoring packages / content / logic / ...

I am currently looking more at the master branch, but unfortunately, sending a message has not yet been implemented and nothing works at the moment as sending is concerned.

Cobalt/src/main/java/com/github/auties00/cobalt/client/WhatsAppClient.java

Line 1689 in c2392d9

throw new UnsupportedOperationException("Not yet implemented"); // TODO: Implement message sending private <T extends MessageInfo> T sendMessage0(T info, Map<String, ?> attributes) { throw new UnsupportedOperationException("Not yet implemented"); } I have also been blocked by this for a while, as no version seems to work (able to send a image correctly) at the moment. Any help is welcome.

@Auties00 I'm also willing to help if possible, hence my request: #661

You have to fork the repo, clone your repo, push to your repo and then you will be able to open a PR

Auties00 avatar Dec 11 '25 18:12 Auties00

by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right

Auties00 avatar Dec 11 '25 18:12 Auties00

You have to fork the repo, clone your repo, push to your repo and then you will be able to open a PR

Thx, open PR: https://github.com/Auties00/Cobalt/pull/663


by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right

Thanks! Would be very nice if this would work again!!

GDB4J avatar Dec 14 '25 20:12 GDB4J

@Auties00

by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right

Hey! Quick check on the message sending release to master — have you already started working on it (e.g., a branch or draft PR)? Also, do you have a rough ETA (days vs weeks)? Totally understand LID handling is tricky — we just need an approximate timeline to plan.

Lopamoko avatar Dec 18 '25 13:12 Lopamoko