Cobalt icon indicating copy to clipboard operation
Cobalt copied to clipboard

Unable to get ephemeralMessageDuration from chat with "disappearing chat messages" enabled

Open GDB4J opened this issue 6 months ago • 1 comments

I'm trying to send a message with a 'EphemeralExpiration' However to do so, you need to check the chat for 'ephemeralMessageDuration'

if(chat.ephemeralMessageDuration() != null && !chat.ephemeralMessageDuration().name().equalsIgnoreCase("OFF")) {
    if(chat.ephemeralMessageDuration().period().getSeconds() > 0) {
        var contextInfo = ContextInfo.empty().setEphemeralExpiration(
            ((Long) chat.ephemeralMessageDuration().period().getSeconds()).intValue());
        builder.contextInfo(contextInfo);
    }
}

This was working before (Whatsapp4J) in all cases.

It seems currently not possible anymore to get the ephemeralMessageDuration from a chat were "disappearing chat messages" is enabled (24h, 7d, 90d) If i'm looking at the chat.ephemeralMessageDuration() for a (group) chat with "disappearing chat messages" set to 24h I got:

chat.ephemeralMessageDuration() => null

were for a chat with "disappearing chat messages" set to 'Off' the chat.ephemeralMessageDuration() seems correct:

chat.ephemeralMessageDuration().name.equals("OFF") => true

Is there another way to find out if a (group) chat has "disappearing chat messages" enabled and on what duration it is set?

GDB4J avatar Jun 26 '25 20:06 GDB4J

Any update on this?

GDB4J avatar Sep 22 '25 19:09 GDB4J