core: start NSE without subscriptions, update simplexmq (fix agent phase) (#750)

This commit is contained in:
Evgeny Poberezkin
2022-06-25 11:49:46 +01:00
committed by GitHub
parent 4e979aee7e
commit 313bc65457
7 changed files with 10 additions and 10 deletions

View File

@@ -133,7 +133,7 @@ func apiCreateActiveUser(_ p: Profile) throws -> User {
}
func apiStartChat() throws -> Bool {
let r = chatSendCmdSync(.startChat)
let r = chatSendCmdSync(.startChat(subscribe: true))
switch r {
case .chatStarted: return true
case .chatRunning: return false

View File

@@ -135,7 +135,7 @@ func apiGetActiveUser() -> User? {
}
func apiStartChat() throws {
let r = sendSimpleXCmd(.startChat)
let r = sendSimpleXCmd(.startChat(subscribe: false))
switch r {
case .chatStarted: return
case .chatRunning: return

View File

@@ -14,7 +14,7 @@ let jsonEncoder = getJSONEncoder()
public enum ChatCommand {
case showActiveUser
case createActiveUser(profile: Profile)
case startChat
case startChat(subscribe: Bool)
case apiStopChat
case apiSetAppPhase(appPhase: AgentPhase)
case setFilesFolder(filesFolder: String)
@@ -60,9 +60,9 @@ public enum ChatCommand {
switch self {
case .showActiveUser: return "/u"
case let .createActiveUser(profile): return "/u \(profile.displayName) \(profile.fullName)"
case .startChat: return "/_start"
case let .startChat(subscribe): return "/_start subscribe=\(subscribe ? "on" : "off")"
case .apiStopChat: return "/_stop"
case let .apiSetAppPhase(appPhase): return "/_app phase \(appPhase)"
case let .apiSetAppPhase(appPhase): return "/_app phase \(appPhase.rawValue)"
case let .setFilesFolder(filesFolder): return "/_files_folder \(filesFolder)"
case let .apiExportArchive(cfg): return "/_db export \(encodeJSON(cfg))"
case let .apiImportArchive(cfg): return "/_db import \(encodeJSON(cfg))"
@@ -367,7 +367,7 @@ struct ComposedMessage: Encodable {
var msgContent: MsgContent
}
public enum AgentPhase: String, Codable {
public enum AgentPhase: String, Decodable {
case active = "ACTIVE"
case paused = "PAUSED"
case suspended = "SUSPENDED"

View File

@@ -5,7 +5,7 @@ constraints: zip +disable-bzip2 +disable-zstd
source-repository-package
type: git
location: https://github.com/simplex-chat/simplexmq.git
tag: 70e7c71762abf7fea364d587da55ae3b7bac9b32
tag: c2f1dabcd0a2b8f7959b6946623c9620e036a103
source-repository-package
type: git

View File

@@ -1,5 +1,5 @@
{
"https://github.com/simplex-chat/simplexmq.git"."70e7c71762abf7fea364d587da55ae3b7bac9b32" = "1mkzjhhkks5qfvf0rfni6ankg11b02y529ac387d53phv4qb82ck";
"https://github.com/simplex-chat/simplexmq.git"."c2f1dabcd0a2b8f7959b6946623c9620e036a103" = "1sa0b1hl8vcr43w2zqiab2lnssdbl0jpj5gd9n5mh59b5ynvlmdr";
"https://github.com/simplex-chat/aeson.git"."3eb66f9a68f103b5f1489382aad89f5712a64db7" = "0kilkx59fl6c3qy3kjczqvm8c3f4n3p0bdk9biyflf51ljnzp4yp";
"https://github.com/simplex-chat/haskell-terminal.git"."f708b00009b54890172068f168bf98508ffcd495" = "0zmq7lmfsk8m340g47g5963yba7i88n4afa6z93sg9px5jv1mijj";
"https://github.com/zw3rk/android-support.git"."3c3a5ab0b8b137a072c98d3d0937cbdc96918ddb" = "1r6jyxbim3dsvrmakqfyxbd6ms6miaghpbwyl0sr6dzwpgaprz97";

View File

@@ -55,7 +55,7 @@ responseToView testView = \case
CRChatStarted -> ["chat started"]
CRChatRunning -> ["chat is running"]
CRChatStopped -> ["chat stopped"]
CRAppPhase _ -> []
CRAppPhase p -> ["app phase " <> sShow p]
CRApiChats chats -> if testView then testViewChats chats else [plain . bshow $ J.encode chats]
CRApiChat chat -> if testView then testViewChat chat else [plain . bshow $ J.encode chat]
CRApiParsedMarkdown ft -> [plain . bshow $ J.encode ft]

View File

@@ -49,7 +49,7 @@ extra-deps:
# - simplexmq-1.0.0@sha256:34b2004728ae396e3ae449cd090ba7410781e2b3cefc59259915f4ca5daa9ea8,8561
# - ../simplexmq
- github: simplex-chat/simplexmq
commit: 70e7c71762abf7fea364d587da55ae3b7bac9b32
commit: c2f1dabcd0a2b8f7959b6946623c9620e036a103
# - terminal-0.2.0.0@sha256:de6770ecaae3197c66ac1f0db5a80cf5a5b1d3b64a66a05b50f442de5ad39570,2977
- github: simplex-chat/aeson
commit: 3eb66f9a68f103b5f1489382aad89f5712a64db7