Merge branch 'master' into ep/p2p-group-signing

This commit is contained in:
Evgeny Poberezkin
2026-08-01 21:24:34 +01:00
58 changed files with 1299 additions and 261 deletions
+10 -3
View File
@@ -77,11 +77,11 @@ chatCommandsDocsData :: [(String, String, [(ConsName, [String], Text, [ConsName]
chatCommandsDocsData =
[ ( "Address commands",
"Bots can use these commands to automatically check and create address when initialized",
[ ("APICreateMyAddress", ["server_"], "Create bot address.", ["CRUserContactLinkCreated", "CRChatCmdError"], [], Just UNInteractive, "/_address " <> Param "userId"),
[ ("APICreateMyAddress", ["server_"], "Create bot address.", ["CRUserContactLinkCreated", "CRChatCmdError"], [], Just UNInteractive, "/_address " <> Param "userId" <> OnOffParam "pq_ratchet" "pqRatchet" Nothing),
("APIDeleteMyAddress", [], "Delete bot address.", ["CRUserContactLinkDeleted", "CRChatCmdError"], [], Just UNBackground, "/_delete_address " <> Param "userId"),
("APIShowMyAddress", [], "Get bot address and settings.", ["CRUserContactLink", "CRChatCmdError"], [], Nothing, "/_show_address " <> Param "userId"),
("APISetProfileAddress", [], "Add address to bot profile.", ["CRUserProfileUpdated", "CRChatCmdError"], [], Just UNInteractive, "/_profile_address " <> Param "userId" <> " " <> OnOff "enable"),
("APISetAddressSettings", [], "Set bot address settings.", ["CRUserContactLinkUpdated", "CRChatCmdError"], [], Just UNInteractive, "/_address_settings " <> Param "userId" <> " " <> Json "settings")
("APISetAddressSettings", [], "Set bot address settings.", ["CRUserContactLinkUpdated", "CRChatCmdError"], [], Just UNInteractive, "/_address_settings " <> Param "userId" <> OnOffParam "pq_ratchet" "pqRatchet" Nothing <> " " <> Json "settings")
]
),
( "Message commands",
@@ -188,9 +188,14 @@ chatCommandsDocsData =
("APISetContactPrefs", [], "Configure chat preference overrides for the contact.", ["CRContactPrefsUpdated", "CRChatCmdError"], [], Just UNBackground, "/_set prefs @" <> Param "contactId" <> " " <> Json "preferences")
]
),
( "Service commands",
"Bots with a double ratchet address can answer service requests.",
[ ("APISendServiceResponse", [], "Send a reply to a received service request. Returns the connection ID that correlates the reply delivery event.", ["CRServiceReplyAccepted", "CRChatCmdError"], [], Just UNBackground, "/_service_response " <> Param "userId" <> " " <> Param "requestId" <> " " <> Json "responseData")
]
),
( "Chat management",
"These commands should not be used with CLI-based bots",
[ ("StartChat", [], "Start chat controller.", ["CRChatStarted", "CRChatRunning"], [], Nothing, "/_start"),
[ ("StartChat", [], "Start chat controller.", ["CRChatStarted", "CRChatRunning"], [], Nothing, "/_start" <> OnOffParam "main" "mainApp" Nothing <> OnOffParam "snd_files" "enableSndFiles" (Just True) <> OnOffParam "service_requests" "serviceRequests" (Just False)),
("APIStopChat", [], "Stop chat controller.", ["CRChatStopped"], [], Nothing, "/_stop")
]
)
@@ -392,11 +397,13 @@ undocumentedCommands =
"APIRejectCall",
"APIReorderChatTags",
"APIReportMessage",
"APIRotateAddressRatchetKeys",
"APISaveAppSettings",
"APISendCallAnswer",
"APISendCallExtraInfo",
"APISendCallInvitation",
"APISendCallOffer",
"APISendServiceRequest",
"APISetAppFilePaths",
"APISetChatItemTTL",
"APISetChatSettings",
+8
View File
@@ -145,6 +145,13 @@ chatEventsDocsData =
],
[]
),
( "Service events",
"Bots with a double ratchet address, started with service request processing enabled, can answer service requests - a single request with a single response (RPC).",
[ ("CEvtServiceRequest", "Service request received.\n\nThe request needs to be answered using [APISendServiceResponse](./COMMANDS.md#apisendserviceresponse) command."),
("CEvtServiceReplySent", "Service reply was sent (delivered to the server).\n\nCorrelate `connectionId` with the connection ID from the response to [APISendServiceResponse](./COMMANDS.md#apisendserviceresponse) to learn when the reply is delivered.")
],
[]
),
( "Error events",
"Bots may log these events for debugging. \
\There will be many error events - this does NOT indicate a malfunction - \
@@ -183,6 +190,7 @@ undocumentedEvents =
"CEvtContactPQEnabled",
"CEvtContactRatchetSync",
"CEvtContactRequestAlreadyAccepted",
"CEvtContactRequestRejected",
"CEvtContactSwitch",
"CEvtCustomChatEvent",
"CEvtGroupMemberRatchetSync",
+2
View File
@@ -89,6 +89,7 @@ chatResponsesDocsData =
("CRSentConfirmation", "Confirmation sent to one-time invitation"),
("CRSentGroupInvitation", "Group invitation sent"),
("CRSentInvitation", "Invitation sent to contact address"),
("CRServiceReplyAccepted", "Service reply accepted for delivery. `connectionId` correlates the reply delivery event."),
("CRSndFileCancelled", "Cancelled sending file"),
("CRUserAcceptedGroupSent", "User accepted group invitation"),
("CRUserContactLink", "User contact address"),
@@ -196,6 +197,7 @@ undocumentedResponses =
"CRSentInvitationToContact",
"CRServerOperatorConditions",
"CRServerTestResult",
"CRServiceResponse",
"CRSlowSQLQueries",
"CRSndStandaloneFileCreated",
"CRSQLResult",
+4 -1
View File
@@ -198,6 +198,7 @@ chatTypesDocsData =
-- (STI "JSONObject" [], STRecord, "", [], "Arbitrary JSON object."),
-- (STI "UTCTime" [], STRecord, "", [], "Timestampe in ISO8601 format as string."),
(STI "VersionRange" [RecordTypeInfo "VersionRange" [FieldInfo "minVersion" (ti TInt), FieldInfo "maxVersion" (ti TInt)]], STRecord, "", [], "", ""),
(STI "UserContactRequestRef" [RecordTypeInfo "UserContactRequestRef" [FieldInfo "contactRequestId" (ti TInt64), FieldInfo "rejectionSupported" (ti TBool)]], STRecord, "", [], "", ""),
(sti @(ChatItem 'CTDirect 'MDSnd), STRecord, "", [], "", ""),
(sti @(CIFile 'MDSnd), STRecord, "", [], "", ""),
(sti @(CIMeta 'CTDirect 'MDSnd), STRecord, "", [], "", ""),
@@ -209,6 +210,7 @@ chatTypesDocsData =
(sti @AddressSettings, STRecord, "", [], "", ""),
(sti @AgentCryptoError, STUnion, "", ["RATCHET_EARLIER", "RATCHET_SKIPPED"], "", ""), -- TODO add fields to types
(sti @AgentErrorType, STUnion, "", [], "", ""),
(sti @AgentServiceError, STUnion, "ASE", [], "", ""),
(sti @AutoAccept, STRecord, "", [], "", ""),
(sti @BadgeProof, STRecord, "", [], "", ""),
(sti @BlockingInfo, STRecord, "", [], "", ""),
@@ -224,7 +226,7 @@ chatTypesDocsData =
(sti @BadgeType, STEnum, "BT", ["BTUnknown"], "", ""),
(sti @ChatFeature, STEnum, "CF", [], "", ""),
(sti @ChatItemDeletion, STRecord, "", [], "", "Message deletion result."),
(sti @ChatPeerType, STEnum, "CPT", [], "", ""),
(sti @ChatPeerType, STEnum, "CPT", ["CPTUnknown"], "", ""),
(sti @ChatRef, STRecord, "", [], Param "chatType" <> Param "chatId" <> Optional "" (Param "$0") "chatScope", "Used in API commands. Chat scope can only be passed with groups."),
(sti @ChatSettings, STRecord, "", [], "", ""),
(sti @ChatStats, STRecord, "", [], "", ""),
@@ -437,6 +439,7 @@ deriving instance Generic AddRelayResult
deriving instance Generic AddressSettings
deriving instance Generic AgentCryptoError
deriving instance Generic AgentErrorType
deriving instance Generic AgentServiceError
deriving instance Generic AutoAccept
deriving instance Generic BadgeProof
deriving instance Generic BlockingInfo