aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
Commit message (Collapse)AuthorAgeFilesLines
* Set own nick to display name if setTrygve Aaberge2019-06-021-8/+14
| | | | | | Previously, own nick would always be set to the username. Fixes #692
* Set tag thread_message on thread messages printed in channelsTrygve Aaberge2019-06-021-4/+10
|
* Render "by invitation from" before reactionsTrygve Aaberge2019-06-021-38/+30
|
* Don't set nick_unknown tag if user isn't setTrygve Aaberge2019-06-021-1/+1
| | | | | | The only messages left that gets nick_unknown is messages in the team buffer and the "getting channel history" message. There's no point in setting nick_unknown for these.
* Set nick tag for join, leave and topic messagesTrygve Aaberge2019-06-021-3/+3
|
* Don't set channel specific tags by defaultTrygve Aaberge2019-06-021-7/+7
| | | | | We shouldn't set irc_privmsg and the others for all messages, just for normal messages in channels.
* Don't log backlog messages to the logfileTrygve Aaberge2019-06-021-1/+1
| | | | Fixes #663
* Store join/leave/topic messagesTrygve Aaberge2019-06-021-10/+12
|
* Separate the tags for join and leaveTrygve Aaberge2019-06-021-8/+4
| | | | | Replace irc_smart_filter with irc_join and irc_part. There is no smartness implemented, so irc_smart_tag shouldn't be set.
* Remove force_backlog from buffer_prntTrygve Aaberge2019-06-021-3/+3
| | | | | The "getting channel history" message doesn't need any of the logic in buffer_prnt, so by printing it directly, we can drop this argument.
* Support backlog tags for all tagsetsTrygve Aaberge2019-06-021-12/+12
| | | | | By sending in backlog as a separate argument to tag instead of as a tagset, we can mark all types of messages as backlog messages.
* Simplify process_subteam_updatedTrygve Aaberge2019-06-021-11/+6
|
* Move subteam created/updated functionsTrygve Aaberge2019-06-021-21/+24
|
* Remove redundant arguments and improve some variable namesTrygve Aaberge2019-06-021-81/+64
| | | | | | Mostly removes None as a second argument to .get(...), since that is the default value. Also replaces get with brackets a few places where get is not necessary.
* Set the self_msg tag on own messagesTrygve Aaberge2019-06-021-19/+18
|
* Set dm tags on threads in dmsTrygve Aaberge2019-06-021-11/+6
|
* Set nick tag for thread messagesTrygve Aaberge2019-06-021-2/+2
|
* Set conditions for muted channels on channel instead of messageTrygve Aaberge2019-06-021-10/+14
| | | | | Instead of setting tags on each message to prevent notify and highlights, set variables on the buffer to prevent it.
* Prevent highlight in debug bufferTrygve Aaberge2019-06-021-0/+1
|
* Allow %h (weechat home) replacement in download_location (#690)Daniel Lublin2019-06-011-1/+4
|
* Fix /topic command output (#691)luk13372019-05-291-1/+1
| | | | | * This change makes sure the /topic command outputs 'Topic for #random is ""' instead of 'Topic for #random is "{'value': ''}"'.
* Fix broken receive_httprequest_callback when record_events is trueTrygve Aaberge2019-05-231-2/+2
| | | | | | | | | | | When removing pickle in commit 3639342 I broke record_events without realizing it. record_events tries to json serialize the response dict, and that failed because that dict includes some metadata which without pickle is a class instead of a string. Fix it by recording the event before adding the metadata. I don't think there is much point in recording the metadata, and the serialized output from pickle wasn't practical anyways.
* Swap elif and else blocks in receive_httprequest_callbackTrygve Aaberge2019-05-231-5/+5
|
* Support regex flags i, m and sTrygve Aaberge2019-05-071-1/+5
|
* Release v2.3.0v2.3.0Trygve Aaberge2019-05-051-1/+1
|
* Update copyright noticeTrygve Aaberge2019-05-051-1/+4
| | | | | | | | I included it in the script as well, since it is included in the script in weechats repo. I also removed the coding comment from wee_slack.py since the file is in ascii.
* Support subteams in resolve_refTrygve Aaberge2019-05-051-0/+5
|
* Simplify resolve_refTrygve Aaberge2019-05-051-20/+10
|
* Increase pong timeout to 30 secondsTrygve Aaberge2019-05-051-1/+1
| | | | | | | | Even after the last two changes, I have still experienced a disconnect because of missing pong once where I think I possibly shouldn't have been disconnected. Hopefully 30 seconds is a good compromise between not disconnecting when it isn't necessary and not waiting too long before disconnecting a dead connection.
* Only check for pong responses when ping has been recently sentTrygve Aaberge2019-05-031-1/+5
| | | | | | | | With large teams on a slow computer, wee-slack may unfortunately hang for a while at times while processing data. When this happen, it doesn't get a chance to send pings. When it's finished processing, it previously might have disconnected if the pong checker runs before sending a ping, since it's a long time since a ping has been sent.
* Process the entire websocket queue in receive_ws_callbackTrygve Aaberge2019-05-031-24/+25
| | | | | | | | | | | | | | | | | | When we receive many lines over the websocket, receive_ws_callback seems to be called periodically (10 times per second or so) until all lines have been read. Since we previously only read one line per invocation of receive_ws_callback, it would take a long time to read all the lines. In addition to making events processed slower than necessary, this caused a problem for the pong watcher. Since the lines was processed so slow, it might take a long time until we process the pong message when the queue was large. This caused the script to disconnect the websocket since it didn't see the pong messages in time. To fix this, we run websocket receive in receive_ws_callback until there are no more messages. The messages are just added to the eventrouter queue, not processed right away, so this shouldn't cause performance issues.
* Reconnect if no pong is received for 12 secondsTrygve Aaberge2019-04-231-5/+19
| | | | | | | 12 seconds is a bit more than twice the amount of time between the pings we send. Fixes #238, fixes #480, fixes #561
* Don't connect to rtm multiple times simultaneouslyTrygve Aaberge2019-04-231-9/+11
|
* Call rtm.connect instead of rtm.start on reconnectTrygve Aaberge2019-04-231-5/+18
|
* Close websocket connection on shutdownTrygve Aaberge2019-04-231-0/+2
|
* Print connected message after websocket is connectedTrygve Aaberge2019-04-231-4/+4
|
* Connect explicitly in handle_rtmstartTrygve Aaberge2019-04-231-1/+2
| | | | Instead of waiting for reconnect_if_disconnected to call connect.
* Catch socket errors when sending pingTrygve Aaberge2019-04-231-2/+5
| | | | | | Also check that the team is connected before sending ping. Fixes #687
* Create helper for socket error handlingTrygve Aaberge2019-04-231-13/+16
| | | | | Changes send_to_websocket to handle the same errors as receive_ws_callback.
* Catch socket errors in receive_ws_callbackTrygve Aaberge2019-04-231-6/+11
|
* Various fixes for python 3Trygve Aaberge2019-04-081-3/+3
|
* Use raw strings for regexesTrygve Aaberge2019-04-081-4/+4
|
* Miscellaneous Python 3 compatibility fixesSamuel Holland2019-04-081-2/+9
|
* Don't use iter or view functionsTrygve Aaberge2019-04-081-17/+15
| | | | | | Python 3 doesn't have these functions, but returns iterables and views by default. For python 2 this may have a small performance impact, but probably not much.
* Make encode_to/decode_from_utf8 noop in python 3Trygve Aaberge2019-04-081-2/+6
| | | | | | | Python 3 receives unicode strings as arguments in weechat callbacks, websocet receive etc. and we can send unicode strings to weechat functions, websocket etc., so we don't need to do any of this converting.
* Implement the new comparison methods for SlackTSSamuel Holland2019-04-081-0/+15
| | | | | | Python 3 no longer respects __cmp__, as it has more fine-grained hooks for ordering/comparison. To minimize code changes, implement them in terms of the existing __cmp__ method.
* Make PluginConfig getattr compatible with Python 3Samuel Holland2019-04-081-7/+10
| | | | | | __getattr__ is expected to raise AttributeError, not KeyError. The removal of the call to hasattr() also speeds up fetch_setting().
* Make SHA1 hashing work on both Python 2 and 3Samuel Holland2019-04-081-5/+7
| | | | | Use sha1 from the hashlib module, and factor out a helper function that makes sure the argument to sha1 is a bytestring.
* Import urllib classes in a way compatible with Python 3Samuel Holland2019-04-081-2/+6
| | | | Try both the old and the new locations.
* Use StringIO from ioTrygve Aaberge2019-04-081-4/+1
| | | | | This is compatible with python 3, which StringIO from StringIO or cStringIO is not.