core: pass event and response error without dedicated constructor (#5869)

* core: pass event and response error without dedicated constructor

* ios: WIP

* android, desktop: update UI for new API

* ios: fix parser

* fix showing invalid chats

* fix mobile api tests

* ios: split ChatResponse to 3 enums, decode API results on the same thread

* tweak types

* remove throws

* rename
This commit is contained in:
Evgeny 2025-05-05 11:51:22 +01:00 committed by GitHub
parent a0d1cca389
commit 24b0f0290b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 2131 additions and 2177 deletions

View file

@ -45,10 +45,10 @@ mySquaringBot _user cc = do
race_ (forever $ void getLine) . forever $ do
(_, evt) <- atomically . readTBQueue $ outputQ cc
case evt of
CEvtContactConnected _ contact _ -> do
Right (CEvtContactConnected _ contact _) -> do
contactConnected contact
sendMessage cc contact welcomeMessage
CEvtNewChatItems {chatItems = (AChatItem _ SMDRcv (DirectChat contact) ChatItem {content = mc@CIRcvMsgContent {}}) : _} -> do
Right CEvtNewChatItems {chatItems = (AChatItem _ SMDRcv (DirectChat contact) ChatItem {content = mc@CIRcvMsgContent {}}) : _} -> do
let msg = ciContentToText mc
number_ = readMaybe (T.unpack msg) :: Maybe Integer
sendMessage cc contact $ case number_ of