Project

General

Profile

No Server time in the message

william wang
Added over 4 years ago

My Client(iOS,android) received message from tigase server,but no server time in the message. How to set up tigase server.

Tigase version:tigase-server-5.2.1-b3461

init.properties list:

config-type = --gen-config-def
--virt-hosts = mydomain.com
--user-db-uri = jdbc:postgresql://db1/tigasedb?user=tg&password=tg
--user-db = pgsql
--data-repo-pool-size = 200
--auth-repo-pool-size = 200
--user-repo-pool-size = 200
--admins = admin@mydomain.com
--cluster-mode = true
--monitoring = jmx:9050
--sm-plugins = +message-archive-xep-0136=16,+msgoffline
--comp-name-1 = muc
--comp-class-1 = tigase.muc.cluster.MUCComponentClustered
--comp-name-2 = pubsub
--comp-class-2 = tigase.pubsub.PubSubComponent
--comp-name-3 = proxy
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-name-4 = message-archive
--comp-class-4 = tigase.archive.MessageArchiveComponent

Replies (4)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Tigase (and I think majority of XMPP servers) doesn't include server time in the stanzas sent from server to client.

Could you elaborate on how would you imagine such feature and what would be the purpose?

Added by william wang over 4 years ago

I have such a scene, Client received the message and displayed in the window, Client A local time setting error, Client B local time setting is right, A and B talking each other. Now,In the Window, the received message order by time displayed, then :

A 2014-6-1 22:05 
A 2014-6-1 22:07
A 2014-6-1 22:09
                 B 2014-6-9 22:05 
                 B 2014-6-9 22:07
                 B 2014-6-9 22:09

I think,if Server time in the message

then

A 2014-6-9 22:05 
                 B 2014-6-9 22:05  
A 2014-6-9 22:07
                 B 2014-6-9 22:07
A 2014-6-9 22:09             
                 B 2014-6-9 22:09

Thanks for your reply!

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Server doesn't include any timestamp in the messages. What client application do you use? is it stamping messages with the time? Does it query other entity for local time and marks the incoming messages with it?

From the specification point of view there is only exchange of the @ stanza which is, upon receiving, displayed with the local time of the given client. Described above discrepancy stems from the fact that both parties stamps their messages with local time, but without more information it's hard to say more.

Added by william wang over 4 years ago

I have found a way to get around this issue.I got the server time from http header, Client and server from this point onwards calculate the time difference.

    (1-4/4)