Encapsulated DcOptions to an independent class.

This commit is contained in:
John Preston
2017-02-23 09:57:04 +03:00
parent 90b3b5c3e5
commit a35947141c
24 changed files with 606 additions and 329 deletions
+5 -15
View File
@@ -829,14 +829,13 @@ int32 state(mtpRequestId requestId) {
}
void finish() {
for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) {
i.value()->kill();
delete i.value();
}
sessions.clear();
mainSession = nullptr;
for (auto session : base::take(sessions)) {
session->kill();
delete session;
}
for_const (internal::Connection *connection, quittingConnections) {
for_const (auto connection, quittingConnections) {
connection->waitTillFinish();
delete connection;
}
@@ -886,11 +885,6 @@ void clearGlobalHandlers() {
setSessionResetHandler(0);
}
void updateDcOptions(const QVector<MTPDcOption> &options) {
internal::updateDcOptions(options);
Local::writeSettings();
}
AuthKeysMap getKeys() {
return internal::getAuthKeys();
}
@@ -903,8 +897,4 @@ void setKey(int dc, const AuthKey::Data &key) {
return internal::setAuthKey(dc, std::move(keyPtr));
}
QReadWriteLock *dcOptionsMutex() {
return internal::dcOptionsMutex();
}
} // namespace MTP