Skip to content

Commit

Permalink
Add m.relates_to support in pong response content.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk authored and tulir committed Dec 9, 2019
1 parent 4d3f4f1 commit e9b4cd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ async def ping_handler(self, evt: MessageEvent, message: str = "") -> None:
"from": evt.sender.split(":", 1)[1],
"ping": evt.event_id,
}
content["m.relates_to"] = {
"rel_type": "pong",
"event_id": evt.event_id,
"from": evt.sender.split(":", 1)[1],
"ms": diff,
}
await evt.respond(content)

@command.new("echo", help="Repeat a message")
Expand Down

0 comments on commit e9b4cd4

Please sign in to comment.