aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
Commit message (Collapse)AuthorAgeFilesLines
* Only fetch members for joined channels, when getting historyTrygve Aaberge2020-05-251-12/+7
| | | | Fixes #775
* Show a colon between attachment fields title and valueTrygve Aaberge2020-05-251-7/+5
|
* Show typing indicators for dmsTrygve Aaberge2020-05-231-3/+8
|
* Remove kwargs from formatted_nameTrygve Aaberge2020-05-231-5/+5
| | | | This isn't necessary anymore.
* Combine channel rename methodsTrygve Aaberge2020-05-231-15/+6
| | | | | This fixes typing indicators for mpdms, which was previously not working.
* Use user instead of slack_name for users.infoTrygve Aaberge2020-05-221-1/+1
| | | | | | users.info takes the id, not the name of the user. This worked in practice before this change because it was only called for unknown users, and unknown users gets the name set to the id.
* Use name instead of slack_name for displayTrygve Aaberge2020-05-221-2/+2
| | | | | | | A few places used slack_name when displaying the name to the user. name should be used instead because tincludes the correct prefix. The first place was just for dms though which doesn't have a prefix, so that won't show any difference.
* Only set typing indicator in short_nameTrygve Aaberge2020-05-221-1/+1
| | | | | | | | We shouldn't change the full name for typing indicators because autosort will reorder the buffer, and it may break scripts using the full name. We didn't show typing indicator until the previous commit anyways, because the full name was never updated until that.
* Change name (i.e. full name) when renaming channel/thread bufferTrygve Aaberge2020-05-221-4/+10
|
* Remove unnecessary enable_color parameterTrygve Aaberge2020-05-221-7/+8
| | | | | formatted_name checks if colors should be enabled, so it's not necessary to send it in as a parameter as well.
* Only call channel.refresh when neededTrygve Aaberge2020-05-221-51/+30
| | | | | There was some mechanism for this, but it wasn't used. Replaced the old unused mechanism with a new one.
* Use formatted_name to set channel.nameTrygve Aaberge2020-05-221-26/+10
|
* Use if/else instead of a dict in formatted_nameTrygve Aaberge2020-05-221-27/+30
| | | | | | | | | | | I mainly did this because I'm going to call formatted_name with style=default before team is set, and that didn't work as it was because the other styles used the team. For SlackDMChannel I moved colorizing into the branch for the sidebar style because colors should never be included in the other styles. formatted_name is never called with enable_color=True and another style than sidebar, so the behavior doesn't change.
* Move channel type into init argumentsTrygve Aaberge2020-05-221-13/+8
|
* Remove unused formatted_name stylesTrygve Aaberge2020-05-221-6/+0
|
* Increase typing durationTrygve Aaberge2020-05-221-4/+7
| | | | | | | | Slack only sends typing notices every 5-6 seconds, so when we expired them after 4, a user which continously typed a message would disappear from the typing bar every 4 seconds and appear again after a second. Now they are shown continously, and for about the same duration as the web client.
* Make SlackThreadChannel.members a propertyTrygve Aaberge2020-05-211-1/+4
| | | | | SlackChannel.members is overwritten in set_members and user_joined, so it could become stale when it was an attribute.
* Remove get_members method, use members attributeTrygve Aaberge2020-05-211-7/+2
| | | | | Lots of places used members instead of get_members, and it's inconvenient having to call a function anyways.
* Remove unused unset_typing methodTrygve Aaberge2020-05-211-6/+0
| | | | We don't receive any event when a user has stopped typing.
* If message has blocks, only render blocks unless rich_text is presentTrygve Aaberge2020-05-131-7/+16
| | | | | | | | | Slack doesn't render the `text` property at all when `blocks` is non-empty, so we shouldn't render both `text` and `blocks`. However, because we don't support the `rich_text` block type yet, we have to fall back to the `text` property when `rich_text` is present. Therefore, render both `text` and `blocks` if `rich_text` is present, else render only `blocks` if it is non-empty, and only `text` if `blocks` is empty.
* Don't use fallback when rendering messageTrygve Aaberge2020-05-131-6/+1
| | | | | I don't think this exists anymore, and we support rendering markdown so we shouldn't use fallback anyways.
* More robust handling of file modes (#771)Will Boyd2020-05-111-2/+7
| | | | | | | | | | | | Previously, files with a mode other than "tombstone" were assumed to have a "title" and "private_url". This is not necessarily the case; in particular, files with the "hidden_by_limit" (removed from visibility because the workspace has exceeded its free-tier storage limit) mode have *only* "id" and "mode". This resulted in a KeyError trying to look up the "title" and "private_url", and truncated history at the message with that file. This commit explicitly handles "hidden_by_limit" files, and makes the handling of any other unknown modes more robust by explicitly checking for "title" and "private_url" before rendering a message with them.
* Release v2.6.0v2.6.0Trygve Aaberge2020-05-061-1/+1
|
* Improve description for (un)subscribe commandsTrygve Aaberge2020-05-061-2/+2
|
* Document usage of session tokensTrygve Aaberge2020-05-051-4/+14
| | | | Fixes #764
* Fix /slack register not working after API changeTrygve Aaberge2020-05-051-12/+35
| | | | | | | | | | | | | | Slack now disallows # in OAuth redirect uris, so we can't use it to prevent GitHub Pages from seeing the OAuth code anymore. Since the OAuth code is only valid once and expire after 10 minutes, I don't think it's a problem that they are exposed to GitHub Pages, so this is the new default so the same registration process can be kept. However, for people worried about this, there's a new -nothirdparty option to /slack register which can be used which doesn't expose the code. Fixes #766
* Check if message_json["ts"] exists in process_messageTrygve Aaberge2020-05-051-1/+1
| | | | | For deleted message events, this field may not exist (e.g. when a giphy preview is deleted).
* Include return_code in error from receive_httprequest_callbackTrygve Aaberge2020-05-051-2/+2
|
* Don't prevent default completion in /reply and /slack talkTrygve Aaberge2020-05-051-2/+2
| | | | | | | | | /reply takes a message, so default completion should work there. /slack talk only takes one argument with a comma separated list of nicks, so technically preventing default completion is correct for that. However, until we support completing multiple nicks separated by comma, preventing completion of nicks as additional arguments makes it inconvenient to use.
* Use reply_count instead of repliesTrygve Aaberge2020-05-051-1/+1
| | | | | The replies property doesn't exist anymore, it has been replaced by reply_users and reply_users_count.
* Print error message when changing a message failsTrygve Aaberge2020-04-291-1/+14
|
* Add note about files_download_location requiring WeeChat >= 2.2Trygve Aaberge2020-04-241-1/+1
| | | | Relates to #767
* Fix completion for /slackTrygve Aaberge2020-04-221-1/+1
| | | | | | | | | | | Completion for our commands can't use || because they can be used as subcommands for /slack and weechat doesn't support multiple templates with the same subcommand. See https://github.com/weechat/weechat/issues/1481 This makes the completion for /reply slightly incorrect. It now allows you to complete two thread arguments when not using -alsochannel. To fix that, we would have to write a custom completion function. It's not hard, but I'm not sure it's worth the effort for such a small detail.
* Fix debug buffer not being created on script loadTrygve Aaberge2020-04-201-3/+3
| | | | This bug was introduced in commit b2618af.
* Fix bug preventing editing message without any identifierTrygve Aaberge2020-04-201-1/+1
| | | | This was broken in the previous commit, be5d890.
* Fix completion for /slack statusTrygve Aaberge2020-04-191-11/+12
| | | | | | Previously, the emoji completion only returned emojis if you tried to complete after typing a :. This prevented it to be used in commands without typing : first.
* Prevent default completion from being used at the end of commandsTrygve Aaberge2020-04-191-9/+9
|
* Support newlines in the /topic commandTrygve Aaberge2020-04-191-15/+11
| | | | Fixes #728
* Support multiline input commandsTrygve Aaberge2020-04-191-6/+5
| | | | Relates to #728
* Don't read all options when one changesTrygve Aaberge2020-04-191-4/+9
|
* Add a variable for config prefixTrygve Aaberge2020-04-191-2/+4
|
* Prevent errors after running /upgradeTrygve Aaberge2020-04-181-3/+10
| | | | | | | | | | | | | After running /upgrade, all the buffers will still exist, but the script is stopped and run again, so all the state in the script will be gone. This causes a bunch of errors because buffers can't be created and the script won't know about the existing buffers. Instead of loading the script normally, print a note that wee-slack will not work until it's reloaded. I didn't take the effort to make it work automatically, because it should be easy for users just to reload it. Fixes #275, fixes #309, fixes #310
* Don't connect to the teams if auto connect is disabledTrygve Aaberge2020-04-181-10/+11
| | | | Fixes #613
* Set members from groups.infoTrygve Aaberge2020-04-161-0/+1
|
* Support toggling a reaction by right clicking on an emoji or emoji nameTrygve Aaberge2020-04-121-26/+51
| | | | | | | | | | | | | | | | | | | If you right click on an emoji or an emoji name in a message, that emoji will be either added as a reaction, or removed if you already have reacted with it. This allows you to easily react with the same reactions as others have used. If you click anywhere else on a message, the message hash is inserted in the input field as before. For emoji names you have to click on the first colon. This is partly because it was easier to implement, and partly because I'm going to trigger this using the keyboard (using https://github.com/trygveaa/kitty-hints-mouse-click), so I don't have a need for clicking other places on the emoji name. If you want to keep the old behavior of inserting the message hash in the input field no matter where you click on the message, change the binding for right click to hsignal:slack_cursor_message, like this: /key bindctxt mouse @chat(python.*):button2 hsignal:slack_cursor_message
* Print stacktrace if config getter failsTrygve Aaberge2020-04-121-0/+1
|
* Add an option to control thread notificationsTrygve Aaberge2020-04-121-10/+21
|
* Don't notify about threads when they're opened in the channel (#763)Zachary Ware2020-04-121-0/+3
|
* Place record_events files in separate directories for each teamTrygve Aaberge2020-04-101-6/+15
|
* Set team in message_json after recording eventTrygve Aaberge2020-04-101-1/+1
| | | | | | | | | | | | | SlackTeam can't be json serialized, so this broke record_events. I broke this in commit 324890c when I changed from storing the team hash on the message_json to storing the team. You can't currently see which team the message is from, but you couldn't really with the team hash either since the relation between the team and the team hash is not printed anywhere. I will add a better way to see which team the message is from in the next commit. Fixes #761