mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 08:33:09 +00:00
stricter Enabled
This commit is contained in:
1 parent
b19b5be50e
commit
283eacd9a5
2 files changed
+7
-5
No files matched your search
@@ -45,7 +45,7 @@ $( singletons
|
||||
)
|
||||
|
||||
type family HasState (p :: Party) (s :: ConnState) :: Constraint where
|
||||
HasState Recipient s = ()
|
||||
HasState Recipient _ = ()
|
||||
HasState Broker None = ()
|
||||
HasState Broker New = ()
|
||||
HasState Broker Secured = ()
|
||||
@@ -55,10 +55,11 @@ type family HasState (p :: Party) (s :: ConnState) :: Constraint where
|
||||
HasState Sender Confirmed = ()
|
||||
HasState Sender Secured = ()
|
||||
|
||||
type Enabled rs bs =
|
||||
( (rs == New || rs == Pending || rs == Confirmed || rs == Secured) ~ True,
|
||||
(bs == New || bs == Secured) ~ True
|
||||
)
|
||||
type family Enabled (rs :: ConnState) (bs :: ConnState) :: Constraint where
|
||||
Enabled New New = ()
|
||||
Enabled Pending New = ()
|
||||
Enabled Confirmed New = ()
|
||||
Enabled Secured Secured = ()
|
||||
|
||||
type PartyCmd = (Party, ConnState, ConnState)
|
||||
|
||||
|
||||
Reference in new issue
Block a user