2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Application->Sandbox, Messenger->Application.

This commit is contained in:
John Preston
2019-01-21 17:42:21 +04:00
parent 4111da1dd0
commit a70e72f75d
117 changed files with 1363 additions and 1239 deletions

View File

@@ -152,7 +152,7 @@ inline DcId maindc() {
}
inline int32 dcstate(ShiftedDcId shiftedDcId = 0) {
if (auto instance = MainInstance()) {
if (const auto instance = MainInstance()) {
return instance->dcstate(shiftedDcId);
}
return DisconnectedState;
@@ -187,23 +187,33 @@ inline mtpRequestId send(
}
inline void sendAnything(ShiftedDcId shiftedDcId = 0, TimeMs msCanWait = 0) {
return MainInstance()->sendAnything(shiftedDcId, msCanWait);
if (const auto instance = MainInstance()) {
instance->sendAnything(shiftedDcId, msCanWait);
}
}
inline void cancel(mtpRequestId requestId) {
return MainInstance()->cancel(requestId);
if (const auto instance = MainInstance()) {
instance->cancel(requestId);
}
}
inline void ping() {
return MainInstance()->ping();
if (const auto instance = MainInstance()) {
instance->ping();
}
}
inline void killSession(ShiftedDcId shiftedDcId) {
return MainInstance()->killSession(shiftedDcId);
if (const auto instance = MainInstance()) {
instance->killSession(shiftedDcId);
}
}
inline void stopSession(ShiftedDcId shiftedDcId) {
return MainInstance()->stopSession(shiftedDcId);
if (const auto instance = MainInstance()) {
instance->stopSession(shiftedDcId);
}
}
inline int32 state(mtpRequestId requestId) { // < 0 means waiting for such count of ms