2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Add FAQ and support buttons to settings.

This commit is contained in:
John Preston
2018-09-06 13:18:49 +03:00
parent 3f543347b8
commit e2207e33ef
4 changed files with 67 additions and 4 deletions

View File

@@ -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);