aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Keep necessary messages beyond SCROLLBACK_SIZETrygve Aaberge2020-05-301-48/+109
|
* Move store_message back into subprocess functionsTrygve Aaberge2020-05-301-4/+7
| | | | | | | | | | In subprocess_thread_message we need to store the message before calling notify_thread, so storing it after the function returned didn't work. This is because when auto_open_threads is on and you get a new message, it will open the thread and print the messages immediately, which will fail because the message ts has been added to submessages, but the message has not been stored yet.
* Check if channel_buffer exists in reprint_messagesTrygve Aaberge2020-05-301-3/+4
| | | | | | | | After thread buffers are closed, the instances still remains in channel.thread_channels, but channel_buffer is set to None. reprint_messages may be called after this, e.g. on a reconnect. Therefore, we have to check if channel_buffer is set before calling buffer_clear.
* Include parent_message in SlackThreadChannel.messagesTrygve Aaberge2020-05-301-18/+18
|
* Fix the parent message in a thread buffer not being changedTrygve Aaberge2020-05-301-2/+3
|
* Set hashed_messages[message.hash] if not present in hash_messageTrygve Aaberge2020-05-301-31/+34
| | | | | | | A channel and a thread channel in that channel has the same message instances, but different hashed_messages dictionaries. Therefore, message.hash may be set, without it being present in hashed_messages. Insert it into hashed_messages in hash_message if that is the case.
* Load history for current buffer after connectingTrygve Aaberge2020-05-301-9/+9
| | | | | | | If you have a stored layout so one of the wee-slack buffers gets switched to when it's created, the history for that channel wouldn't be loaded until you switched buffers if background_load_all_history was off.
* Support slow_queue in SlackThreadChannel.get_historyTrygve Aaberge2020-05-301-2/+5
|
* In connect, don't catch exceptions from set_connectedTrygve Aaberge2020-05-301-5/+5
|
* Sort submessages after appending to itTrygve Aaberge2020-05-301-0/+1
| | | | | I don't think we ever receive thread messages out of order, so this probably isn't strictly necessary, but it is a bit safer just in case.
* Only append to submessages if ts isn't thereTrygve Aaberge2020-05-301-1/+2
| | | | | | | I don't think we would ever get the same thread message twice (unless we call /rehistory -remote, but that processes the parent message again too, so submessages is created again), but it is more robust to only append ts's which are not in the list already.
* Only return the thread messages from SlackThreadMessage.messagesTrygve Aaberge2020-05-301-8/+60
|
* Only store ts in submessagesTrygve Aaberge2020-05-301-3/+4
| | | | | So we don't have references to the thread message instances both in messages and submessages.
* Don't store parent_message in SlackThreadChannelTrygve Aaberge2020-05-301-20/+24
| | | | | | | Only store parent_channel and thread_ts, and use that to lookup the parent message. This is so parent_message doesn't refer to an old instance of the message if the message has been created again by using /rehistory -remote.
* Rerender messages when running /rehistoryTrygve Aaberge2020-05-301-9/+9
|
* Don't clear the old messages when getting the historyTrygve Aaberge2020-05-301-26/+30
| | | | | If new messages arrive over the websocket while we get the history, we don't want to delete those when the history request finishes.
* Reload history in current channel on reconnect if ↵Trygve Aaberge2020-05-301-4/+9
| | | | background_load_all_history is off
* Load new history after reconnect immediately when ↵Trygve Aaberge2020-05-302-12/+16
| | | | | | background_load_all_history is set Fixes #629, fixes #715, closes #732
* Only load history after latest message after reconnectTrygve Aaberge2020-05-301-2/+7
|
* Support getting only new messages in get_historyTrygve Aaberge2020-05-301-10/+18
| | | | | This is useful to only get new messages after we reconnect to the websocket, instead of loading the whole history again.
* Don't clear messages before getting the historyTrygve Aaberge2020-05-301-3/+0
|
* Remove unused argument from_me in store_messageTrygve Aaberge2020-05-301-3/+1
|
* Move store/prnt_message out of subprocess functionsTrygve Aaberge2020-05-301-13/+10
|
* Support only reprinting the buffer with /rehistoryTrygve Aaberge2020-05-302-12/+31
| | | | | | Without any arguments, /rehistory will now just clear the buffer and print the history again. With -remote, the history will be downloaded from Slack and processed again.
* Make sender and sender_plain into propertiesTrygve Aaberge2020-05-301-18/+28
|
* Set history_message in handle_conversationsrepliesTrygve Aaberge2020-05-301-1/+1
|
* Make sure last_read always is a SlackTSTrygve Aaberge2020-05-301-5/+4
|
* Move printing message into a methodTrygve Aaberge2020-05-301-62/+59
|
* Remove team parameter from store_messageTrygve Aaberge2020-05-301-7/+7
|
* 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-252-8/+6
|
* 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.