Skip to content
Snippets Groups Projects
Verified Commit b735b011 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Use the raw millisecond value in the pong struct

parent 9b5cc4f2
No related branches found
No related tags found
No related merge requests found
...@@ -64,11 +64,12 @@ class MatrixBot ...@@ -64,11 +64,12 @@ class MatrixBot
plaintext = '%<sender>s: Pong! (ping%<msg>s took %<time>s to arrive)' plaintext = '%<sender>s: Pong! (ping%<msg>s took %<time>s to arrive)'
html = '<a href="https://matrix.to/#/%<sender>s">%<sender>s</a>: Pong! (<a href="https://matrix.to/#/%<room>s/%<event>s">ping</a>%<msg>s took %<time>s to arrive)' html = '<a href="https://matrix.to/#/%<sender>s">%<sender>s</a>: Pong! (<a href="https://matrix.to/#/%<room>s/%<event>s">ping</a>%<msg>s took %<time>s to arrive)'
milliseconds = (diff * 1000).to_i
formatdata = { formatdata = {
sender: sender.id, sender: sender.id,
room: room.id, room: room.id,
event: message.event_id, event: message.event_id,
time: duration_format((diff * 1000).to_i), time: duration_format(milliseconds),
msg: msgstr msg: msgstr
} }
...@@ -81,7 +82,7 @@ class MatrixBot ...@@ -81,7 +82,7 @@ class MatrixBot
msgtype: 'm.notice', msgtype: 'm.notice',
pong: { pong: {
from: from_id.homeserver, from: from_id.homeserver,
ms: formatdata[:time], ms: milliseconds,
ping: formatdata[:event] ping: formatdata[:event]
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment