Skip to content

Commit

Permalink
Comments and better names
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed Jan 31, 2024
1 parent 92a9e1f commit 92d8977
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ data Push = Push

makeLenses ''Push

-- | This subsystem governs mechanisms to send notifications to users.
data NotificationSubsystem m a where
-- | Bulk push notifications
PushNotifications :: [Push] -> NotificationSubsystem m ()
-- | Bulk push notifications, but slowly. This should be used when there are
-- many notifications to be sent which could cause too much resource usage.
PushNotificationsSlowly :: [Push] -> NotificationSubsystem m ()
UserDeleted :: UserId -> NotificationSubsystem m ()
CleanupUser :: UserId -> NotificationSubsystem m ()
UnregisterPushClient :: UserId -> ClientId -> NotificationSubsystem m ()
GetPushTokens :: UserId -> NotificationSubsystem m [PushToken]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runNotificationSubsystemGundeck ::
runNotificationSubsystemGundeck cfg = interpret $ \case
PushNotifications ps -> runInputConst cfg $ pushImpl ps
PushNotificationsSlowly ps -> runInputConst cfg $ pushSlowlyImpl ps
UserDeleted uid -> GundeckAPIAccess.userDeleted uid
CleanupUser uid -> GundeckAPIAccess.userDeleted uid
UnregisterPushClient uid cid -> GundeckAPIAccess.unregisterPushClient uid cid
GetPushTokens uid -> GundeckAPIAccess.getPushTokens uid

Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/IO/Intra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ rmUser usr asts = do
remote "gundeck"
. field "user" (toByteString usr)
. msg (val "remove user")
NotificationSubsystem.userDeleted usr
NotificationSubsystem.cleanupUser usr
Log.debug $
remote "galley"
. field "user" (toByteString usr)
Expand Down

0 comments on commit 92d8977

Please sign in to comment.