mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 07:34:16 +00:00
core: fix status parsing 2 (#2809)
This commit is contained in:
committed by
Evgeny Poberezkin
parent
a0a567f5f7
commit
c935e8aff3
@@ -553,7 +553,8 @@ instance MsgDirectionI d => StrEncoding (CIFileStatus d) where
|
||||
instance StrEncoding ACIFileStatus where
|
||||
strEncode (AFS _ s) = strEncode s
|
||||
strP =
|
||||
statusP <|> (AFS SMDSnd . CIFSInvalid . safeDecodeUtf8 <$> A.takeByteString)
|
||||
(statusP <* A.endOfInput) -- endOfInput to make it fail on partial correct parse
|
||||
<|> (AFS SMDSnd . CIFSInvalid . safeDecodeUtf8 <$> A.takeByteString)
|
||||
where
|
||||
statusP =
|
||||
A.takeTill (== ' ') >>= \case
|
||||
@@ -673,7 +674,8 @@ instance MsgDirectionI d => StrEncoding (CIStatus d) where
|
||||
instance StrEncoding ACIStatus where
|
||||
strEncode (ACIStatus _ s) = strEncode s
|
||||
strP =
|
||||
statusP <|> (ACIStatus SMDSnd . CISInvalid . safeDecodeUtf8 <$> A.takeByteString)
|
||||
(statusP <* A.endOfInput) -- endOfInput to make it fail on partial correct parse, e.g. "snd_rcvd ok complete"
|
||||
<|> (ACIStatus SMDSnd . CISInvalid . safeDecodeUtf8 <$> A.takeByteString)
|
||||
where
|
||||
statusP =
|
||||
A.takeTill (== ' ') >>= \case
|
||||
|
||||
Reference in New Issue
Block a user