Skip to content

Commit

Permalink
Add timestamp to txn_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Oct 11, 2016
1 parent 023033c commit 5de3ab7
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 = self.txn_id + int(time() * 1000)

self.txn_id = self.txn_id + 1

Expand Down

0 comments on commit 5de3ab7

Please sign in to comment.