MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / TransferPasswordError

Function TransferPasswordError

Telegram/SourceFiles/boxes/passcode_box.cpp:65–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void TransferPasswordError(
66 not_null<Ui::GenericBox*> box,
67 not_null<Main::Session*> session,
68 TextWithEntities &&about,
69 PasswordErrorType error) {
70 box->setTitle(tr::lng_rights_transfer_check());
71 box->setWidth(st::transferCheckWidth);
72
73 auto text = std::move(about).append('\n').append('\n').append(
74 tr::lng_rights_transfer_check_password(
75 tr::now,
76 tr::rich)
77 ).append('\n').append('\n').append(
78 tr::lng_rights_transfer_check_session(
79 tr::now,
80 tr::rich)
81 );
82 if (error == PasswordErrorType::Later) {
83 text.append('\n').append('\n').append(
84 tr::lng_rights_transfer_check_later(
85 tr::now,
86 tr::rich));
87 }
88 box->addRow(object_ptr<Ui::FlatLabel>(
89 box,
90 rpl::single(text),
91 st::boxLabel));
92 if (error == PasswordErrorType::Later) {
93 box->addButton(tr::lng_box_ok(), [=] { box->closeBox(); });
94 } else {
95 box->addButton(tr::lng_rights_transfer_set_password(), [=] {
96 SetCloudPassword(box, session);
97 });
98 box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
99 }
100}
101
102void StartPendingReset(
103 not_null<Main::Session*> session,

Callers

nothing calls this directly

Calls 5

SetCloudPasswordFunction · 0.85
setTitleMethod · 0.45
appendMethod · 0.45
addRowMethod · 0.45
addButtonMethod · 0.45

Tested by

no test coverage detected