From 2898a337524619d9710f10c64091e4c5cf414d78 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 2 Jun 2022 00:36:14 +0200 Subject: [PATCH] s/click_url/url/g in ntfy message definitions --- platypush/message/event/ntfy.py | 6 +++--- platypush/plugins/ntfy/__init__.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platypush/message/event/ntfy.py b/platypush/message/event/ntfy.py index 1709cb186..3dfb8fc8f 100644 --- a/platypush/message/event/ntfy.py +++ b/platypush/message/event/ntfy.py @@ -21,7 +21,7 @@ class NotificationEvent(Event): attachment: Optional[Mapping] = None, actions: Optional[Collection[Mapping]] = None, tags: Optional[Collection[str]] = None, - click_url: Optional[str] = None, + url: Optional[str] = None, **kwargs ): """ @@ -32,7 +32,7 @@ class NotificationEvent(Event): :param priority: Message priority. :param time: Message UNIX timestamp. :param tags: Notification tags. - :param click_url: URL spawned when the notification is clicked. + :param url: URL spawned when the notification is clicked. :param actions: List of actions associated to the notification. Example: @@ -89,6 +89,6 @@ class NotificationEvent(Event): tags=tags, attachment=attachment, actions=actions, - click_url=click_url, + url=url, **kwargs ) diff --git a/platypush/plugins/ntfy/__init__.py b/platypush/plugins/ntfy/__init__.py index d197a6b1f..f286ee4d3 100644 --- a/platypush/plugins/ntfy/__init__.py +++ b/platypush/plugins/ntfy/__init__.py @@ -95,7 +95,7 @@ class NtfyPlugin(RunnablePlugin): message=msg.get('message'), title=msg.get('title'), tags=msg.get('tags'), - click_url=msg.get('click'), + url=msg.get('click'), actions=msg.get('actions'), attachment=msg.get('attachment'), ) @@ -142,7 +142,7 @@ class NtfyPlugin(RunnablePlugin): username: Optional[str] = None, password: Optional[str] = None, title: Optional[str] = None, - click_url: Optional[str] = None, + url: Optional[str] = None, attachment: Optional[str] = None, filename: Optional[str] = None, actions: Optional[Collection[Mapping[str, str]]] = None, @@ -160,7 +160,7 @@ class NtfyPlugin(RunnablePlugin): :param username: Set if publishing to the topic requires authentication :param password: Set if publishing to the topic requires authentication :param title: Custom notification title. - :param click_url: URL that should be opened when the user clicks the + :param url: URL that should be opened when the user clicks the notification. It can be an ``http(s)://`` URL, a ``mailto:`, a ``geo:``, a link to another ntfy topic (e.g. ``ntfy://mytopic``) or a Twitter link (e.g. ``twitter://user?screen_name=myname``). @@ -240,7 +240,7 @@ class NtfyPlugin(RunnablePlugin): args['headers'] = { 'Filename': filename, **({'X-Title': title} if title else {}), - **({'X-Click': click_url} if click_url else {}), + **({'X-Click': url} if url else {}), **({'X-Email': email} if email else {}), **({'X-Priority': priority} if priority else {}), **({'X-Tags': ','.join(tags)} if tags else {}), @@ -255,7 +255,7 @@ class NtfyPlugin(RunnablePlugin): 'topic': topic, 'message': message, **({'title': title} if title else {}), - **({'click': click_url} if click_url else {}), + **({'click': url} if url else {}), **({'email': email} if email else {}), **({'priority': priority} if priority else {}), **({'tags': tags} if tags else {}),