mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-27 22:34:51 +00:00
simplify warnings
This commit is contained in:
@@ -1461,8 +1461,6 @@ instance MsgDirectionI d => ToJSON (CIFile d) where
|
||||
|
||||
$(JQ.deriveJSON (sumTypeJSON $ dropPrefix "GCS") ''GroupChatScope)
|
||||
|
||||
$(JQ.deriveJSON defaultJSON ''ChatRef)
|
||||
|
||||
$(JQ.deriveJSON (sumTypeJSON $ dropPrefix "JCI") ''JSONCIDirection)
|
||||
|
||||
instance (ChatTypeI c, MsgDirectionI d) => FromJSON (CIDirection c d) where
|
||||
|
||||
@@ -557,16 +557,12 @@ validateUserServers curr others = (currUserErrs <> concatMap otherUserErrs other
|
||||
currUserWarns = noChatRelaysWarns Nothing curr <> noNamesServersWarns Nothing curr
|
||||
otherUserWarns (user, uss) = noChatRelaysWarns (Just user) uss <> noNamesServersWarns (Just user) uss
|
||||
noChatRelaysWarns :: UserServersClass u => Maybe User -> [u] -> [UserServersWarning]
|
||||
noChatRelaysWarns user uss
|
||||
| noChatRelays opEnabled = [USWNoChatRelays user]
|
||||
| otherwise = []
|
||||
noChatRelaysWarns user uss = [USWNoChatRelays user | noChatRelays opEnabled]
|
||||
where
|
||||
noChatRelays cond = not $ any relayEnabled $ userChatRelays $ filter cond uss
|
||||
relayEnabled (AUCR _ UserChatRelay {deleted, enabled}) = enabled && not deleted
|
||||
noNamesServersWarns :: UserServersClass u => Maybe User -> [u] -> [UserServersWarning]
|
||||
noNamesServersWarns user uss
|
||||
| noNamesServers = [USWNoNamesServers user]
|
||||
| otherwise = []
|
||||
noNamesServersWarns user uss = [USWNoNamesServers user | noNamesServers]
|
||||
where
|
||||
noNamesServers = not $ any srvEnabled $ userServers SPSMP $ filter namesEnabled uss
|
||||
srvEnabled (AUS _ UserServer {deleted, enabled}) = enabled && not deleted
|
||||
|
||||
Reference in New Issue
Block a user