XMPPFramework icon indicating copy to clipboard operation
XMPPFramework copied to clipboard

How to read Timestamp from message object?

Open mohdsafadsaal opened this issue 4 years ago • 2 comments

Hi,

I integrated XMPP framework. i was trying to read timestamp from XMPPMessage object.

i tried to get it from message.delayedDeliveryDate and message.delayedDeliveryFrom both are coming nil.

mohdsafadsaal avatar Feb 15 '21 11:02 mohdsafadsaal

Are you using the 203 extension?

https://github.com/robbiehanson/XMPPFramework/tree/master/Extensions/XEP-0203

https://xmpp.org/extensions/xep-0203.html

adozenlines avatar Mar 07 '21 02:03 adozenlines

You should create your date object as below:

let date = message.delayedDeliveryDate ?? Date()

If a message that is sent to an offline entity and stored for later delivery, then the delayedDeliveryDate will be set. Otherwise, nil. Therefore, you need to use the current date.

hamzaozturk avatar Mar 26 '21 09:03 hamzaozturk