Skip to content

Commit c28a846

Browse files
authored
Merge pull request #56 from Half-Shot/txn-id-fix
Add timestamp to txn_id
2 parents 8952320 + c2ce22f commit c28a846

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matrix_client/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import json
1717
import re
1818
import requests
19+
from time import time
1920

2021
try:
2122
from urllib import quote
@@ -215,7 +216,7 @@ def send_message_event(self, room_id, event_type, content, txn_id=None):
215216
txn_id(int): Optional. The transaction ID to use.
216217
"""
217218
if not txn_id:
218-
txn_id = self.txn_id
219+
txn_id = str(self.txn_id) + str(int(time() * 1000))
219220

220221
self.txn_id = self.txn_id + 1
221222

0 commit comments

Comments
 (0)