simplify warnings

This commit is contained in:
Evgeny Poberezkin
2026-06-27 15:17:21 +01:00
parent 22122eed68
commit b4ce534643
2 changed files with 2 additions and 8 deletions
-2
View File
@@ -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
+2 -6
View File
@@ -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