@@ -2,7 +2,8 @@ import Helix.Websocket.Channel
22
33channel Helix.Account.Websocket.Channel.Account do
44 @ moduledoc """
5- Channel to notify an user of an action that affects them.
5+ Two-way channel to receive requests and send out publications to an user about
6+ actions that affects them.
67 """
78
89 alias Helix.Account.Websocket.Channel.Account.Join , as: AccountJoin
@@ -13,6 +14,7 @@ channel Helix.Account.Websocket.Channel.Account do
1314 alias Helix.Network.Websocket.Requests.Bounce.Create , as: BounceCreateRequest
1415 alias Helix.Network.Websocket.Requests.Bounce.Update , as: BounceUpdateRequest
1516 alias Helix.Network.Websocket.Requests.Bounce.Remove , as: BounceRemoveRequest
17+ alias Helix.Notification.Websocket.Requests.Read , as: NotificationReadRequest
1618 alias Helix.Software.Websocket.Requests.Virus.Collect , as: VirusCollectRequest
1719 alias Helix.Story.Websocket.Requests.Email.Reply , as: EmailReplyRequest
1820
@@ -59,7 +61,7 @@ channel Helix.Account.Websocket.Channel.Account do
5961 topic "client.setup" , ClientSetupProxyRequest
6062
6163 @ doc """
62- Notifies the backend that `action` has been performed by the player.
64+ Notifies Helix that `action` has been performed by the player.
6365
6466 Params:
6567 *action: Action performed by the player. [0]
@@ -202,10 +204,42 @@ channel Helix.Account.Websocket.Channel.Account do
202204
203205 Input:
204206 + base errors
205-
206207 """
207208 topic "bounce.remove" , BounceRemoveRequest
208209
210+ @ doc """
211+ Marks one (or all) notifications as read.
212+
213+ Params:
214+ - notification_id: Which notification to mark as read. See [1].
215+ - class: Which class the notification belongs to. See [1].
216+
217+ [1] - This request can be used to mark a single notification as read, or all
218+ notifications within a class as read. If the `notification_id` param is
219+ given, we assume only that notification must be marked as read. On the other
220+ hand, if only `class` is given, we assume all notifications of that class
221+ shall be marked as read. Only one of them must be given. If both are given,
222+ we blow up and assume the client did not read this documentation.
223+
224+ Returns: :ok
225+
226+ Events:
227+ - notification_read_event: Emitted when notification(s) are successfully read.
228+
229+ Errors:
230+
231+ Henforcer:
232+ - notification_not_found: The given `notification_id` does not exist.
233+ - notification_not_belongs: Client attempted to read a notification that
234+ belongs to another user.
235+
236+ Input:
237+ - read_the_docs: Client did not read the docs. See [1].
238+ - bad_class: The given class is not valid.
239+ + base errors
240+ """
241+ topic "notification.read" , NotificationReadRequest
242+
209243 @ doc """
210244 Collects money off of active viruses.
211245
0 commit comments