mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-04-28 20:19:35 +00:00
update to 9.2.0
This commit is contained in:
parent
0e17caa7a6
commit
b73fc8de38
242 changed files with 14252 additions and 5037 deletions
|
|
@ -527,4 +527,34 @@ public class UserConfig extends BaseController {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
int globalTtl = 0;
|
||||
boolean ttlIsLoading = false;
|
||||
long lastLoadingTime;
|
||||
|
||||
public int getGlobalTTl() {
|
||||
return globalTtl;
|
||||
}
|
||||
|
||||
public void loadGlobalTTl() {
|
||||
if (ttlIsLoading || System.currentTimeMillis() - lastLoadingTime < 60 * 1000) {
|
||||
return;
|
||||
}
|
||||
ttlIsLoading = true;
|
||||
TLRPC.TL_messages_getDefaultHistoryTTL getDefaultHistoryTTL = new TLRPC.TL_messages_getDefaultHistoryTTL();
|
||||
getConnectionsManager().sendRequest(getDefaultHistoryTTL, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
if (response != null) {
|
||||
globalTtl = ((TLRPC.TL_defaultHistoryTTL) response).period / 60;
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.didUpdateGlobalAutoDeleteTimer);
|
||||
ttlIsLoading = false;
|
||||
lastLoadingTime = System.currentTimeMillis();
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
public void setGlobalTtl(int ttl) {
|
||||
globalTtl = ttl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue