mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-16 04:55:48 +00:00
core: add custom data commands, fix groups parser (#6691)
* core: add custom data commands, fix groups parser
- Add APISetGroupCustomData and APISetContactCustomData to ChatCommand,
with parsers (/_set custom #, /_set custom @) and processors
following the APISetChatUIThemes pattern
- Fix APIListGroups parser missing space ("/_groups" -> "/_groups ")
to align with auto-generated cmdString
- Add chatCommandsDocsData entries for APISetGroupCustomData,
APISetContactCustomData, and APISetUserAutoAcceptMemberContacts
* core: named fields for codegen, run codegen
- Use named record fields for APISetGroupCustomData,
APISetContactCustomData, APISetUserAutoAcceptMemberContacts
(required for chatCommandsDocsData field resolution)
- Fix OnOff field name to "onOff" (avoids clash with User field)
- Remove APISetUserAutoAcceptMemberContacts from undocumentedCommands
- Regenerate COMMANDS.md and commands.ts
* nodejs: add ChatApi wrappers for custom data and apiGetChat
- apiSetGroupCustomData, apiSetContactCustomData
- apiSetAutoAcceptMemberContacts
- apiGetChat (manual wrapper, APIGetChat undocumented)
This commit is contained in:
@@ -142,7 +142,10 @@ chatCommandsDocsData =
|
||||
"Commands to list and delete conversations.",
|
||||
[ ("APIListContacts", [], "Get contacts.", ["CRContactsList", "CRChatCmdError"], [], Nothing, "/_contacts " <> Param "userId"),
|
||||
("APIListGroups", [], "Get groups.", ["CRGroupsList", "CRChatCmdError"], [], Nothing, "/_groups " <> Param "userId" <> Optional "" (" @" <> Param "$0") "contactId_" <> Optional "" (" " <> Param "$0") "search"),
|
||||
("APIDeleteChat", [], "Delete chat.", ["CRContactDeleted", "CRContactConnectionDeleted", "CRGroupDeletedUser", "CRChatCmdError"], [], Just UNBackground, "/_delete " <> Param "chatRef" <> " " <> Param "chatDeleteMode")
|
||||
("APIDeleteChat", [], "Delete chat.", ["CRContactDeleted", "CRContactConnectionDeleted", "CRGroupDeletedUser", "CRChatCmdError"], [], Just UNBackground, "/_delete " <> Param "chatRef" <> " " <> Param "chatDeleteMode"),
|
||||
("APISetGroupCustomData", [], "Set group custom data.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set custom #" <> Param "groupId" <> Optional "" (" " <> Json "$0") "customData"),
|
||||
("APISetContactCustomData", [], "Set contact custom data.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set custom @" <> Param "contactId" <> Optional "" (" " <> Json "$0") "customData"),
|
||||
("APISetUserAutoAcceptMemberContacts", [], "Set auto-accept member contacts.", ["CRCmdOk", "CRChatCmdError"], [], Nothing, "/_set accept member contacts " <> Param "userId" <> " " <> OnOff "onOff")
|
||||
-- ("APIChatItemsRead", [], "Mark items as read.", ["CRItemsReadForChat"], [], Nothing, ""),
|
||||
-- ("APIChatRead", [], "Mark chat as read.", ["CRCmdOk"], [], Nothing, ""),
|
||||
-- ("APIChatUnread", [], "Mark chat as unread.", ["CRCmdOk"], [], Nothing, ""),
|
||||
@@ -398,7 +401,6 @@ undocumentedCommands =
|
||||
"APISetServerOperators",
|
||||
"APISetUserContactReceipts",
|
||||
"APISetUserGroupReceipts",
|
||||
"APISetUserAutoAcceptMemberContacts",
|
||||
"APISetUserServers",
|
||||
"APISetUserUIThemes",
|
||||
"APIStandaloneFileInfo",
|
||||
|
||||
Reference in New Issue
Block a user