Skip to content

Commit

Permalink
zulip: Replace GET realm/filters with realm/linkifiers.
Browse files Browse the repository at this point in the history
In zulip/zulip@3947b0c, we replaced
the legacy endpoint to use the term "linkifier" instead of
"filter" and to return the data in a dictionary format.

None of the official clients currently actually use this
endpoint.
  • Loading branch information
abhijeetbodas2001 authored and timabbott committed Apr 27, 2021
1 parent 3c3c361 commit 4d482e0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions zulip/zulip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,15 +900,25 @@ def delete_custom_emoji(self, emoji_name: str) -> Dict[str, Any]:
method='DELETE',
)

def get_realm_filters(self) -> Dict[str, Any]:
def get_realm_linkifiers(self) -> Dict[str, Any]:
'''
Example usage:
>>> client.get_realm_filters()
{'result': 'success', 'msg': '', 'filters': [['#(?P<id>[0-9]+)', 'https://github.com/zulip/zulip/issues/%(id)s', 1]]}
>>> client.get_realm_linkifiers()
{
'result': 'success',
'msg': '',
'linkifiers': [
{
'id': 1,
'pattern': #(?P<id>[0-9]+)',
'url_format': 'https://github.com/zulip/zulip/issues/%(id)s',
},
]
}
'''
return self.call_endpoint(
url='realm/filters',
url='realm/linkifiers',
method='GET',
)

Expand Down

0 comments on commit 4d482e0

Please sign in to comment.