mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-04-29 04:29:33 +00:00
update to 9.5.2
This commit is contained in:
parent
1a48adbec4
commit
1dcd153fe2
43 changed files with 587 additions and 142 deletions
|
|
@ -13,8 +13,6 @@ import android.content.SharedPreferences;
|
|||
import android.os.SystemClock;
|
||||
import android.util.Base64;
|
||||
import android.util.LongSparseArray;
|
||||
import android.util.SparseArray;
|
||||
import android.util.SparseLongArray;
|
||||
|
||||
import org.telegram.tgnet.SerializedData;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
|
|
@ -32,7 +30,7 @@ public class UserConfig extends BaseController {
|
|||
public final static int MAX_ACCOUNT_COUNT = 4;
|
||||
|
||||
private final Object sync = new Object();
|
||||
private boolean configLoaded;
|
||||
private volatile boolean configLoaded;
|
||||
private TLRPC.User currentUser;
|
||||
public boolean registeredForPush;
|
||||
public int lastSendMessageId = -210000;
|
||||
|
|
@ -138,6 +136,9 @@ public class UserConfig extends BaseController {
|
|||
|
||||
public void saveConfig(boolean withFile) {
|
||||
NotificationCenter.getInstance(currentAccount).doOnIdle(() -> {
|
||||
if (!configLoaded) {
|
||||
return;
|
||||
}
|
||||
synchronized (sync) {
|
||||
try {
|
||||
SharedPreferences.Editor editor = getPreferences().edit();
|
||||
|
|
@ -285,7 +286,8 @@ public class UserConfig extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadConfig() {
|
||||
public void
|
||||
loadConfig() {
|
||||
synchronized (sync) {
|
||||
if (configLoaded) {
|
||||
return;
|
||||
|
|
@ -519,6 +521,16 @@ public class UserConfig extends BaseController {
|
|||
getPreferences().edit().putBoolean("2pinnedDialogsLoaded" + folderId, loaded).commit();
|
||||
}
|
||||
|
||||
public void clearPinnedDialogsLoaded() {
|
||||
SharedPreferences.Editor editor = getPreferences().edit();
|
||||
for (String key : getPreferences().getAll().keySet()) {
|
||||
if (key.startsWith("2pinnedDialogsLoaded")) {
|
||||
editor.remove(key);
|
||||
}
|
||||
}
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static final int i_dialogsLoadOffsetId = 0;
|
||||
public static final int i_dialogsLoadOffsetDate = 1;
|
||||
public static final int i_dialogsLoadOffsetUserId = 2;
|
||||
|
|
@ -597,4 +609,9 @@ public class UserConfig extends BaseController {
|
|||
public void setGlobalTtl(int ttl) {
|
||||
globalTtl = ttl;
|
||||
}
|
||||
|
||||
public void clearFilters() {
|
||||
getPreferences().edit().remove("filtersLoaded").apply();
|
||||
filtersLoaded = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue