mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-16 04:30:52 +00:00
core, python: fix refused renames, extend the client API (#7379)
* core: do not commit refused name changes * feat(python): add error base and missing commands * feat(python): let callers drive startup themselves * style(python): satisfy the linter, skip generated types * feat(python): expose the message of a command error * core: update query plans * core: fix the batch limit parse error on GHC 8.10 * feat(python): reject profile images no client can render
This commit is contained in:
@@ -965,9 +965,10 @@ parseChatMessages msg = checkBatchLimit $ case B.head msg of
|
||||
checkBatchLimit ms
|
||||
| ms `lengthLE` maxBatchElementCount = ms
|
||||
| otherwise = [Left "too many messages in batch"]
|
||||
-- defined prefix: GHC 8.10 does not parse a bang operand in an infix definition
|
||||
lengthLE :: [a] -> Int -> Bool
|
||||
[] `lengthLE` !n = n >= 0
|
||||
(_ : xs) `lengthLE` !n = n > 0 && xs `lengthLE` (n - 1)
|
||||
lengthLE [] !n = n >= 0
|
||||
lengthLE (_ : xs) !n = n > 0 && lengthLE xs (n - 1)
|
||||
parseUncompressed c s = case c of
|
||||
'[' -> case J.eitherDecodeStrict' s of
|
||||
Right v -> map (fmap plainMsg . parseItem) v
|
||||
|
||||
Reference in New Issue
Block a user