diff options
author | Lorenz Diener <[email protected]> | 2020-02-16 17:00:24 +0100 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2020-02-16 17:00:24 +0100 |
commit | 633b915fca0541afb290951bddad6496ace44f81 (patch) | |
tree | bf3ba1a23c444a389ee7c659bc8b7ca66f3a3770 | |
parent | 95aee9349a0cc5a14a8bfbdfc4c38c197e18845a (diff) | |
download | mastodon.py-633b915fca0541afb290951bddad6496ace44f81.tar.gz |
Add new notification types to push API
-rw-r--r-- | mastodon/Mastodon.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index dca6d67..5b1f98b 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -2509,7 +2509,8 @@ class Mastodon: | |||
2509 | @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH) | 2509 | @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH) |
2510 | def push_subscription_set(self, endpoint, encrypt_params, follow_events=None, | 2510 | def push_subscription_set(self, endpoint, encrypt_params, follow_events=None, |
2511 | favourite_events=None, reblog_events=None, | 2511 | favourite_events=None, reblog_events=None, |
2512 | mention_events=None): | 2512 | mention_events=None, poll_events=None, |
2513 | follow_request_events=None): | ||
2513 | """ | 2514 | """ |
2514 | Sets up or modifies the push subscription the logged-in user has for this app. | 2515 | Sets up or modifies the push subscription the logged-in user has for this app. |
2515 | 2516 | ||
@@ -2545,6 +2546,12 @@ class Mastodon: | |||
2545 | 2546 | ||
2546 | if mention_events != None: | 2547 | if mention_events != None: |
2547 | params['data[alerts][mention]'] = mention_events | 2548 | params['data[alerts][mention]'] = mention_events |
2549 | |||
2550 | if poll_events != None: | ||
2551 | params['data[alerts][poll]'] = poll_events | ||
2552 | |||
2553 | if follow_request_events != None: | ||
2554 | params['data[alerts][follow_request]'] = follow_request_events | ||
2548 | 2555 | ||
2549 | # Canonicalize booleans | 2556 | # Canonicalize booleans |
2550 | params = self.__generate_params(params) | 2557 | params = self.__generate_params(params) |
@@ -2554,7 +2561,8 @@ class Mastodon: | |||
2554 | @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH) | 2561 | @api_version("2.4.0", "2.4.0", __DICT_VERSION_PUSH) |
2555 | def push_subscription_update(self, follow_events=None, | 2562 | def push_subscription_update(self, follow_events=None, |
2556 | favourite_events=None, reblog_events=None, | 2563 | favourite_events=None, reblog_events=None, |
2557 | mention_events=None): | 2564 | mention_events=None, poll_events=None, |
2565 | follow_request_events=None): | ||
2558 | """ | 2566 | """ |
2559 | Modifies what kind of events the app wishes to subscribe to. | 2567 | Modifies what kind of events the app wishes to subscribe to. |
2560 | 2568 | ||
@@ -2574,6 +2582,12 @@ class Mastodon: | |||
2574 | if mention_events != None: | 2582 | if mention_events != None: |
2575 | params['data[alerts][mention]'] = mention_events | 2583 | params['data[alerts][mention]'] = mention_events |
2576 | 2584 | ||
2585 | if poll_events != None: | ||
2586 | params['data[alerts][poll]'] = poll_events | ||
2587 | |||
2588 | if follow_request_events != None: | ||
2589 | params['data[alerts][follow_request]'] = follow_request_events | ||
2590 | |||
2577 | # Canonicalize booleans | 2591 | # Canonicalize booleans |
2578 | params = self.__generate_params(params) | 2592 | params = self.__generate_params(params) |
2579 | 2593 | ||