mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-06-08 13:02:23 +00:00
ntf: registerNtfToken rework, notification modes (#431)
* check mode for new subscriptions * check token inside actions * migration - apple -> apns * wip * register logic, modes * update mode, cron config, verify token changes * refactor * fix test * NTFMODE * server: delete subscriptions on deleteToken * refactor markNtfSubscriptionForDeletion * remove NTFMODE * remove subscriptions when token is deleted * refactor * lint * test * check ntfMode Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
@@ -80,7 +80,6 @@ data NtfTknAction
|
||||
= NTARegister
|
||||
| NTAVerify NtfRegCode -- code to verify token
|
||||
| NTACheck
|
||||
| NTACron Word16
|
||||
| NTADelete
|
||||
deriving (Show)
|
||||
|
||||
@@ -89,14 +88,12 @@ instance Encoding NtfTknAction where
|
||||
NTARegister -> "R"
|
||||
NTAVerify code -> smpEncode ('V', code)
|
||||
NTACheck -> "C"
|
||||
NTACron interval -> smpEncode ('I', interval)
|
||||
NTADelete -> "D"
|
||||
smpP =
|
||||
A.anyChar >>= \case
|
||||
'R' -> pure NTARegister
|
||||
'V' -> NTAVerify <$> smpP
|
||||
'C' -> pure NTACheck
|
||||
'I' -> NTACron <$> smpP
|
||||
'D' -> pure NTADelete
|
||||
_ -> fail "bad NtfTknAction"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user