diff --git a/src/Simplex/Chat/Messages.hs b/src/Simplex/Chat/Messages.hs index 2655d53161..5800ab5bdd 100644 --- a/src/Simplex/Chat/Messages.hs +++ b/src/Simplex/Chat/Messages.hs @@ -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 diff --git a/src/Simplex/Chat/Operators.hs b/src/Simplex/Chat/Operators.hs index 0aa4036cbc..ad03529613 100644 --- a/src/Simplex/Chat/Operators.hs +++ b/src/Simplex/Chat/Operators.hs @@ -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