aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Don't set label when changing buffer nameTrygve Aaberge2020-06-201-1/+2
| | | | | This caused a bug where the short_name got a double prefix, because the label was set to the short_name which wasn't changed.
* Show blocks in attachmentsTrygve Aaberge2020-06-161-2/+5
|
* Support colorizing attachment prefix or lineTrygve Aaberge2020-06-165-2/+49
| | | | | | | | | Thanks to @Informatic for the initial implementation of this in PR #426. I have seen that most attachment colors are without the leading #, but a few does include it, so we have to handle it. Fixes #424, closes #426
* Assert color values in testsTrygve Aaberge2020-06-144-5/+10
|
* Include a prefix character in front of attachmentsTrygve Aaberge2020-06-142-43/+45
|
* When changing last message, print new lines if neededTrygve Aaberge2020-06-141-6/+40
| | | | | | | | WeeChat doesn't support inserting new lines apart from at the bottom, so normally when a message is changed to contain more lines, it is not shown properly until the buffer is redrawn. However, if the message that's being changed is the last one, we can insert new lines so it's shown properly.
* Don't set no_highlight for backlog messagesTrygve Aaberge2020-06-141-2/+2
| | | | | Now that we don't run print hooks for backlog messages, we can keep highlights without triggering anything else.
* Support unsetting buffer labelTrygve Aaberge2020-06-141-2/+4
|
* Change thread short name prefix to $Trygve Aaberge2020-06-141-1/+1
| | | | | | | The + prefix is used for presence in dm channels, so it's easier to distinguish threads by using a different character. $ is used for message ids, which is how the threads are named by default, so I thought that was natural.
* Use buflist.format.indent for thread short name indentTrygve Aaberge2020-06-141-1/+2
|
* Refactor to if/else for SlackThreadChannel.formatted_nameTrygve Aaberge2020-06-141-6/+8
|
* Include channel name in thread localvar channelTrygve Aaberge2020-06-141-1/+1
|
* Set label to short_name when short_name is setTrygve Aaberge2020-06-141-0/+19
| | | | Fixes #563
* Move common destroy_buffer code to SlackChannelCommonTrygve Aaberge2020-06-121-6/+7
|
* Fix parameter names for signal hooksTrygve Aaberge2020-06-121-12/+10
|
* Support /label for channelsTrygve Aaberge2020-06-112-15/+19
| | | | Relates to #563
* Rename thread full name even when label is setTrygve Aaberge2020-06-111-2/+3
| | | | | Label is only for the short_name, so we should always rename the full name.
* Simplify message type check in prnt_messageTrygve Aaberge2020-06-101-2/+2
|
* Fix thread broadcasts not being reprinted in channelTrygve Aaberge2020-06-101-2/+3
|
* Fix broken tests on Python 2Trygve Aaberge2020-06-071-0/+3
| | | | The tests were broken in commit 855cf3c.
* Fix parameters for SlackPrivateChannel.get_historyTrygve Aaberge2020-06-071-2/+2
| | | | This was broken in commit cd888c2.
* Set history_needs_update when receiving historyTrygve Aaberge2020-06-071-0/+3
| | | | | | | | | If wee-slack looses connection to the server while a history request is in the queue and reconnects before the history response is received, it will set history_needs_update to True and call get_history, but since a history request is pending, a new one won't be triggered so history_needs_update will remain True. Setting history_needs_update to False when receiving the history fixes this.
* On load, fetch history after connected to websocketTrygve Aaberge2020-06-071-9/+7
| | | | | | | | | | | | | | | | The websocket url is only valid for 30 seconds. If wee-slack didn't manage to connect in time, it would set history_needs_update and reconnect, but not load history again which meant that each channel would load history when you switched to the buffer. I also think there was a slight chance of a message being sent in the time between history loading and connecting to the websocket, which I think would mean it would be lost. By fetching history after connecting to the websocket, this can't happen. Lastly, by not fetching history before connecting to the websocket, I think there is less chance of not connecting to the websocket url before it expires.
* Disable print hooks when printing old/debug messagesTrygve Aaberge2020-06-071-0/+11
| | | | Fixes #629, fixes #756
* Remove try/except in buffer_prntTrygve Aaberge2020-06-071-10/+7
| | | | | There shouldn't be any exceptions here. If there are, we shouldn't catch them, so we can notice and fix them.
* Set tags in deterministic order with slack_ts firstTrygve Aaberge2020-06-071-19/+19
| | | | | | | Since we look up the message ts from the tags as of the last commit, we should place the ts tag first so we don't have to loop through the other tags when finding it. This should make it a bit faster to find a message, especially when we have to search through many lines.
* Store message ts in line tags instead of misusing date_printedTrygve Aaberge2020-06-072-41/+28
| | | | Fixes #514
* Rename buffers from team.slack.com to slack.teamTrygve Aaberge2020-06-071-1/+1
| | | | Fixes #709
* Refactor setting team nameTrygve Aaberge2020-06-071-18/+19
|
* Remove fixed issue from known issuesTrygve Aaberge2020-06-061-4/+0
| | | | This was fixed in commit ad1a715.
* Merge pull request #774 from trygveaa/history-after-reconnectTrygve Aaberge2020-06-066-388/+663
|\ | | | | Automatically reload history after reconnect
| * Prevent multiple thread notifications when mentionedTrygve Aaberge2020-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | There are two situations where notify_thread is called multiple times where we only want to notify once. One is when we load history for a thread which has multiple unread messages, the other is when you become subscribed to a thread because you are mentioned in it. For the first case, we want to set last_notify to now, so we don't notify for the rest of the unread messages following the first. For the second, the message ts may be greater than now (same second, but greater minor part), so we want to set last_notify to the message ts. Therefore we set last_notify to max of these two.
| * Fetch message replies if subscribed latest_reply > last_readTrygve Aaberge2020-06-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When using conversations.history (which doesn't include replies), we want to fetch the replies for a thread even if thread_messages_in_channel is off if the user is subscribed to the thread and it has unread messages, so we can notify for new replies. Technically, we could notify without fetching the history, but it's easier to just fetch the history so the normal notification check is run, and when the thread has unread messages, the user probably wants to read them, so it's nice that they don't have to wait for history when opening the thread.
| * Set last_read when (un)subscribing to a threadTrygve Aaberge2020-06-041-2/+3
| | | | | | | | | | | | | | | | | | When you subscribe to a thread, I think it's safe to assume that you have read the messages or want to treat the messages as read, and this is what the web client does. I'm not sure what the point of sending last_read for unsubscribe is, but the web client does so, and it was easiest to do it for both.
| * Only mark subscribed threads as readTrygve Aaberge2020-06-041-0/+2
| | | | | | | | | | Slack doesn't support marking unsubscribed thread as read (it responds `message_not_found`).
| * Make history fetch count configurableTrygve Aaberge2020-06-042-3/+14
| | | | | | | | Fixes #376
| * Don't call buffer_clear on destroy_bufferTrygve Aaberge2020-06-041-5/+1
| | | | | | | | | | When destroy_buffer is called, the buffer will be closed, so there isn't any point in clearing it.
| * Mark thread as read when closing bufferTrygve Aaberge2020-06-041-0/+2
| |
| * Use max_buffer_lines_number instead of hard codingTrygve Aaberge2020-06-042-2/+4
| |
| * Refactor message id handlingTrygve Aaberge2020-06-041-91/+93
| | | | | | | | | | | | This creates a common method for getting a message from a message hash or count. Since all commands now use the same method, all commands that accepts a hash now also accepts a count.
| * Include thread messages in command countsTrygve Aaberge2020-05-301-14/+16
| |
| * Fetch thread when receiving a thread message and parent is not foundTrygve Aaberge2020-05-301-15/+24
| | | | | | | | Fixes #619, fixes #754
| * Use ts instead of count to limit visible_messagesTrygve Aaberge2020-05-301-10/+20
| | | | | | | | | | | | | | When fetching replies for older threads, the messages in the thread older than the first message we fetched from history would be displayed in the buffer. We don't want these to be displayed, because there may be other messages in between which we haven't fetched.
| * Rerender thread messages when hash changesTrygve Aaberge2020-05-301-0/+2
| | | | | | | | | | This is necessary for thread messages rendered in the channel, either broadcast messages or when thread_messages_in_channel is on.
| * Fix broadcast messages not being changed in parent channelTrygve Aaberge2020-05-301-1/+2
| |
| * Don't fall back to ts for thread hashTrygve Aaberge2020-05-301-6/+8
| | | | | | | | | | | | We don't allow the ts to be used in commands, so it doesn't make sense to fall back to it. After the latest commits, hash is always available, so just use that.
| * Use parent channels hashed_messages in SlackThreadChannelTrygve Aaberge2020-05-301-1/+4
| |
| * Store ts -> hash mapping in hashed_messagesTrygve Aaberge2020-05-302-52/+50
| | | | | | | | | | This is so we can show the hash for a thread message when the parent message isn't fetched.
| * Notify for newly subscribed threadsTrygve Aaberge2020-05-301-2/+12
| | | | | | | | | | | | | | | | | | When you receive a new thread message on one of your messages that's not already a thread you may get the subscribed event after the message event. Previously, that meant you would not get a notification, because notify_thread ran in process_message, before you were subscribed. Run notify_thread in process_thread_subscribed too to ensure we notify for these messages.
| * Refactor notify_thread methodTrygve Aaberge2020-05-301-15/+18
| |