Opened 6 years ago

Closed 6 years ago

#4920 closed defect (fixed)

Show correct timestamp for lobby chat backlog

Reported by: Dunedan Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: Multiplayer lobby Keywords:
Cc: Patch: Phab:D1197

Description

Currently the chat backlog when joining the lobby is shown with the timestamp of joining, instead of the original timestamp. That's probably, because the <delay> element of the MUC messages isn't handled.

A MUC message received while being online looks like:

<message from="arena@conference.localhost/john" type="groupchat" xml:lang="en" to="jane@localhost/abc">
<body>test</body>
</message>

A MUC message received while being offline is replayed with an additional <delay> element, which contains the timestamp when the message was sent by its sender:

<message from="arena@conference.localhost/john" type="groupchat" xml:lang="en" to="jane@localhost/abc">
<delay xmlns="urn:xmpp:delay" from="arena@conference.localhost" stamp="2017-12-31T09:39:27.041210Z"/>
<body>test</body>
</message>

Change History (6)

comment:1 by Dunedan, 6 years ago

Seems to be only be an issue with recent ejabberd versions. I'll check what exactly changed.

comment:2 by Dunedan, 6 years ago

Turns out the only difference between the old ejabberd version in use by the 0ad lobby and newer ejabberd versions is that the old version sends out delay information according to the deprecated XEP-0091 and the current XEP-0203, while newer ejabberd versions only include XEP-0203-compatible delay information. According to the gloox-documentation it should automatically handle both, but apparently something doesn't work there. I'm still not sure why, especially as the 0ad related code seems to be made for XEP-0203 anyway.

For reference, such an older ejabberd message looks like:

<message from="arena@conference.localhost/john" type="groupchat" xml:lang="en" to="jane@localhost/abc">
<delay xmlns="urn:xmpp:delay" from="arena@localhost" stamp="2018-01-04T20:42:10Z"/>
<x xmlns="jabber:x:delay" stamp="20180104T20:42:10"/>
<body>test</body>
</message>

comment:3 by elexis, 6 years ago

Milestone: BacklogWork In Progress
Patch: Phab:D1197

According to the ​gloox-documentation it should automatically handle both, but apparently something doesn't work there

So one should report it upstream, possibly with a small patch. One of ours had been merged upstream already quickly.

comment:4 by Dunedan, 6 years ago

Hmpf, seems like my original comment got lost thanks to the Trac update.

So one should report it upstream, possibly with a small patch. One of ours had been merged upstream already quickly.

It's no bug in gloox at all. According to XEP-0082 CCYY-MM-DDThh:mm:ssTZD as well as CCYY-MM-DDThh:mm:ss.sssTZD are allowed. Without D1197 0ad only handles the former properly.

comment:5 by elexis, 6 years ago

Milestone: Work In ProgressAlpha 23
Priority: Nice to HaveShould Have

Thanks

comment:6 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 20776:

Support both DateTime formats of XEP-0082 in the lobby, refs #3156, rP16507, rP19801, rP20032.

Patch By: Dunedan
Fixes #4920.
Differential Revision: https://code.wildfiregames.com/D1197

Note: See TracTickets for help on using tickets.