| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This mainly adds team, channel_general and user_alice as fixtures, so we
can use those directly instead of picking arbitrary ones from the lists.
It also adds assertions to some tests which where missing it.
|
|
|
|
| |
These tests don't do any assertions, so they are not very useful.
|
| |
|
|
|
|
|
|
| |
Python 3 doesn't have these functions, but returns iterables and views
by default. For python 2 this may have a small performance impact, but
probably not much.
|
|
|
|
|
|
|
| |
Python 3 receives unicode strings as arguments in weechat callbacks,
websocet receive etc. and we can send unicode strings to weechat
functions, websocket etc., so we don't need to do any of this
converting.
|
|
|
|
|
|
| |
Python 3 no longer respects __cmp__, as it has more fine-grained hooks
for ordering/comparison. To minimize code changes, implement them in
terms of the existing __cmp__ method.
|
|
|
|
|
|
| |
__getattr__ is expected to raise AttributeError, not KeyError.
The removal of the call to hasattr() also speeds up fetch_setting().
|
|
|
|
|
|
| |
PluginConfig uses round-tripping through wee_slack.w to coerce
the its default values to the correct type. Without this, the normal
getters fail, as '' cannot be converted to an integer/boolean.
|
|
|
|
|
| |
Use sha1 from the hashlib module, and factor out a helper function that
makes sure the argument to sha1 is a bytestring.
|
|
|
|
| |
Try both the old and the new locations.
|
|
|
|
|
| |
This is compatible with python 3, which StringIO from StringIO or
cStringIO is not.
|
| |
|
|
|
|
| |
Comments are updated as well as live code.
|
|
|
|
|
| |
It seems pointless to serialize request metadata first with pickle, then
pack it into json, just to unpack both afterwards.
|
|
|
|
|
| |
This test doesn't do any assertions, and is as far as I can see
completely useless.
|
|
|
| |
Add @user-groups with tab-completion. @user-groups will be unfurl into format <!subteam^{ID}|handle> message before sending message via linktext method.
|
|
|
|
|
|
| |
If wee-slack has tried to connect too many times, it will give up.
Inform about this in the error message, instead of keep saying that it
will try to reconnect.
|
|
|
|
| |
This parameter is not used in the function.
|
|
|
|
| |
Previously, when writing e.g. `@channel: test` the colon would be lost.
|
| |
|
|
|
|
|
|
| |
Away/back will be set for all slack teams if -all is used.
Closes #596
|
|
|
|
|
|
|
|
|
|
| |
This replaces the trailing whitespace match with a non-consuming lookahead
so that strings like '*one* *two*' match correctly, and uses \w instead
of hard coded ascii characters.
This is taken from #359 and updated.
Closes #359
|
| |
|
|
|
|
|
|
|
|
| |
Currently files are always uploaded to the main channel, even when
`/slack upload` is run in a thread buffer. This happens because the
`thread_ts` field isn't included in the upload request.
Fixes #672
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to @celsworth and @micolous for pointing out that Slack now
requires this for some teams.
From https://github.com/slackapi/python-slackclient/issues/118#issuecomment-348731791:
I've observed that some Slack teams have (recently) been opted into
an experiment (by SlackHQ) which requires that ping messages are
sent by RTM clients, otherwise they will be disconnected after 2-3
minutes. This is more frequently than the other reporters, and has
only become an issue in the last 4 days for me.
However, this experiment has only been applied to a limited number
of teams (I see only one team with the issue and all others without,
even when running the same bot code), which don't appear to
correlate with age of the team.
May partly fix #679, but that seems to also be caused by an issue in
websocket-client.
|
|
|
|
|
|
| |
The team may have external users (i.e. guests or users from other
teams), which we don't store in the team user list, so ignore status
updates for those.
|
| |
|
|
|
|
|
|
|
|
|
| |
Trying to concat exceptions containing non-ascii chars with our own
message failed with a UnicodeDecodeError. We have to decode them to
unicode strings first. This includes some helper methods for that, one
which includes the traceback, and one which only has the error.
Fixes #593
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Remove handling of all exceptions. If an unknown exception happens, it's
better to just let it print a stack trace to the core buffer so we
notice it, instead of just printing it in the debug buffer.
The two specific exceptions we handle are just necessary for the recv
call, so we can move the rest of the lines outside of the exception
handling.
|
| |
|
|
|
|
|
|
| |
If sending to the websocket fails, it is most likely down and we'll have
to reconnect. By disconnecting, the reconnect timer will ensure we
reconnect.
|
|
|
|
|
|
|
| |
If you're connecting to multiple teams, especially if one of them is
large, the call to rtm.start may time out. By retrying it, there's a
greater chance that it works (especially since when it tries again, the
requests to rtm.start for the other teams have probably finished).
|
| |
|
| |
|
|
|
|
| |
* for details please see: https://api.slack.com/methods/chat.getPermalink
|
|
|
|
| |
Closes #562
|
|
|
|
| |
Useful when running wee-slack without a open session in a browser/app.
|
|
|
|
|
|
|
| |
There's no reason to not use the server aliases even when
short_buffer_names is on. Now, it will use server aliases for the
servers that has it defined, and short names for the rest if
short_buffer_names is on.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we close a buffer, weechat invokes a callback so we can unregister
the channel. However, when we close the buffer ourselves in the
unregister function it caused the unregister function to be called
again. By deleting the buffer from our list first, the second invokation
of unregister won't find the channel, so the rest isn't run again.
This prevents an error from weechat when we sent None into buffer_clear
because the channel_buffer had already been set to None.
Also does some cleanup. Use global EVENTROUTER, check if channel exists
instead of catching exception and remove some unnecessary checks.
|
| |
|
| |
|
|
|
|
| |
Fixes #597
|
| |
|
|
|
|
|
| |
Instead of duplicating much of the documentation for commands and
options, refer to the /set and /help commands in weechat.
|
| |
|
|
|
|
|
| |
This includes these commands in the help command. It also allows these
commands to be used with the /slack prefix.
|
|
|
|
|
| |
Don't send in the command name as part of args. This removes the need
for removing the name from args.
|
|
|
|
|
|
|
|
|
| |
We should use hook_command instead of hook_command_run when we add new
custom commands because this will include completion and help for the
command.
When we use this, the command name won't be included in the arguments,
which is why the usage of args in the functions has changed.
|