mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-14 03:01:15 +00:00
Add bot message secure-values-sent phrases.
This commit is contained in:
parent
6de3112c8a
commit
362b3bc578
@ -825,6 +825,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_action_took_screenshot" = "{from} took a screenshot!";
|
||||
"lng_action_you_took_screenshot" = "You took a screenshot!";
|
||||
"lng_action_bot_allowed_from_domain" = "You allowed this bot to message you when you logged in on {domain}.";
|
||||
"lng_action_secure_values_sent" = "{user} received the following documents: {documents}";
|
||||
"lng_action_secure_personal_details" = "personal details";
|
||||
"lng_action_secure_proof_of_identity" = "proof of identity";
|
||||
"lng_action_secure_address" = "address";
|
||||
"lng_action_secure_proof_of_address" = "proof of address";
|
||||
"lng_action_secure_phone" = "phone number";
|
||||
"lng_action_secure_email" = "email address";
|
||||
|
||||
"lng_ttl_photo_received" = "{from} sent you a self-destructing photo. Please view it on your mobile.";
|
||||
"lng_ttl_photo_sent" = "You sent a self-destructing photo.";
|
||||
|
@ -167,8 +167,38 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||
};
|
||||
|
||||
auto prepareSecureValuesSent = [&](const MTPDmessageActionSecureValuesSent &action) {
|
||||
// #TODO passport
|
||||
return PreparedText{ QString("Secure values sent.") };
|
||||
auto result = PreparedText{};
|
||||
auto documents = QStringList();
|
||||
for (const auto &type : action.vtypes.v) {
|
||||
documents.push_back([&] {
|
||||
switch (type.type()) {
|
||||
case mtpc_secureValueTypePersonalDetails:
|
||||
return lang(lng_action_secure_personal_details);
|
||||
case mtpc_secureValueTypePassport:
|
||||
case mtpc_secureValueTypeDriverLicense:
|
||||
case mtpc_secureValueTypeIdentityCard:
|
||||
return lang(lng_action_secure_proof_of_identity);
|
||||
case mtpc_secureValueTypeAddress:
|
||||
return lang(lng_action_secure_address);
|
||||
case mtpc_secureValueTypeUtilityBill:
|
||||
case mtpc_secureValueTypeBankStatement:
|
||||
case mtpc_secureValueTypeRentalAgreement:
|
||||
return lang(lng_action_secure_proof_of_address);
|
||||
case mtpc_secureValueTypePhone:
|
||||
return lang(lng_action_secure_phone);
|
||||
case mtpc_secureValueTypeEmail:
|
||||
return lang(lng_action_secure_email);
|
||||
}
|
||||
Unexpected("Type in prepareSecureValuesSent.");
|
||||
}());
|
||||
};
|
||||
result.links.push_back(history()->peer->createOpenLink());
|
||||
result.text = lng_action_secure_values_sent(
|
||||
lt_user,
|
||||
textcmdLink(1, App::peerName(history()->peer)),
|
||||
lt_documents,
|
||||
documents.join(", "));
|
||||
return result;
|
||||
};
|
||||
|
||||
auto messageText = PreparedText {};
|
||||
|
Loading…
Reference in New Issue
Block a user