Unable to get ephemeralMessageDuration from chat with "disappearing chat messages" enabled
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?
Any update on this?