| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Closes #546
|
|
|
|
|
|
|
| |
If there's more work, schedule ourselves more often, if there's less,
back off a bit to lessen the CPU load.
Fixes: #523
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tag slack_muted_channel is set on all messages in channels which are
muted, and all messages in threads which belong to muted channels.
If you use a plugin for push notifications and don't want notifications
from muted channels, you can set it to ignore messages with this tag.
This would give you the same behavior as with the official client. Note
that this just applies to messages shown in the hotlist, i.e. highlights
(depending on your config) and thread messages, as messages hidden from
the hotlist are probably already ignored by the notification plugin.
|
|
|
|
|
| |
Prints either "Muted channel #x" or "Unmuted channel #x" to the team
buffer.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows you to control which activity from muted channels you will
be notified for.
The default is set to personal_highlights, as I find that the most
useful. The official client doesn't send a notification for any
activity, but it shows highlights in the sidebar, so all_highlights is
probably the closest to that. However, since there isn't any difference
between highlights from muted and non-muted channels in wee-slack, I
think getting channel highlights from muted channels is a bit much.
|
|
|
|
|
| |
If highlight_words is set to nothing, we should still call
set_highlights to remove any previous words.
|
|
|
|
|
| |
Show channel names instead of id's, and show them in a more readable
format.
|
|
|
|
| |
Previously, it was set to the set of an empty string.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This sets the correct tags for messages in muted channels and prevents
muted channel from being added to the hotlist on start and when a
message arrives.
Threads from a muted channel are not muted. If you are part of a thread,
you probably want to be notified for messages in it, even though the
parent channel is muted. The official client shows messages in threads
from muted channels in "New threads" with a highlight in the sidebar.
Fixes #456
|
|
|
|
|
| |
For muted channels, we need the tags for muted in addition to the tags
we normally want.
|
|
|
|
|
| |
Don't mute topic messages, set the irc_topic and slack_topic tags and
let people filter them as wanted.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
DMs with multiple persons should highlight just like DMs with one
person, instead of notifying without highlight like a channel.
This seems to have been the intention all along, but it didn't work
because the channel type was checked for mpdm, not mpim which is what
the type is set to (even though the class is called SlackMPDMChannel.
|
| |
|
|
|
|
|
|
| |
The join/leave prefix ends with a tab (which is used to separate nick
and message), but we also add a tab in buffer_prnt, so the join/leave
messages ended up with a tab in front of them.
|
|
|
|
| |
Fixes #538
|
|
|
|
|
|
| |
Prevents a traceback if you try to send a message in the team buffer.
Fixes #543
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no point in creating a SlackMessage when we're just going to
use message_json. I think this is just left over from when more of the
message was actually used.
It's not necessary to reset ws_counter. Python supports arbitrarily
large ints, and Slacks docs doesn't specify a limit (it does says that
the int should be unique for that connection, so this is more in line
with the docs). I tested the API with 2^65 and that worked fine. It
returns a string instead of an int if it's larger than 2^31 - 1 though,
so we convert it to an int to be sure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was introduced in commit 51c2e76 because I removed user from the
request believing it to be unnecessary.
I think the reason I didn't experience this problem after removing it
(I'm pretty sure I tested it), is that we might receive both a message
event and a request response for the message, and we use the first of
those that arrives. The message event will always contain the user,
while the request response will not (but it's passed along if provided
as in this commit).
Fixes #612
|
| |
|
|
|
|
|
|
|
|
|
| |
I have experienced unread_count_display missing from channels.info for
some channels. It seems consistent for those particular channels, but
I'm not sure what's different about them, or why it's missing from them.
I haven't seen it missing from groups.info or conversations.open, but I
figured it was best to set it the same way in the three methods.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though me_messages and messages surrounded by underlines render
equally in the official client, it is two different types of messages.
Converting messages surrounded by underlines to me_messages causes
problems when editing, because the underlines will be removed from the
message so it won't be shown as an action anymore.
The official clients sends me_messages as that subtype, and after the
previous commit, wee-slack also does this, so there is no reason for
this conversion anymore.
Since subtype isn't changed in SlackMessage anymore, we can use the
subtype variable we have, and the comment is not needed anymore.
|
|
|
|
|
|
|
|
|
|
| |
Previously, we would just surround the message with underlines. While
this renders equally in the official client, it's not actually a
me_message, which shows if you try to edit the message.
me_messages are not currently supported in threads. If you try to send
one in the official client you will get an error, so print an error in
wee-slack as well.
|
|
|
|
|
|
|
|
| |
This changes the color of the text of action messages to normal color so
that only the nick before the text is colored. This is the same as the
irc plugin does.
Fixes #355
|
|
|
|
| |
Fixes #463
|
|
|
|
|
|
| |
This fixes a bug where old messages would show up as new instead of as
backlog messages when channel history is reloaded (i.e. when running
/rehistory or after reconnects).
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a message arrived after history was requested, but before the
response arrived, it would be lost. It would be printed after the
"getting channel history" text, and then handle_history would clear
that, and it would not be printed again since the message ts already was
processed.
By clearing the messages dict, the message will get processed and
printed again. So we should never clear the buffer without also clearing
the messages, to prevent such problems.
|
|
|
|
|
|
|
|
| |
If the timestamp given to change_message doesn't exist in the messages
dict, just return.
Previously an unknown ts would make modify_buffer_line crash unless text
was set, because modify_buffer_line fails if text is None.
|
|
|
|
|
| |
This fixes an issue introduced in commit d7b26dd where (edited) would
not show up after changed messages.
|
|
|
|
|
| |
Make sure to mark the buffer as read right after we print a message from
our own user, so we don't see a flash of the unread bar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The API has started to send both responses for sent messages as well as
message events for the same messages. Previously, we would only get
message events for messages from other clients. For the messages we send
ourselves we would just get responses, and no message events.
This caused wee-slack to print own messages twice, once for the response
and once for the message event. To prevent this, check if we already
have a message for the ts, and if we do, ignore the new message.
I don't want to rely on only the message events and ignore the
responses, because this change has rolled out gradually, so not all
users might get message events for own messages yet. Additionally, the
docs are not clear on what the behavior should be.
Fixes #606
|
|
|
|
|
|
|
|
|
|
| |
When refetching the history, we clear the buffer because the messages
will be printed again. Now the dicts for messages and hashed_messages
are also cleared, so they match what we actually have in the buffer.
This is necessary so we can check if a message is in the messages dict
to find out if it's printed to the buffer, which we need for the next
commit.
|
|
|
|
|
|
|
|
|
|
|
| |
The message suffix is only used to show that a message is edited.
Instead of keeping track of the suffix, just check if the message has
been edited in the render function, and add the text there. This way, we
only have to add the '(edited)' text one place.
With this change, the edited text moves to right after the message text,
before the attachments and files. It also fixes a bug where '(edited)'
would not show on messages that have a thread.
|
|
|
|
|
|
|
|
|
| |
Slack doesn't use the file_share subtype anymore, as file uploads are
now sent as normal messages with files attached.
The urls we render for files attached to messages are the same as the
urls this code previously inserted. The urls this code replaced out are
gone from Slack.
|
|
|
|
|
|
|
|
|
|
| |
Instead of changing the message text, append the files belonging to the
message when we render the message. This is the same as we do with
attachments. This fixes the issue where the files would not be shown
anymore if a message is changed.
The rendering format of the files is changed to match the way we render
refs.
|
|
|
|
|
|
|
| |
I don't think any if this is used anymore. The function changed
message_json, but that was not used after it was changed. It also added
attachments, but render is called later which also adds attachments, so
they ended up being included twice.
|
|
|
|
|
|
| |
* Adding support for new slack upload message style
* better handling of empty messages
|
|\
| |
| | |
Add support for shared channels
|
| |
| |
| |
| |
| |
| | |
The is_stranger attribute isn't clearly documented, so it's safer to
check if the team_id of the user matches the team_id of the team we
request the user in.
|
| |
| |
| |
| |
| | |
When messages were loaded before the user info were fetched for an
external user, this would crash.
|
| |
| |
| |
| |
| | |
We might want to use this request for other users as well in the future,
so we shouldn't assume that all of the users received by it are external.
|
| |
| |
| |
| |
| | |
The presence attribute is missing in the response for external users, so
we just set it to unknown.
|
| |
| |
| |
| |
| | |
This method may be called before an external user is fetched, so it
doesn't exist yet.
|
| |
| |
| |
| |
| | |
This is probably more reliable than depending on the topic not being
set.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since we have an is_external attribute on the users, it's simpler to
just have them all in a single list.
The documentation says that the user id is not necessarily unique across
teams, but I talked to Slack and they said it's unlikely to be a
collision. If you refer to a user in a message, you only use the id
without a team id, so you will have problems with collisions there
anyway. I'm waiting to hear from Slack how to handle that.
|