aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2014-10-02 14:23:51 -0700
committerRyan Huber <rhuber@gmail.com>2014-10-02 14:23:51 -0700
commit59673b97d4317619f9fa9ca46ab4db1c79802988 (patch)
tree5bd3d9d1ec0a3acb4162bfdea205d59284cd94c5
parente73b570c1802825f23dae544dac579a1a7a297b6 (diff)
downloadwee-slack-59673b97d4317619f9fa9ca46ab4db1c79802988.tar.gz
use float time for timestamps
-rw-r--r--wee_slack.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py
index eaa5d9b..7229c06 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -343,7 +343,7 @@ def slack_never_away_cb(data, remaining):
### Slack specific requests
def slack_mark_channel_read(channel_id):
- t = int(time.time())
+ t = time.time() + 1
if channel_id.startswith('C'):
reply = async_slack_api_request("channels.mark", {"channel":channel_id,"ts":t})
elif channel_id.startswith('D'):
@@ -352,7 +352,7 @@ def slack_mark_channel_read(channel_id):
def connect_to_slack():
global login_data, nick, connected, general_buffer_ptr, nick_ptr, name, domain
data = {}
- t = int(time.time())
+ t = time.time()
request = "rtm.start?t=%s" % t
data["token"] = slack_api_token
data = urllib.urlencode(data)
@@ -399,7 +399,7 @@ def create_slack_websocket(data):
#NOTE: switched to async/curl because sync slowed down the UI
def async_slack_api_request(request, data):
- t = int(time.time())
+ t = time.time()
request += "?t=%s" % t
data["token"] = slack_api_token
data = urllib.urlencode(data)
@@ -408,7 +408,7 @@ def async_slack_api_request(request, data):
return True
def slack_api_request(request, data):
- t = int(time.time())
+ t = time.time()
request += "?t=%s" % t
data["token"] = slack_api_token
data = urllib.urlencode(data)