mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-06 19:52:26 +00:00
core, ui: errors for blocked files and contact addresses (#5510)
* core, ui: errors for blocked files and contact addresses * android * iOS: How it works, stub for blog post * android: blocked errors WIP * android: alert with button * update * fix encoding * nix * simplexmq
This commit is contained in:
@@ -66,7 +66,7 @@ import qualified Simplex.Messaging.Crypto.Ratchet as CR
|
||||
import Simplex.Messaging.Encoding
|
||||
import Simplex.Messaging.Encoding.String
|
||||
import Simplex.Messaging.Parsers (dropPrefix, taggedObjectJSON)
|
||||
import Simplex.Messaging.Protocol (AProtoServerWithAuth (..), AProtocolType, ProtocolServer (..), ProtocolTypeI, SProtocolType (..), UserProtocol)
|
||||
import Simplex.Messaging.Protocol (AProtoServerWithAuth (..), AProtocolType, BlockingInfo (..), BlockingReason (..), ProtocolServer (..), ProtocolTypeI, SProtocolType (..), UserProtocol)
|
||||
import qualified Simplex.Messaging.Protocol as SMP
|
||||
import Simplex.Messaging.Transport.Client (TransportHost (..))
|
||||
import Simplex.Messaging.Util (safeDecodeUtf8, tshow)
|
||||
@@ -2223,6 +2223,12 @@ viewChatError isCmd logLevel testView = \case
|
||||
[ withConnEntity
|
||||
<> "error: connection authorization failed - this could happen if connection was deleted, secured with different credentials, or due to a bug - please re-create the connection"
|
||||
]
|
||||
SMP _ (SMP.BLOCKED BlockingInfo {reason}) ->
|
||||
[withConnEntity <> "error: connection blocked by server operator: " <> reasonStr]
|
||||
where
|
||||
reasonStr = case reason of
|
||||
BRSpam -> "spam"
|
||||
BRContent -> "content violates conditions of use"
|
||||
BROKER _ NETWORK | not isCmd -> []
|
||||
BROKER _ TIMEOUT | not isCmd -> []
|
||||
AGENT A_DUPLICATE -> [withConnEntity <> "error: AGENT A_DUPLICATE" | logLevel == CLLDebug || isCmd]
|
||||
|
||||
Reference in New Issue
Block a user