mirror of
https://github.com/caronc/apprise.git
synced 2025-06-25 20:21:59 +02:00
Zulip to reference the word 'stream' and not 'channel' (#330)
This commit is contained in:
parent
fa05cfa81e
commit
f68c414801
@ -79,7 +79,7 @@ The table below identifies the services this tool supports and some example serv
|
|||||||
| [XBMC](https://github.com/caronc/apprise/wiki/Notify_xbmc) | xbmc:// or xbmcs:// | (TCP) 8080 or 443 | xbmc://hostname<br />xbmc://user@hostname<br />xbmc://user:password@hostname:port
|
| [XBMC](https://github.com/caronc/apprise/wiki/Notify_xbmc) | xbmc:// or xbmcs:// | (TCP) 8080 or 443 | xbmc://hostname<br />xbmc://user@hostname<br />xbmc://user:password@hostname:port
|
||||||
| [XMPP](https://github.com/caronc/apprise/wiki/Notify_xmpp) | xmpp:// or xmpps:// | (TCP) 5222 or 5223 | xmpp://password@hostname<br />xmpp://user:password@hostname<br />xmpps://user:password@hostname:port?jid=user@hostname/resource<br/>xmpps://password@hostname/target@myhost, target2@myhost/resource
|
| [XMPP](https://github.com/caronc/apprise/wiki/Notify_xmpp) | xmpp:// or xmpps:// | (TCP) 5222 or 5223 | xmpp://password@hostname<br />xmpp://user:password@hostname<br />xmpps://user:password@hostname:port?jid=user@hostname/resource<br/>xmpps://password@hostname/target@myhost, target2@myhost/resource
|
||||||
| [Webex Teams (Cisco)](https://github.com/caronc/apprise/wiki/Notify_wxteams) | wxteams:// | (TCP) 443 | wxteams://Token
|
| [Webex Teams (Cisco)](https://github.com/caronc/apprise/wiki/Notify_wxteams) | wxteams:// | (TCP) 443 | wxteams://Token
|
||||||
| [Zulip Chat](https://github.com/caronc/apprise/wiki/Notify_zulip) | zulip:// | (TCP) 443 | zulip://botname@Organization/Token<br />zulip://botname@Organization/Token/Channel<br />zulip://botname@Organization/Token/Email
|
| [Zulip Chat](https://github.com/caronc/apprise/wiki/Notify_zulip) | zulip:// | (TCP) 443 | zulip://botname@Organization/Token<br />zulip://botname@Organization/Token/Stream<br />zulip://botname@Organization/Token/Email
|
||||||
|
|
||||||
|
|
||||||
### SMS Notification Support
|
### SMS Notification Support
|
||||||
|
@ -77,12 +77,12 @@ ZULIP_HTTP_ERROR_MAP = {
|
|||||||
401: 'Unauthorized - Invalid Token.',
|
401: 'Unauthorized - Invalid Token.',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Used to break path apart into list of channels
|
# Used to break path apart into list of streams
|
||||||
TARGET_LIST_DELIM = re.compile(r'[ \t\r\n,#\\/]+')
|
TARGET_LIST_DELIM = re.compile(r'[ \t\r\n,#\\/]+')
|
||||||
|
|
||||||
# Used to detect a channel
|
# Used to detect a streams
|
||||||
IS_VALID_TARGET_RE = re.compile(
|
IS_VALID_TARGET_RE = re.compile(
|
||||||
r'#?(?P<channel>[A-Z0-9_]{1,32})', re.I)
|
r'#?(?P<stream>[A-Z0-9_]{1,32})', re.I)
|
||||||
|
|
||||||
|
|
||||||
class NotifyZulip(NotifyBase):
|
class NotifyZulip(NotifyBase):
|
||||||
@ -142,8 +142,8 @@ class NotifyZulip(NotifyBase):
|
|||||||
'type': 'string',
|
'type': 'string',
|
||||||
'map_to': 'targets',
|
'map_to': 'targets',
|
||||||
},
|
},
|
||||||
'target_channel': {
|
'target_stream': {
|
||||||
'name': _('Target Channel'),
|
'name': _('Target Stream'),
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
'map_to': 'targets',
|
'map_to': 'targets',
|
||||||
},
|
},
|
||||||
@ -164,8 +164,8 @@ class NotifyZulip(NotifyBase):
|
|||||||
# if one isn't defined in the apprise url
|
# if one isn't defined in the apprise url
|
||||||
default_hostname = 'zulipchat.com'
|
default_hostname = 'zulipchat.com'
|
||||||
|
|
||||||
# The default channel to notify if no targets are specified
|
# The default stream to notify if no targets are specified
|
||||||
default_notification_channel = 'general'
|
default_notification_stream = 'general'
|
||||||
|
|
||||||
def __init__(self, botname, organization, token, targets=None, **kwargs):
|
def __init__(self, botname, organization, token, targets=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
@ -218,8 +218,8 @@ class NotifyZulip(NotifyBase):
|
|||||||
|
|
||||||
self.targets = parse_list(targets)
|
self.targets = parse_list(targets)
|
||||||
if len(self.targets) == 0:
|
if len(self.targets) == 0:
|
||||||
# No channels identified, use default
|
# No streams identified, use default
|
||||||
self.targets.append(self.default_notification_channel)
|
self.targets.append(self.default_notification_stream)
|
||||||
|
|
||||||
def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
|
def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -4825,11 +4825,11 @@ TEST_URLS = (
|
|||||||
('zulip://botname@apprise.zulipchat.com/{}'.format('a' * 32), {
|
('zulip://botname@apprise.zulipchat.com/{}'.format('a' * 32), {
|
||||||
'instance': plugins.NotifyZulip,
|
'instance': plugins.NotifyZulip,
|
||||||
}),
|
}),
|
||||||
# Valid everything - 2 channels specified
|
# Valid everything - 2 streams specified
|
||||||
('zulip://botname@apprise/{}/channel1/channel2'.format('a' * 32), {
|
('zulip://botname@apprise/{}/channel1/channel2'.format('a' * 32), {
|
||||||
'instance': plugins.NotifyZulip,
|
'instance': plugins.NotifyZulip,
|
||||||
}),
|
}),
|
||||||
# Valid everything - 2 channels specified (using to=)
|
# Valid everything - 2 streams specified (using to=)
|
||||||
('zulip://botname@apprise/{}/?to=channel1/channel2'.format('a' * 32), {
|
('zulip://botname@apprise/{}/?to=channel1/channel2'.format('a' * 32), {
|
||||||
'instance': plugins.NotifyZulip,
|
'instance': plugins.NotifyZulip,
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user