2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Update API scheme on layer 140.

This commit is contained in:
John Preston
2022-03-28 18:02:54 +04:00
parent 20bdbf531a
commit df15ff9f8e
18 changed files with 157 additions and 66 deletions

View File

@@ -1130,6 +1130,12 @@ ServiceAction ParseServiceAction(
};
}, [&](const MTPDmessageActionChatJoinedByRequest &data) {
result.content = ActionChatJoinedByRequest();
}, [&](const MTPDmessageActionWebViewDataSentMe &data) {
// Should not be in user inbox.
}, [&](const MTPDmessageActionWebViewDataSent &data) {
auto content = ActionWebViewDataSent();
content.text = ParseString(data.vtext());
result.content = content;
}, [](const MTPDmessageActionEmpty &data) {});
return result;
}

View File

@@ -482,6 +482,10 @@ struct ActionSetChatTheme {
struct ActionChatJoinedByRequest {
};
struct ActionWebViewDataSent {
Utf8String text;
};
struct ServiceAction {
std::variant<
v::null_t,
@@ -512,7 +516,8 @@ struct ServiceAction {
ActionSetMessagesTTL,
ActionGroupCallScheduled,
ActionSetChatTheme,
ActionChatJoinedByRequest> content;
ActionChatJoinedByRequest,
ActionWebViewDataSent> content;
};
ServiceAction ParseServiceAction(

View File

@@ -1113,6 +1113,10 @@ auto HtmlWriter::Wrap::pushMessage(
}, [&](const ActionChatJoinedByRequest &data) {
return serviceFrom
+ " joined group by request";
}, [&](const ActionWebViewDataSent &data) {
return "You have just successfully transferred data from the &laquo;"
+ SerializeString(data.text)
+ "&raquo; button to the bot";
}, [](v::null_t) { return QByteArray(); });
if (!serviceText.isEmpty()) {

View File

@@ -527,6 +527,9 @@ QByteArray SerializeMessage(
}, [&](const ActionChatJoinedByRequest &data) {
pushActor();
pushAction("join_group_by_request");
}, [&](const ActionWebViewDataSent &data) {
pushAction("send_webview_data");
push("text", data.text);
}, [](v::null_t) {});
if (v::is_null(message.action.content)) {