| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes #563
|
| |
|
| |
|
|
|
|
| |
Relates to #563
|
|
|
|
|
| |
Label is only for the short_name, so we should always rename the full
name.
|
| |
|
| |
|
|
|
|
| |
The tests were broken in commit 855cf3c.
|
|
|
|
| |
This was broken in commit cd888c2.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes #629, fixes #756
|
|
|
|
|
| |
There shouldn't be any exceptions here. If there are, we shouldn't catch
them, so we can notice and fix them.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes #514
|
|
|
|
| |
Fixes #709
|
| |
|
|
|
|
| |
This was fixed in commit ad1a715.
|
|\
| |
| | |
Automatically reload history after reconnect
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
Slack doesn't support marking unsubscribed thread as read (it responds
`message_not_found`).
|
| |
| |
| |
| | |
Fixes #376
|
| |
| |
| |
| |
| | |
When destroy_buffer is called, the buffer will be closed, so there isn't
any point in clearing it.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
Fixes #619, fixes #754
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
This is necessary for thread messages rendered in the channel, either
broadcast messages or when thread_messages_in_channel is on.
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| | |
This is so we can show the hash for a thread message when the parent
message isn't fetched.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When last_read is missing, we should assume no messages are read instead
of all up until the channel/message is created. The only time I know
this happens is for messages that are not yet thread parents.
This probably doesn't matter in practice though. For new thread parents
the messages that make it a thread parent will arrive after we create
the message, so they would have newer ts than the one we set for
last_read. Still, I think it makes more sense to set it to 0.
|
| | |
|
| |
| |
| |
| |
| | |
Old messages, as in parent messages that's older than the history we
fetch.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Submessages (or replies) are not a part of the message anymore with
conversations.history, we have to call conversations.replies to get
them. So when fetching the channel history, the new message will have an
empty submessages. Keep the old, so we don't have to call
conversations.replies for each thread parent every time we call
conversations.history.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
conversations.history doesn't include thread messages, so when we use
that and thread_messages_in_channel is on, we have to call
conversations.replies for every thread parent we encounter to fetch the
thread messages.
Fixes #664
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|