Skip to content
Snippets Groups Projects
Commit 733e9feb authored by Nico's avatar Nico
Browse files

Allow to mark messages as read

A new feature introduced in briar!1285.

Fixes #18
parent b8ac26b2
No related branches found
No related tags found
No related merge requests found
Pipeline #4866 failed
...@@ -50,3 +50,16 @@ class PrivateChat(Model): ...@@ -50,3 +50,16 @@ class PrivateChat(Model):
url = urljoin(BASE_HTTP_URL, url = urljoin(BASE_HTTP_URL,
self._API_ENDPOINT + str(self._contact_id)) self._API_ENDPOINT + str(self._contact_id))
requests.post(url, headers=self._headers, json={"text": message}) requests.post(url, headers=self._headers, json={"text": message})
def mark_read(self, messageId):
# pylint: disable=line-too-long
"""
Marks message as read
[Upstream documentation](https://code.briarproject.org/briar/briar/blob/master/briar-headless/README.md#marking-messages-as-read)
.. versionadded:: 0.0.4
"""
url = urljoin(BASE_HTTP_URL,
self._API_ENDPOINT + "read/" + str(self._contact_id))
requests.post(url, headers=self._headers, json={"messageId": messageId})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment