2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

API scheme updated to layer 70.

This commit is contained in:
John Preston
2017-07-12 22:14:20 +03:00
parent 5a1ec3c9e0
commit cf02a4cc31
19 changed files with 343 additions and 209 deletions

View File

@@ -151,6 +151,17 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
return result;
};
auto prepareScreenshotTaken = [this] {
auto result = PreparedText {};
if (out()) {
result.text = lang(lng_action_you_took_screenshot);
} else {
result.links.push_back(fromLink());
result.text = lng_action_took_screenshot(lt_from, fromLinkText());
}
return result;
};
auto messageText = PreparedText {};
switch (action.type()) {
@@ -169,6 +180,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
case mtpc_messageActionGameScore: messageText = prepareGameScoreText(); break;
case mtpc_messageActionPhoneCall: Unexpected("PhoneCall type in HistoryService.");
case mtpc_messageActionPaymentSent: messageText = preparePaymentSentText(); break;
case mtpc_messageActionScreenshotTaken: messageText = prepareScreenshotTaken(); break;
default: messageText.text = lang(lng_message_empty); break;
}