core: commands to get/set network configuration (#839)

This commit is contained in:
Evgeny Poberezkin
2022-07-25 14:04:27 +01:00
committed by GitHub
parent 7dcde32680
commit f150932e44
10 changed files with 52 additions and 41 deletions
+4 -1
View File
@@ -34,7 +34,7 @@ import Simplex.Chat.Protocol
import Simplex.Chat.Store (StoreError)
import Simplex.Chat.Types
import Simplex.Messaging.Agent (AgentClient)
import Simplex.Messaging.Agent.Env.SQLite (AgentConfig, InitialAgentServers)
import Simplex.Messaging.Agent.Env.SQLite (AgentConfig, InitialAgentServers, NetworkConfig)
import Simplex.Messaging.Agent.Protocol
import Simplex.Messaging.Agent.Store.SQLite (SQLiteStore)
import qualified Simplex.Messaging.Crypto as C
@@ -143,6 +143,8 @@ data ChatCommand
| APIListMembers GroupId
| GetUserSMPServers
| SetUserSMPServers [SMPServer]
| APISetNetworkConfig NetworkConfig
| APIGetNetworkConfig
| APIContactInfo ContactId
| APIGroupMemberInfo GroupId GroupMemberId
| ContactInfo ContactName
@@ -203,6 +205,7 @@ data ChatResponse
| CRLastMessages {chatItems :: [AChatItem]}
| CRApiParsedMarkdown {formattedText :: Maybe MarkdownList}
| CRUserSMPServers {smpServers :: [SMPServer]}
| CRNetworkConfig {networkConfig :: NetworkConfig}
| CRContactInfo {contact :: Contact, connectionStats :: ConnectionStats}
| CRGroupMemberInfo {groupInfo :: GroupInfo, member :: GroupMember, connectionStats_ :: Maybe ConnectionStats}
| CRNewChatItem {chatItem :: AChatItem}