Skip to content

Commit

Permalink
Merge pull request #56 from Half-Shot/txn-id-fix
Browse files Browse the repository at this point in the history
Add timestamp to txn_id
  • Loading branch information
Half-Shot authored Oct 12, 2016
2 parents 8952320 + c2ce22f commit c28a846
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matrix_client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import json
import re
import requests
from time import time

try:
from urllib import quote
Expand Down Expand Up @@ -215,7 +216,7 @@ def send_message_event(self, room_id, event_type, content, txn_id=None):
txn_id(int): Optional. The transaction ID to use.
"""
if not txn_id:
txn_id = self.txn_id
txn_id = str(self.txn_id) + str(int(time() * 1000))

self.txn_id = self.txn_id + 1

Expand Down

0 comments on commit c28a846

Please sign in to comment.