API to send direct and group messages (#239)

* API to send direct and group messages

* update API parsing
This commit is contained in:
Evgeny Poberezkin
2022-01-30 10:49:13 +00:00
committed by GitHub
parent cb602dd377
commit 15a91278d6
5 changed files with 171 additions and 174 deletions
+3 -2
View File
@@ -22,6 +22,7 @@ import Data.Text (Text)
import GHC.Generics (Generic)
import Numeric.Natural
import Simplex.Chat.Messages
import Simplex.Chat.Protocol
import Simplex.Chat.Store (StoreError)
import Simplex.Chat.Types
import Simplex.Messaging.Agent (AgentClient)
@@ -80,6 +81,7 @@ data ChatCommand
= APIGetChats
| APIGetChat ChatType Int64
| APIGetChatItems Int
| APISendMessage ChatType Int64 MsgContent
| ChatHelp HelpSection
| Welcome
| AddContact
@@ -116,8 +118,7 @@ data ChatCommand
data ChatResponse
= CRApiChats {chats :: [AChatPreview]}
| CRApiDirectChat {chat :: Chat 'CTDirect}
| CRApiGroupChat {gChat :: Chat 'CTGroup}
| CRApiChat {chat :: AChat}
| CRNewChatItem {chatItem :: AChatItem}
| CRCmdAccepted {corr :: CorrId}
| CRChatHelp {helpSection :: HelpSection}