aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Don't add deleted users to the nicklistTrygve Aaberge2018-02-031-0/+2
| | | | | | | | | | | | | This check was done when generating complete nicklist, but not when updating a single user. Deleted users are still part of the member list of a channel, if they don't leave the channel first. This caused a deleted user to be inserted into the nicklist when processing a joined channel message or when receiving a presence change for that user. When investigating this, I saw that we still receive presence change events for deleted users if we subscribe to them. We might want to filter out the deleted users when generating the list of users to subscribe to.
* Merge pull request #490 from SandyRogers/autocomplete-nicks-in-threadsTrygve Aaberge2018-02-021-4/+6
|\ | | | | Include members set and team in SlackThreadChannel
| * Use self.team throughtout SlackThreadChannel classSandy Rogers2018-02-021-5/+5
| |
| * Include members set and team in SlackThreadChannelSandy Rogers2018-01-171-0/+2
| | | | | | Allows autocompletion of nicks to work (instead of error from `nick_completion_cb`)
* | Merge pull request #500 from trygveaa/fix-quit-callbackTrygve Aaberge2018-01-311-2/+2
|\ \ | | | | | | Fix quit callback function
| * | Fix quit callback functionTrygve Aaberge2018-01-301-2/+2
|/ / | | | | | | | | The function was renamed at some point without renaming the hook signal, so weechat would print an error when exiting.
* | Merge pull request #499 from immae/presence_subscriptionTrygve Aaberge2018-01-291-1/+6
|\ \ | | | | | | Temporary fix user presence subscription crashing big teams
| * | Temporary fix user presence subscription crashing big teamsIsmaël Bouya2018-01-291-1/+6
|/ /
* | Merge pull request #494 from ToxicFrog/toxicfrog/display-namesBen Kelly2018-01-281-7/+14
|\ \ | | | | | | SlackUser: use profile.display_name if available
| * | SlackUser: use profile.display_name if availableBen Kelly2018-01-281-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since recent changes in Slack, usernames can no longer be set directly, and are instead inferred from the email address. This is not particularly useful, so the recommendation is to instead use display_name. display_name may have spaces in it, however, which confuses tab completion. With this change, wee-slack uses display name for both display and completion, after first stripping all whitespace from it. Ref linking (via linkify_text) ensures that @mentions continue to work properly even when this whitespace removal means that the name being @mentioned locally doesn't match the "real" username.
* | | Merge pull request #487 from ajdavis/restore-slack-oauthTrygve Aaberge2018-01-282-1/+77
|\ \ \ | |/ / |/| | Restore OAuth support
| * | Respond to Trygve's commentsA. Jesse Jiryu Davis2018-01-272-14/+14
| | |
| * | update README for new /slack register commandA. Jesse Jiryu Davis2018-01-171-1/+26
| | |
| * | oauth cleanupsA. Jesse Jiryu Davis2018-01-171-36/+39
| | |
| * | add token once oauth completesA. Jesse Jiryu Davis2018-01-171-2/+16
| | |
| * | update oauth logic for new command codeA. Jesse Jiryu Davis2018-01-151-5/+8
| | |
| * | add oauth codeRyan Huber2018-01-151-0/+31
| | |
* | | Merge pull request #496 from immae/presence_subscriptionTrygve Aaberge2018-01-271-3/+20
|\ \ \ | | | | | | | | Fix presence subscription now mandatory to get state changes
| * | | Fix presence subscription now mandatory to get state changesIsmaël Bouya2018-01-271-3/+20
|/ / / | | | | | | | | | https://api.slack.com/docs/presence-and-status#batching
* | | Merge pull request #495 from ToxicFrog/toxicfrog/sslwantreadBen Kelly2018-01-201-0/+3
|\ \ \ | | | | | | | | Suppress SSLWantReadError errors
| * | | Suppress SSLWantReadError errorsBen Kelly2018-01-201-0/+3
|/ / / | | | | | | | | | | | | This exception is expected to some degree and does not affect the functioning of wee-slack. With this change, it will no longer appear in the log.
* | | Merge pull request #493 from ToxicFrog/toxicfrog/nicklistBen Kelly2018-01-201-5/+8
|\ \ \ | |_|/ |/| | Handle memberlist updates in channelsinfo message
| * | Handle memberlist updates in channelsinfo messageBen Kelly2018-01-191-5/+8
|/ / | | | | | | | | | | | | In large Slacks, channel membership isn't included in the initial channel info, but in channelsinfo messages sent after connection. This fixes an issue where most users would not ever show up in the nicklist when connecting to such slacks.
* | Merge pull request #437 from trygveaa/completion-of-custom-emojisTrygve Aaberge2018-01-162-11/+37
|\ \ | |/ |/| Add completion of custom emojis
| * Reload emoji list on emoji change eventTrygve Aaberge2018-01-141-0/+5
| | | | | | | | | | | | | | | | | | | | It's simpler to just reload the whole list instead of adding and removing specific emojis, especially since we would have to remove aliases for an emoji when the emoji is removed (and we don't store if an emoji is an alias or not). Since this probably doesn't happen that often, it shouldn't be a problem to do it this way.
| * Ensure that EMOJI is always definedTrygve Aaberge2017-09-171-7/+7
| | | | | | | | | | | | | | After the last commit, the EMOJI variable is accessed in the initialization of SlackTeam. This made some tests fail since they don't run the main code, so it would not be defined. By setting EMOJI to an empty list in the top, we ensure that this is not a problem.
| * Add completion of custom emojisTrygve Aaberge2017-09-171-2/+19
| | | | | | | | | | | | | | | | | | | | This loads the list of custom emojis for each team after wee-slack has connected to the team, and adds them to the emoji completion list for that team. The list of custom emojis is only loaded if the list of the standard emojis has been loaded, since it would be a bit strange to only have completions of the custom emojis.
| * Add documentation for emoji completionsTrygve Aaberge2017-09-171-0/+8
| |
| * Refactor emoji list loadingTrygve Aaberge2017-09-171-7/+5
| | | | | | | | | | This prevents an error that EMOJI is not defined when trying to tab complete after the emoji list could not be loaded.
| * Improve error message when weemoji.json is not foundTrygve Aaberge2017-09-171-2/+2
| | | | | | | | | | | | | | | | By printing the exception instead of sys.exc_info, we get more useful error messages, including the path to the file it is trying to load if it can't find it. Fixes #431
| * Remove unnecessary dbg statementTrygve Aaberge2017-09-171-2/+0
| | | | | | | | | | Emoji completion works fine for me without it, so this doesn't seem to be necessary anymore.
* | Merge pull request #444 from trygveaa/feat/unfurl-prevent-auto-linkingTrygve Aaberge2018-01-142-7/+54
|\ \ | | | | | | feat: Remove Slacks auto prefixing of url protocols
| * | test: Add tests for unfurl_auto_link_displayTrygve Aaberge2017-10-011-1/+24
| | |
| * | refactor: Get config variables in unfurl_refsTrygve Aaberge2017-10-011-7/+14
| | | | | | | | | | | | | | | Instead of each of the callers of unfurl_refs having to get the config values, get them in unfurl_refs if they are not set by the caller.
| * | feat: Make it possible to only display url when text matchesTrygve Aaberge2017-10-011-9/+14
| | | | | | | | | | | | | | | | | | This changes the feature from the previous commit so it's also possible to only display the url when the text and the url (without the protocol) in a link is equal.
| * | feat: Remove Slacks auto prefixing of url protocolsTrygve Aaberge2017-10-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you write multiple words separated by dots, or email adresses, Slack will turn those into links. Wee-slack will display this as `text (url)`, where url is just the text with http:// or mailto: prefixed. This makes the text hard to read, and might not even make sense (e.g. when writing server names or user@hostname). When you receive such an url, the alt text of the url will be the original text. This means that we can check if the url is just the alt text with a protocol prefixed. If it is, we should just print the alt text and ignore the url. I guess some people may want the urls, so they are able to click the links. And since it removes information coming from slack, I made it into an option instead of making it the default.
* | | Merge pull request #440 from trygveaa/use-last-msg-timestamp-for-mark-readTrygve Aaberge2018-01-141-23/+22
|\ \ \ | | | | | | | | Use the timestamp of the last message in mark_read
| * | | refactor: Make use of message keys more clear and efficientTrygve Aaberge2017-10-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the times we used sorted_message_keys, we were accessing some of the last elements in the list. Since OrderedDict is doubly linked, using reversed(keys) and next/islice is much more efficient than converting it to a list. Because of this the method now returns a generator in reverse order. It is renamed to main_message_keys_reversed to make it clear that it isn't returning thread messages, and that it is now reversed.
| * | | refactor: Use OrderedDict for SlackChannel.messagesTrygve Aaberge2017-10-151-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using an OrderedDict, we can sort the messages when we store them, so we don't have to sort them each time we access them with sorted_message_keys. If we are guaranteed that the message we store is always the newest message, we can even drop the sorting, as OrderedDicts are sorted in insertion order. However, I'm not sure if we might store an older message at some point, so to be safe, we sort the messages each time we store one.
| * | | fix: Use the timestamp of the last message in mark_readTrygve Aaberge2017-09-231-1/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sending a mark read message to slack, use the timestamp of the last message in the channel, instead of the current timestamp. This should prevent potentially marking messages as read, if they arrive after mark_read was called and the clock of the slack server and the machine wee-slack runs on is not exactly in sync. According to issue #307 messages might also be marked as read if they arrive right after you switch buffer, and you have a slow internet connection. Though, since the time used in mark_read is set synchronously when the buffer is changed, I'm not sure if that can be the case. Either way, I think this patch should fix the issue. If there are no messages in the channel, fall back to using the current time as timestamp. Fixes #307
* | | Merge pull request #438 from trygveaa/attachment-tests-and-minor-fixesTrygve Aaberge2018-01-102-6/+157
|\ \ \ | | | | | | | | Attachment tests and minor fixes
| * | | fix: Unescape html before checking attachment linksTrygve Aaberge2017-10-152-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | The title and from_url fields of attachments doesn't seem to be escaped, so the check if they already are in the text didn't work if the link contained e.g. an ampersand.
| * | | Add a newline between attachmentsTrygve Aaberge2017-09-202-4/+26
| | | |
| * | | Don't render equal title_link and from_url in attachments twiceTrygve Aaberge2017-09-202-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up of commit 0345ba1. That prevented rendering the link if it already was in the text. This prevents rendering both the title_link and from_url if they are equal, but not in the text. In this case it only renders the title_link.
| * | | test: Add tests for unwrap_attachmentsTrygve Aaberge2017-09-201-0/+115
| |/ /
* | | Merge pull request #452 from ericdwang/query-mpdmTrygve Aaberge2017-12-172-25/+65
|\ \ \ | | | | | | | | Add ability to open multiparty DMs with /query and /slack talk
| * | | Clean up /query related codeEric Wang2017-11-291-23/+12
| | | |
| * | | Fix MPDM joins not syncing with Slack and switch to mpim.openEric Wang2017-11-291-7/+21
| | | | | | | | | | | | | | | | | | | | conversations.open doesn't return `unread_count_display` for MPDMs for some reason (only DMs), so use mpim.open instead.
| * | | Refactor command_talk and fix MPDMs not being createdEric Wang2017-11-292-45/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix incorrect parameter name for MPDMs: `users` instead of `user_ids` - Accept comma-separated nicks instead of space-separated to match weechat's `/query` syntax - Check user IDs instead of usernames to find channels - Use `SLACK_API_TRANSLATOR` instead of hard coding API methods - Update documentation
| * | | Add ability to open multiparty DMs with /query and /slack talkEric Wang2017-11-292-10/+41
|/ / / | | | | | | | | | | | | `command_talk` can now accept multiple arguments, which allows commands like `/query user1 user2` to open a MPDM with user1 and user2.