mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
Update to 6.0.1 (1911)
This commit is contained in:
parent
ce5e817fb5
commit
0b83be7356
4 changed files with 237 additions and 119 deletions
|
@ -285,7 +285,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig.versionCode = 1910
|
defaultConfig.versionCode = 1911
|
||||||
|
|
||||||
def tgVoipDexFileName = "libtgvoip.dex"
|
def tgVoipDexFileName = "libtgvoip.dex"
|
||||||
def tgVoipDexClasses = ["AudioRecordJNI", "AudioTrackJNI", "NativeTgVoipDelegate", "NativeTgVoipInstance", "TgVoipNativeLoader", "Resampler", "VLog"]
|
def tgVoipDexClasses = ["AudioRecordJNI", "AudioTrackJNI", "NativeTgVoipDelegate", "NativeTgVoipInstance", "TgVoipNativeLoader", "Resampler", "VLog"]
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class BuildVars {
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static boolean TON_WALLET_STANDALONE = false;
|
public static boolean TON_WALLET_STANDALONE = false;
|
||||||
public static int BUILD_VERSION = 1910;
|
public static int BUILD_VERSION = 1911;
|
||||||
public static String BUILD_VERSION_STRING = "6.0.0";
|
public static String BUILD_VERSION_STRING = "6.0.0";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
|
@ -1696,6 +1696,8 @@ public class MessagesStorage extends BaseController {
|
||||||
private int[][] bots = new int[][]{new int[2], new int[2]};
|
private int[][] bots = new int[][]{new int[2], new int[2]};
|
||||||
private int[][] channels = new int[][]{new int[2], new int[2]};
|
private int[][] channels = new int[][]{new int[2], new int[2]};
|
||||||
private int[][] groups = new int[][]{new int[2], new int[2]};
|
private int[][] groups = new int[][]{new int[2], new int[2]};
|
||||||
|
private int[] mentionChannels = new int[2];
|
||||||
|
private int[] mentionGroups = new int[2];
|
||||||
private LongSparseArray<Integer> dialogsWithMentions = new LongSparseArray<>();
|
private LongSparseArray<Integer> dialogsWithMentions = new LongSparseArray<>();
|
||||||
private LongSparseArray<Integer> dialogsWithUnread = new LongSparseArray<>();
|
private LongSparseArray<Integer> dialogsWithUnread = new LongSparseArray<>();
|
||||||
private void calcUnreadCounters(boolean apply) {
|
private void calcUnreadCounters(boolean apply) {
|
||||||
|
@ -1755,12 +1757,17 @@ public class MessagesStorage extends BaseController {
|
||||||
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
|
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
|
||||||
SparseArray<TLRPC.User> encUsersDict = new SparseArray<>();
|
SparseArray<TLRPC.User> encUsersDict = new SparseArray<>();
|
||||||
SparseArray<Integer> encryptedChatsByUsersCount = new SparseArray<>();
|
SparseArray<Integer> encryptedChatsByUsersCount = new SparseArray<>();
|
||||||
|
SparseArray<Boolean> mutedDialogs = new SparseArray<>();
|
||||||
if (!usersToLoad.isEmpty()) {
|
if (!usersToLoad.isEmpty()) {
|
||||||
getUsersInternal(TextUtils.join(",", usersToLoad), users);
|
getUsersInternal(TextUtils.join(",", usersToLoad), users);
|
||||||
for (int a = 0, N = users.size(); a < N; a++) {
|
for (int a = 0, N = users.size(); a < N; a++) {
|
||||||
TLRPC.User user = users.get(a);
|
TLRPC.User user = users.get(a);
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(user.id);
|
||||||
int idx1 = dialogsByFolders.get(user.id);
|
int idx1 = dialogsByFolders.get(user.id);
|
||||||
int idx2 = getMessagesController().isDialogMuted(user.id) && dialogsWithMentions.indexOfKey(user.id) < 0 ? 1 : 0;
|
int idx2 = muted ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(user.id, true);
|
||||||
|
}
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
bots[idx1][idx2]++;
|
bots[idx1][idx2]++;
|
||||||
} else if (user.self || user.contact) {
|
} else if (user.self || user.contact) {
|
||||||
|
@ -1788,8 +1795,12 @@ public class MessagesStorage extends BaseController {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
long did = ((long) encryptedChat.id) << 32;
|
long did = ((long) encryptedChat.id) << 32;
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(did);
|
||||||
int idx1 = dialogsByFolders.get(did);
|
int idx1 = dialogsByFolders.get(did);
|
||||||
int idx2 = getMessagesController().isDialogMuted(did) && dialogsWithMentions.indexOfKey(did) < 0 ? 1 : 0;
|
int idx2 = muted ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(user.id, true);
|
||||||
|
}
|
||||||
if (user.self || user.contact) {
|
if (user.self || user.contact) {
|
||||||
contacts[idx1][idx2]++;
|
contacts[idx1][idx2]++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1809,8 +1820,12 @@ public class MessagesStorage extends BaseController {
|
||||||
dialogsWithMentions.remove(-chat.id);
|
dialogsWithMentions.remove(-chat.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(-chat.id, chat);
|
||||||
int idx1 = dialogsByFolders.get(-chat.id);
|
int idx1 = dialogsByFolders.get(-chat.id);
|
||||||
int idx2 = getMessagesController().isDialogMuted(-chat.id, chat) && dialogsWithMentions.indexOfKey(-chat.id) < 0 ? 1 : 0;
|
int idx2 = muted && dialogsWithMentions.indexOfKey(-chat.id) < 0 ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(-chat.id, true);
|
||||||
|
}
|
||||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
channels[idx1][idx2]++;
|
channels[idx1][idx2]++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1926,6 +1941,9 @@ public class MessagesStorage extends BaseController {
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
TLRPC.User user = usersDict.get(did);
|
TLRPC.User user = usersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount++;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount++;
|
unreadCount++;
|
||||||
|
@ -1940,9 +1958,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
user = encUsersDict.get(did);
|
user = encUsersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
int count = encryptedChatsByUsersCount.get(did, 0);
|
int count = encryptedChatsByUsersCount.get(did, 0);
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount += count;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount += count;
|
unreadCount += count;
|
||||||
|
@ -1957,9 +1979,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = chatsDict.get(-did);
|
TLRPC.Chat chat = chatsDict.get(-did);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(-chat.id) >= 0 && dialogsWithMentions.indexOfKey(-chat.id) < 0) {
|
||||||
|
unreadCount++;
|
||||||
|
} else {
|
||||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
||||||
unreadCount++;
|
unreadCount++;
|
||||||
|
@ -1972,6 +1998,7 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
||||||
int did = filter.neverShow.get(b);
|
int did = filter.neverShow.get(b);
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
|
@ -3601,6 +3628,7 @@ public class MessagesStorage extends BaseController {
|
||||||
for (int b = 0; b < 2; b++) {
|
for (int b = 0; b < 2; b++) {
|
||||||
contacts[a][b] = nonContacts[a][b] = bots[a][b] = channels[a][b] = groups[a][b] = 0;
|
contacts[a][b] = nonContacts[a][b] = bots[a][b] = channels[a][b] = groups[a][b] = 0;
|
||||||
}
|
}
|
||||||
|
mentionChannels[a] = mentionGroups[a] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
final ArrayList<TLRPC.User> users = new ArrayList<>();
|
final ArrayList<TLRPC.User> users = new ArrayList<>();
|
||||||
|
@ -3610,6 +3638,7 @@ public class MessagesStorage extends BaseController {
|
||||||
ArrayList<Integer> chatsToLoad = new ArrayList<>();
|
ArrayList<Integer> chatsToLoad = new ArrayList<>();
|
||||||
ArrayList<Integer> encryptedToLoad = new ArrayList<>();
|
ArrayList<Integer> encryptedToLoad = new ArrayList<>();
|
||||||
LongSparseArray<Integer> dialogsByFolders = new LongSparseArray<>();
|
LongSparseArray<Integer> dialogsByFolders = new LongSparseArray<>();
|
||||||
|
LongSparseArray<Integer> newUnreadDialogs = new LongSparseArray<>();
|
||||||
|
|
||||||
for (int b = 0; b < 2; b++) {
|
for (int b = 0; b < 2; b++) {
|
||||||
LongSparseArray<Integer> array = b == 0 ? dialogsToUpdate : dialogsToUpdateMentions;
|
LongSparseArray<Integer> array = b == 0 ? dialogsToUpdate : dialogsToUpdateMentions;
|
||||||
|
@ -3635,6 +3664,9 @@ public class MessagesStorage extends BaseController {
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (dialogsWithMentions.indexOfKey(did) < 0 && dialogsWithUnread.indexOfKey(did) < 0) {
|
||||||
|
newUnreadDialogs.put(did, count);
|
||||||
|
}
|
||||||
if (b == 0) {
|
if (b == 0) {
|
||||||
dialogsWithUnread.put(did, count);
|
dialogsWithUnread.put(did, count);
|
||||||
/*if (BuildVars.DEBUG_VERSION) {
|
/*if (BuildVars.DEBUG_VERSION) {
|
||||||
|
@ -3647,20 +3679,16 @@ public class MessagesStorage extends BaseController {
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (b == 0 && dialogsWithMentions.indexOfKey(did) >= 0 || b == 1 && dialogsWithUnread.indexOfKey(did) >= 0) {
|
|
||||||
/*if (BuildVars.DEBUG_VERSION) {
|
if (dialogsByFolders.indexOfKey(did) < 0) {
|
||||||
FileLog.d("read = " + read + " ignore " + b);
|
|
||||||
}*/
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
SQLiteCursor cursor = database.queryFinalized("SELECT folder_id FROM dialogs WHERE did = " + did);
|
SQLiteCursor cursor = database.queryFinalized("SELECT folder_id FROM dialogs WHERE did = " + did);
|
||||||
int folderId = 0;
|
int folderId = 0;
|
||||||
if (cursor.next()) {
|
if (cursor.next()) {
|
||||||
folderId = cursor.intValue(0);
|
folderId = cursor.intValue(0);
|
||||||
}
|
}
|
||||||
cursor.dispose();
|
cursor.dispose();
|
||||||
|
|
||||||
dialogsByFolders.put(did, folderId);
|
dialogsByFolders.put(did, folderId);
|
||||||
|
}
|
||||||
|
|
||||||
int lowerId = (int) did;
|
int lowerId = (int) did;
|
||||||
int highId = (int) (did >> 32);
|
int highId = (int) (did >> 32);
|
||||||
|
@ -3685,12 +3713,17 @@ public class MessagesStorage extends BaseController {
|
||||||
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
|
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
|
||||||
SparseArray<TLRPC.User> encUsersDict = new SparseArray<>();
|
SparseArray<TLRPC.User> encUsersDict = new SparseArray<>();
|
||||||
SparseArray<Integer> encryptedChatsByUsersCount = new SparseArray<>();
|
SparseArray<Integer> encryptedChatsByUsersCount = new SparseArray<>();
|
||||||
|
SparseArray<Boolean> mutedDialogs = new SparseArray<>();
|
||||||
if (!usersToLoad.isEmpty()) {
|
if (!usersToLoad.isEmpty()) {
|
||||||
getUsersInternal(TextUtils.join(",", usersToLoad), users);
|
getUsersInternal(TextUtils.join(",", usersToLoad), users);
|
||||||
for (int a = 0, N = users.size(); a < N; a++) {
|
for (int a = 0, N = users.size(); a < N; a++) {
|
||||||
TLRPC.User user = users.get(a);
|
TLRPC.User user = users.get(a);
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(user.id);
|
||||||
int idx1 = dialogsByFolders.get(user.id);
|
int idx1 = dialogsByFolders.get(user.id);
|
||||||
int idx2 = getMessagesController().isDialogMuted(user.id) && (dialogsToUpdateMentions == null || dialogsToUpdateMentions.indexOfKey(user.id) < 0) ? 1 : 0;
|
int idx2 = muted ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(user.id, true);
|
||||||
|
}
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
bots[idx1][idx2]++;
|
bots[idx1][idx2]++;
|
||||||
} else if (user.self || user.contact) {
|
} else if (user.self || user.contact) {
|
||||||
|
@ -3718,8 +3751,12 @@ public class MessagesStorage extends BaseController {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
long did = ((long) encryptedChat.id) << 32;
|
long did = ((long) encryptedChat.id) << 32;
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(did);
|
||||||
int idx1 = dialogsByFolders.get(did);
|
int idx1 = dialogsByFolders.get(did);
|
||||||
int idx2 = getMessagesController().isDialogMuted(did) && (dialogsToUpdateMentions == null || dialogsToUpdateMentions.indexOfKey(did) < 0) ? 1 : 0;
|
int idx2 = muted ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(user.id, true);
|
||||||
|
}
|
||||||
if (user.self || user.contact) {
|
if (user.self || user.contact) {
|
||||||
contacts[idx1][idx2]++;
|
contacts[idx1][idx2]++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3737,13 +3774,28 @@ public class MessagesStorage extends BaseController {
|
||||||
if (chat.migrated_to instanceof TLRPC.TL_inputChannel || ChatObject.isNotInChat(chat)) {
|
if (chat.migrated_to instanceof TLRPC.TL_inputChannel || ChatObject.isNotInChat(chat)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
boolean muted = getMessagesController().isDialogMuted(-chat.id, chat);
|
||||||
|
boolean hasUnread = dialogsWithUnread.indexOfKey(-chat.id) >= 0;
|
||||||
|
boolean hasMention = dialogsWithMentions.indexOfKey(-chat.id) >= 0;
|
||||||
int idx1 = dialogsByFolders.get(-chat.id);
|
int idx1 = dialogsByFolders.get(-chat.id);
|
||||||
int idx2 = getMessagesController().isDialogMuted(-chat.id, chat) && (dialogsToUpdateMentions == null || dialogsToUpdateMentions.indexOfKey(-chat.id) < 0) ? 1 : 0;
|
int idx2 = muted ? 1 : 0;
|
||||||
|
if (muted) {
|
||||||
|
mutedDialogs.put(-chat.id, true);
|
||||||
|
}
|
||||||
|
if (muted && dialogsToUpdateMentions != null && dialogsToUpdateMentions.indexOfKey(-chat.id) >= 0) {
|
||||||
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
|
mentionChannels[idx1]++;
|
||||||
|
} else {
|
||||||
|
mentionGroups[idx1]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (read && !hasUnread && !hasMention || !read && newUnreadDialogs.indexOfKey(-chat.id) >= 0) {
|
||||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
channels[idx1][idx2]++;
|
channels[idx1][idx2]++;
|
||||||
} else {
|
} else {
|
||||||
groups[idx1][idx2]++;
|
groups[idx1][idx2]++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
chatsDict.put(chat.id, chat);
|
chatsDict.put(chat.id, chat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3816,12 +3868,16 @@ public class MessagesStorage extends BaseController {
|
||||||
unreadCount -= groups[0][0];
|
unreadCount -= groups[0][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount -= groups[0][1];
|
unreadCount -= groups[0][1];
|
||||||
|
} else {
|
||||||
|
unreadCount -= mentionGroups[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
||||||
unreadCount -= groups[1][0];
|
unreadCount -= groups[1][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount -= groups[1][1];
|
unreadCount -= groups[1][1];
|
||||||
|
} else {
|
||||||
|
unreadCount -= mentionGroups[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3830,12 +3886,16 @@ public class MessagesStorage extends BaseController {
|
||||||
unreadCount -= channels[0][0];
|
unreadCount -= channels[0][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount -= channels[0][1];
|
unreadCount -= channels[0][1];
|
||||||
|
} else {
|
||||||
|
unreadCount -= mentionChannels[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
||||||
unreadCount -= channels[1][0];
|
unreadCount -= channels[1][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount -= channels[1][1];
|
unreadCount -= channels[1][1];
|
||||||
|
} else {
|
||||||
|
unreadCount -= mentionChannels[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3859,6 +3919,9 @@ public class MessagesStorage extends BaseController {
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
TLRPC.User user = usersDict.get(did);
|
TLRPC.User user = usersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount--;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount--;
|
unreadCount--;
|
||||||
|
@ -3873,9 +3936,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
user = encUsersDict.get(did);
|
user = encUsersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
int count = encryptedChatsByUsersCount.get(did, 0);
|
int count = encryptedChatsByUsersCount.get(did, 0);
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount -= count;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount -= count;
|
unreadCount -= count;
|
||||||
|
@ -3890,9 +3957,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = chatsDict.get(-did);
|
TLRPC.Chat chat = chatsDict.get(-did);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(-chat.id) >= 0 && dialogsWithMentions.indexOfKey(-chat.id) < 0 && dialogsWithUnread.indexOfKey(-chat.id) < 0) {
|
||||||
|
unreadCount--;
|
||||||
|
} else {
|
||||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
||||||
unreadCount--;
|
unreadCount--;
|
||||||
|
@ -3905,8 +3976,12 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
||||||
int did = filter.neverShow.get(b);
|
int did = filter.neverShow.get(b);
|
||||||
|
if (dialogsToUpdateMentions != null && dialogsToUpdateMentions.indexOfKey(did) >= 0 && mutedDialogs.indexOfKey(did) < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
TLRPC.User user = usersDict.get(did);
|
TLRPC.User user = usersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
@ -3961,12 +4036,16 @@ public class MessagesStorage extends BaseController {
|
||||||
unreadCount += groups[0][0];
|
unreadCount += groups[0][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount += groups[0][1];
|
unreadCount += groups[0][1];
|
||||||
|
} else {
|
||||||
|
unreadCount += mentionGroups[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
||||||
unreadCount += groups[1][0];
|
unreadCount += groups[1][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount += groups[1][1];
|
unreadCount += groups[1][1];
|
||||||
|
} else {
|
||||||
|
unreadCount += mentionGroups[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3975,12 +4054,16 @@ public class MessagesStorage extends BaseController {
|
||||||
unreadCount += channels[0][0];
|
unreadCount += channels[0][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount += channels[0][1];
|
unreadCount += channels[0][1];
|
||||||
|
} else {
|
||||||
|
unreadCount += mentionChannels[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED) == 0) {
|
||||||
unreadCount += channels[1][0];
|
unreadCount += channels[1][0];
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) == 0) {
|
||||||
unreadCount += channels[1][1];
|
unreadCount += channels[1][1];
|
||||||
|
} else {
|
||||||
|
unreadCount += mentionChannels[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3999,11 +4082,36 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (filter != null) {
|
if (filter != null) {
|
||||||
|
if (!filter.alwaysShow.isEmpty()) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0) {
|
||||||
|
for (int b = 0, N2 = dialogsToUpdateMentions.size(); b < N2; b++) {
|
||||||
|
int did = (int) dialogsToUpdateMentions.keyAt(b);
|
||||||
|
TLRPC.Chat chat = chatsDict.get(-did);
|
||||||
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_GROUPS) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mutedDialogs.indexOfKey(did) >= 0 && filter.alwaysShow.indexOf(did) >= 0) {
|
||||||
|
unreadCount--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int b = 0, N2 = filter.alwaysShow.size(); b < N2; b++) {
|
for (int b = 0, N2 = filter.alwaysShow.size(); b < N2; b++) {
|
||||||
int did = filter.alwaysShow.get(b);
|
int did = filter.alwaysShow.get(b);
|
||||||
|
if (newUnreadDialogs.indexOfKey(did) < 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
TLRPC.User user = usersDict.get(did);
|
TLRPC.User user = usersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount++;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount++;
|
unreadCount++;
|
||||||
|
@ -4018,9 +4126,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
user = encUsersDict.get(did);
|
user = encUsersDict.get(did);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
int count = encryptedChatsByUsersCount.get(did, 0);
|
int count = encryptedChatsByUsersCount.get(did, 0);
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(user.id) >= 0) {
|
||||||
|
unreadCount += count;
|
||||||
|
} else {
|
||||||
if (user.bot) {
|
if (user.bot) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_BOTS) == 0) {
|
||||||
unreadCount += count;
|
unreadCount += count;
|
||||||
|
@ -4035,9 +4147,13 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
TLRPC.Chat chat = chatsDict.get(-did);
|
TLRPC.Chat chat = chatsDict.get(-did);
|
||||||
if (chat != null) {
|
if (chat != null) {
|
||||||
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED) != 0 && mutedDialogs.indexOfKey(-chat.id) >= 0) {
|
||||||
|
unreadCount++;
|
||||||
|
} else {
|
||||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||||
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
if ((flags & MessagesController.DIALOG_FILTER_FLAG_CHANNELS) == 0) {
|
||||||
unreadCount++;
|
unreadCount++;
|
||||||
|
@ -4050,6 +4166,8 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
for (int b = 0, N2 = filter.neverShow.size(); b < N2; b++) {
|
||||||
int did = filter.neverShow.get(b);
|
int did = filter.neverShow.get(b);
|
||||||
if (did > 0) {
|
if (did > 0) {
|
||||||
|
|
|
@ -434,8 +434,8 @@ public class UndoView extends FrameLayout {
|
||||||
|
|
||||||
layoutParams.leftMargin = AndroidUtilities.dp(58);
|
layoutParams.leftMargin = AndroidUtilities.dp(58);
|
||||||
layoutParams.rightMargin = margin;
|
layoutParams.rightMargin = margin;
|
||||||
layoutParams.topMargin = 0;
|
layoutParams.topMargin = AndroidUtilities.dp(6);
|
||||||
layoutParams.bottomMargin = AndroidUtilities.dp(1);
|
layoutParams.bottomMargin = AndroidUtilities.dp(7);
|
||||||
layoutParams.height = TableLayout.LayoutParams.MATCH_PARENT;
|
layoutParams.height = TableLayout.LayoutParams.MATCH_PARENT;
|
||||||
|
|
||||||
subinfoTextView.setVisibility(GONE);
|
subinfoTextView.setVisibility(GONE);
|
||||||
|
|
Loading…
Reference in a new issue