aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhalcy <halcy@ARARAGI-KUN>2022-11-24 01:53:34 +0200
committerhalcy <halcy@ARARAGI-KUN>2022-11-24 01:53:34 +0200
commitf81978a39c7ad2124951806cd66fcbadffc16d59 (patch)
treed55551512f179b15f8a96e114d537663a322b7a3 /mastodon
parent066d543109496c732f6c05bfbe3418d30b648f42 (diff)
downloadmastodon.py-f81978a39c7ad2124951806cd66fcbadffc16d59.tar.gz
Add notification tests
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index d98289d..f0d9cc5 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1108,23 +1108,24 @@ class Mastodon:
1108 * `status` - A user that the logged in user has enabned notifications for has enabled `notify` (see `account_follow()`_) 1108 * `status` - A user that the logged in user has enabned notifications for has enabled `notify` (see `account_follow()`_)
1109 * `admin.sign_up` - For accounts with appropriate permissions (TODO: document which those are when adding the permission API): A new user has signed up 1109 * `admin.sign_up` - For accounts with appropriate permissions (TODO: document which those are when adding the permission API): A new user has signed up
1110 * `admin.report ` - For accounts with appropriate permissions (TODO: document which those are when adding the permission API): A new report has been received 1110 * `admin.report ` - For accounts with appropriate permissions (TODO: document which those are when adding the permission API): A new report has been received
1111 Parameters `exclude_types` or alternately `types` are array of these types, specifying them will in- or exclude the 1111 Parameters `exclude_types` and `types` are array of these types, specifying them will in- or exclude the
1112 types of notifications given. Specifying `mentions_only` is a deprecated way to set `exclude_types` to all but mentions. 1112 types of notifications given. It is legal to give both parameters at the same tine, the result will then
1113 be the intersection of the results of both filters. Specifying `mentions_only` is a deprecated way to set
1114 `exclude_types` to all but mentions.
1113 1115
1114 Can be passed an `id` to fetch a single notification. 1116 Can be passed an `id` to fetch a single notification.
1115 1117
1116 Returns a list of `notification dicts`_. 1118 Returns a list of `notification dicts`_.
1117 """ 1119 """
1118 if mentions_only is not None: 1120 if mentions_only is not None:
1119 if exclude_types is not None: 1121 if exclude_types is None and types is None:
1120 if mentions_only: 1122 if mentions_only:
1121 if self.verify_minimum_version("3.5.0", cached=True): 1123 if self.verify_minimum_version("3.5.0", cached=True):
1122 types = ["mention"] 1124 types = ["mention"]
1123 else: 1125 else:
1124 exclude_types = ["follow", "favourite", 1126 exclude_types = ["follow", "favourite", "reblog", "poll", "follow_request"]
1125 "reblog", "poll", "follow_request"]
1126 else: 1127 else:
1127 raise MastodonIllegalArgumentError('Cannot specify exclude_types when mentions_only is present') 1128 raise MastodonIllegalArgumentError('Cannot specify exclude_types/types when mentions_only is present')
1128 del mentions_only 1129 del mentions_only
1129 1130
1130 if max_id is not None: 1131 if max_id is not None:
Powered by cgit v1.2.3 (git 2.41.0)