Skip to content

Commit

Permalink
Merge pull request #88 from db0/mread
Browse files Browse the repository at this point in the history
feat: Allow marking mentions as read
  • Loading branch information
db0 authored Jan 27, 2024
2 parents a0e968c + f292f6b commit c5212ef
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pythorhead/mention.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@ def list(
params: dict[str, Any] = {key: value for key, value in locals(
).items() if value is not None and key != "self"}
return self._requestor.api(Request.GET, "/user/mention", params=params)

def mark_as_read(self, person_mention_id: int, read: bool) -> Optional[dict]:
"""
Mark a mention as read
Args:
person_mention_id (int)
read (bool)
Returns:
Optional[dict]: comment data if successful
"""

mark_as_read_mention = {
"person_mention_id": person_mention_id,
"read": read,
}
return self._requestor.api(Request.POST, "/user/mention/mark_as_read", json=mark_as_read_mention)

0 comments on commit c5212ef

Please sign in to comment.