mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add FAQ and support buttons to settings.
This commit is contained in:
@@ -4776,6 +4776,23 @@ FileLoadTo ApiWrap::fileLoadTaskOptions(const SendOptions &options) const {
|
||||
options.replyTo);
|
||||
}
|
||||
|
||||
void ApiWrap::requestSupportContact(FnMut<void(const MTPUser &)> callback) {
|
||||
_supportContactCallbacks.push_back(std::move(callback));
|
||||
if (_supportContactCallbacks.size() > 1) {
|
||||
return;
|
||||
}
|
||||
request(MTPhelp_GetSupport(
|
||||
)).done([=](const MTPhelp_Support &result) {
|
||||
result.match([&](const MTPDhelp_support &data) {
|
||||
for (auto &handler : base::take(_supportContactCallbacks)) {
|
||||
handler(data.vuser);
|
||||
}
|
||||
});
|
||||
}).fail([=](const RPCError &error) {
|
||||
_supportContactCallbacks.clear();
|
||||
}).send();
|
||||
}
|
||||
|
||||
void ApiWrap::readServerHistory(not_null<History*> history) {
|
||||
if (history->unreadCount()) {
|
||||
readServerHistoryForce(history);
|
||||
|
Reference in New Issue
Block a user