aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-02-03 22:55:23 -0800
committerRyan Huber <rhuber@gmail.com>2015-02-03 22:55:23 -0800
commit0bb3f2d2e6fb7eb0e19a0b432364b15d08c5afc9 (patch)
treee432e92e362b1722be4a1e00ce272582d1926ee7 /wee_slack.py
parentefb190b4d059b706615d71a71faebfeb8dcce801 (diff)
downloadwee-slack-0bb3f2d2e6fb7eb0e19a0b432364b15d08c5afc9.tar.gz
debug message. set user agent to wee_slack
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 52ca048..dc3c3bd 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -733,7 +733,10 @@ def command_nodistractions(current_buffer, args):
hide_distractions = not hide_distractions
if distracting_channels[0] != "":
for channel in distracting_channels:
- w.buffer_set(channels.find(channel).channel_buffer, "hidden", str(int(hide_distractions)))
+ try:
+ w.buffer_set(channels.find(channel).channel_buffer, "hidden", str(int(hide_distractions)))
+ except:
+ dbg("Can't hide channel {}".format(channel), main_buffer=True)
def command_users(current_buffer, args):
@@ -1256,7 +1259,7 @@ def async_slack_api_request(domain, token, request, post_data, priority=False):
if not STOP_TALKING_TO_SLACK:
post_data["token"] = token
url = 'https://{}/api/{}'.format(domain, request)
- command = 'curl -s --data "{}" {}'.format(urllib.urlencode(post_data), url)
+ command = 'curl -A "wee_slack {}" -s --data "{}" {}'.format(SCRIPT_VERSION, urllib.urlencode(post_data), url)
context = pickle.dumps({"request": request, "token": token, "post_data": post_data})
w.hook_process(command, 20000, "url_processor_cb", context)