Commit graph

2251 commits

Author SHA1 Message Date
LoopThrough-i-j bcf183d2b1 zulip-botserver: Allow passing config via JSON formatted environment variable.
Fixes #485.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2021-01-07 00:31:26 -08:00
Unam LN 984d9151d5
bots: Fix RSS bot for Python 3.x support.
- Call `super()` in the init method.
- Change return hashlib.md5 syntax to encode properly for Python 3

Signed-off-by: Manu LN <manu+github@lacavernedemanu.fr>
2020-12-22 16:34:32 -08:00
Tim Abbott 59a0a912a8 process_ccache: Update path to Zulip supervisord files. 2020-12-20 11:46:24 -08:00
Anders Kaseorg f2d80c657a
README: Migrate Travis badge to travis-ci.com.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-27 16:08:39 -07:00
Steve Howell f100ab07aa jabber mirror: Remove code for occupy/vacate events.
The server no longer sends occupy/vacate events
for streams.

The mirror should continue to work fine by processing
subsription-related events.
2020-10-20 11:21:44 -07:00
Eeshan Garg befbb953dd pypi: Release version 0.7.1. 2020-10-09 15:50:43 -02:30
Aman Agrawal d469352180 README: Fix link to virtualenv doc. 2020-09-22 13:14:55 -04:00
qedk 21f87b3e88 provision: Fix source command on Windows. 2020-09-20 20:38:07 -07:00
Aman Agrawal 5ca3548bd3 requirements: Upgrade zulint. 2020-09-20 07:33:36 -04:00
Thomas Michelat 3630208389
api: Add binding for moving topics between streams.
Adds the method move_topic to the class Client that allows moving
topics between streams.

- The topic can be renamed if the new_topic argument is given
- Partial topic can be moved givent the proper message_id and
  propagate_mode arguments.
- notification to old/new stream can be silenced (active by default)
2020-09-14 15:13:10 -07:00
Kartik Srivastava 1df19c0665 api: update_user_group_members should have a user_group_id parameter.
This avoids weirdly passing an extra field in the request, and also
makes the bindings better align with the API.
2020-08-27 12:55:21 -07:00
Preet Mishra 9a4abb9f87 zulip: Add hash_util_decode() to decode server encoded URL excerpts.
This adds hash_util_decode() to decode a hash_util_encode() [present in
zulip/zulip's zerver/lib/url_encoding.py [1]] encoded string.

The intent is to facilitate code sharing among various python clients
(primarily, Zulip Terminal).

The string replacement before the `unquote` is to recoup for the custom
string replacements in zulip/zulip's zerver/lib/url_encoding.py [1].

Test added.

[1] See hash_util_encode() in https://github.com/zulip/zulip/blob/master/zerver/lib/url_encoding.py.
2020-08-25 16:08:32 -07:00
rht e992f14522 slack-bridge: Use WebClient to post message in Slack. 2020-08-25 15:55:25 -07:00
rht 47a4f258d7 slack-bridge: Update processing of members list according to new API. 2020-08-25 15:55:25 -07:00
rht 89d0dd56b9 slack-bridge: Fall back to real_name when display_name is empty.
This will intentionally raise exception when a real_name field of a user
is empty.
2020-08-25 15:55:25 -07:00
rht 02867979ee bridge: Initialize bridge_with_slack. 2020-08-25 15:55:25 -07:00
Kartik Srivastava 0e98533186 api: Implement GET /users/{user_id}/subscriptions/{stream_id} endpoint. 2020-08-14 16:22:12 -07:00
rht f529bc0d01 IRC bridge: Add documentation on nick password. 2020-08-10 17:12:04 -07:00
rht fe2a4d6fe8 [BUGFIX] IRC bridge: Use connection initialized from aio_reactor.
Additionally, pin the irc library version to 18.0 because the newer
version has an error in the AioReactor:
```
  File "/home/rht/code/venv/lib/python3.8/site-packages/irc/bot.py", line 108, in run
    self.bot.reactor.scheduler.execute_after(intvl, self.check)
AttributeError: 'AioReactor' object has no attribute 'scheduler'
```
2020-08-10 17:12:04 -07:00
Kartik Srivastava 36071821c3 api: Update type annotation in 'remove_subscriptions'.
This updates the type annotation for the 'principals' argument
to accept a list of email addresses as well as user ids.
2020-08-10 16:38:39 -07:00
Alex Vandiver 9745ec9ceb doc: Document the backoff class better. 2020-08-10 15:07:01 -07:00
Alex Vandiver 7a7cfe637e zephyr: Mark the infinite loops as NoReturn. 2020-08-10 15:07:01 -07:00
Alex Vandiver a20c9cc6d7 zephyr: Use exponential backoffs in retry loops.
This reduces the number of retries that might spam APIs.

There is some complexity here which is left un-managed -- for
instance, maybe_restart_mirroring_script does a number of restart
attempts, and then fails, but will be retried every 15s by the
surrounding `process_loop`.  Previously, it would merely have looped
forever inside maybe_restart_mirroring_script.

Three loops are intentionally left as infinite `while True` loops,
that merely cap their backoff at the default 90s.  Their callers do
not expect, or have any way to handle more gracefully, a failure of
the expected-infinite-loop in `process_loop` or `zulip_to_zephyr`.
They maintain their previous behavior of retrying forever, albeit more
slowly.
2020-08-10 15:07:01 -07:00
rht 8670cce8e9 Matrix bridge: Change the condition of not_from_zulip_bot. 2020-08-07 08:15:07 -04:00
Kartik Srivastava 20e7f197e3 api: Implement DELETE /realm/emoji/{emoji_name}. 2020-08-03 10:29:38 -07:00
Anders Kaseorg 396ef1d11a Update zulipchat.com emails to zulip.com.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-11 21:06:58 -07:00
Anders Kaseorg 5f81eb3a70 Update zulipchat.com links to zulip.com.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-11 21:06:58 -07:00
Aman Agrawal ad8a9dd56d requirements: Bump zulint. 2020-06-07 14:01:53 -07:00
Kartik Srivastava 9e9b1efdae api: Implement PATCH /realm/profile_fields/{field_id} endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava e25ebce27b api: Implement PATCH /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava a85ac15d2d api: Implement DELETE /realm/profile_fields/{field_id} endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava 22392779a3 api: Implement POST /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava 30fa7c5d2f api: Implement GET /realm/profile_fields endpoint. 2020-05-29 17:18:25 -07:00
Kartik Srivastava 16737e4ed3 api: Add get_members wrapper for get_users for backwards compatibility. 2020-05-14 11:37:23 -07:00
Kartik Srivastava d2b9976015 api: Rename get_members to get_users. 2020-05-14 11:36:17 -07:00
Anders Kaseorg 7870512de6 mailmap: Add Git .mailmap for zulipchat.com → zulip.com.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-05-13 09:56:35 -07:00
Lunatic Luna 3b1ef57694 bots: Support adding reactions to message for a bot.
It adds a react() function that allows a bot to react to a message in lib.py.
It adds an example of the use of react() function and its test.

The changes are in the following files:
  - lib.py
  - helloworld.py
  - tests/test_lib.py
  - test_lib.py
2020-05-08 10:46:56 -04:00
neiljp (Neil Pilgrim) 540d453237 setup.py: Add Source & Documentation project_urls.
The only existing url points to zulip.org -> zulipchat.com
2020-05-05 09:20:50 -04:00
neiljp (Neil Pilgrim) f2c8295fcb requirements: Remove unnecessary install dependency upon six & typing.
The latest release was fully python 3.5+, making these dependencies
redundant.
2020-05-05 09:20:50 -04:00
pemontto a9268a1947 jira: Add JQL search command. 2020-04-28 12:46:40 -07:00
pemontto a46dae37f5 jira: Add search command. 2020-04-28 12:46:40 -07:00
pemontto b0c2b1b9c8 jira: Use display_url in output. 2020-04-28 12:45:36 -07:00
pemontto 3ca336246d jira: Allow overriding https. 2020-04-28 12:45:36 -07:00
pemontto ae8a3516fb jira: Fix deprecation warning. 2020-04-28 12:45:36 -07:00
Rohitt Vashishtha bdf0c7ff5c bots: Use ids for sending message. 2020-04-28 11:56:16 -04:00
Rohitt Vashishtha 5c32054415 bots: Do not reply in group PMs unless explicitly mentioned.
Previously, if a bot was accidentally added to a group PM, we would
have no option but to leave that conversation because the bot would
reply to all the messages sent in that conversation. This also has
potential to cause infinite loops in case two bots are added to a
group PM since they could keep on replying to each other's messages.

Fixes #551.
2020-04-28 11:56:16 -04:00
Rohitt Vashishtha fe78a363b0 bots: Do not remove self from list of recipients in group PMs.
The origin of this line seems like an arbitary decision when writing the
wikipedia bot in ad25f27853. Removing self
doesn't have any other significance, and not making any changes to the
recipient list helps with https://github.com/zulip/zulip/issues/14228.

Fixes #552.
2020-04-28 11:56:16 -04:00
Eeshan Garg 1dac75f979 pypi: Release version 0.7.0. 2020-04-20 23:23:58 -02:30
Eeshan Garg d4ded1c5dd tools/release-packages: Stop generating universal wheels.
Since we recently dropped support for Python 2 in our PyPI packages,
we can no longer distribute them as universal wheels.
2020-04-18 20:33:17 -07:00
Eeshan Garg 4e0c963127 zulip/README.md: Add note clarifying Python 2 support. 2020-04-18 20:33:17 -07:00