正在查看: 北京退费客服端 v1.0.0 应用的 MessagesController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 北京退费客服端 v1.0.0 应用的 MessagesController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package im.amwhusedvt.messenger;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.LongSparseArray;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
import com.baidu.location.BDLocation;
import com.bjz.comm.net.utils.AppPreferenceUtil;
import im.amwhusedvt.javaBean.fc.FollowedFcListBean;
import im.amwhusedvt.javaBean.fc.HomeFcListBean;
import im.amwhusedvt.javaBean.fc.RecommendFcListBean;
import im.amwhusedvt.messenger.-$;
import im.amwhusedvt.messenger.MessagesStorage;
import im.amwhusedvt.messenger.NotificationCenter;
import im.amwhusedvt.messenger.support.SparseLongArray;
import im.amwhusedvt.sqlite.SQLiteCursor;
import im.amwhusedvt.tgnet.ConnectionsManager;
import im.amwhusedvt.tgnet.NativeByteBuffer;
import im.amwhusedvt.tgnet.RequestDelegate;
import im.amwhusedvt.tgnet.TLObject;
import im.amwhusedvt.tgnet.TLRPC;
import im.amwhusedvt.tgnet.TLRPCChats;
import im.amwhusedvt.tgnet.TLRPCContacts;
import im.amwhusedvt.ui.ChatActivity;
import im.amwhusedvt.ui.DialogsActivity;
import im.amwhusedvt.ui.ProfileActivity;
import im.amwhusedvt.ui.actionbar.AlertDialog;
import im.amwhusedvt.ui.actionbar.BaseFragment;
import im.amwhusedvt.ui.actionbar.Theme;
import im.amwhusedvt.ui.components.AlertsCreator;
import im.amwhusedvt.ui.components.toast.ToastUtils;
import im.amwhusedvt.ui.hui.chats.NewProfileActivity;
import im.amwhusedvt.ui.hui.contacts.AddContactsInfoActivity;
import im.amwhusedvt.ui.hui.friendscircle_v1.helper.FcDBHelper;
import im.amwhusedvt.ui.hviews.helper.MryDeviceHelper;
import java.io.File;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
public class MessagesController extends BaseController implements NotificationCenter.NotificationCenterDelegate {
private static volatile MessagesController[] Instance = new MessagesController[3];
public static final int UPDATE_MASK_ALL = 1535;
public static final int UPDATE_MASK_AVATAR = 2;
public static final int UPDATE_MASK_CHAT = 8192;
public static final int UPDATE_MASK_CHAT_AVATAR = 8;
public static final int UPDATE_MASK_CHAT_MEMBERS = 32;
public static final int UPDATE_MASK_CHAT_NAME = 16;
public static final int UPDATE_MASK_CHECK = 65536;
public static final int UPDATE_MASK_MESSAGE_TEXT = 32768;
public static final int UPDATE_MASK_NAME = 1;
public static final int UPDATE_MASK_NEW_MESSAGE = 2048;
public static final int UPDATE_MASK_PHONE = 1024;
public static final int UPDATE_MASK_READ_DIALOG_MESSAGE = 256;
public static final int UPDATE_MASK_REORDER = 131072;
public static final int UPDATE_MASK_SELECT_DIALOG = 512;
public static final int UPDATE_MASK_SEND_STATE = 4096;
public static final int UPDATE_MASK_STATUS = 4;
public static final int UPDATE_MASK_USER_PHONE = 128;
public static final int UPDATE_MASK_USER_PRINT = 64;
private static volatile long lastPasswordCheckTime;
private static volatile long lastThemeCheckTime;
private int DIALOGS_LOAD_TYPE_CACHE;
private int DIALOGS_LOAD_TYPE_CHANNEL;
private int DIALOGS_LOAD_TYPE_UNKNOWN;
protected ArrayList<TLRPC.Dialog> allDialogs;
public float animatedEmojisZoom;
public int availableMapProviders;
public boolean blockedCountry;
public boolean blockedEndReached;
public SparseIntArray blockedUsers;
public int callConnectTimeout;
public int callPacketTimeout;
public int callReceiveTimeout;
public int callRingTimeout;
public boolean canRevokePmInbox;
private SparseArray<SparseArray<String>> channelAdmins;
private SparseArray<ArrayList<Integer>> channelViewsToSend;
private SparseIntArray channelsPts;
private ConcurrentHashMap<Integer, TLRPC.Chat> chats;
private SparseBooleanArray checkingLastMessagesDialogs;
private boolean checkingProxyInfo;
private int checkingProxyInfoRequestId;
private boolean checkingTosUpdate;
private LongSparseArray<TLRPC.Dialog> clearingHistoryDialogs;
private boolean contactsGetDiff;
private ArrayList<Long> createdDialogIds;
private ArrayList<Long> createdDialogMainThreadIds;
private ArrayList<Long> createdScheduledDialogIds;
private Runnable currentDeleteTaskRunnable;
private int currentDeletingTaskChannelId;
private ArrayList<Integer> currentDeletingTaskMids;
private int currentDeletingTaskTime;
public String dcDomainName;
public boolean defaultP2pContacts;
public LongSparseArray<Integer> deletedHistory;
private LongSparseArray<TLRPC.Dialog> deletingDialogs;
private final Comparator<TLRPC.Dialog> dialogComparator;
public LongSparseArray<MessageObject> dialogMessage;
public SparseArray<MessageObject> dialogMessagesByIds;
public LongSparseArray<MessageObject> dialogMessagesByRandomIds;
private SparseArray<ArrayList<TLRPC.Dialog>> dialogsByFolder;
public ArrayList<TLRPC.Dialog> dialogsCanAddUsers;
public ArrayList<TLRPC.Dialog> dialogsChannelsOnly;
private SparseBooleanArray dialogsEndReached;
public ArrayList<TLRPC.Dialog> dialogsForward;
public ArrayList<TLRPC.Dialog> dialogsGroupsOnly;
private boolean dialogsInTransaction;
public boolean dialogsLoaded;
public ArrayList<TLRPC.Dialog> dialogsServerOnly;
public ArrayList<TLRPC.Dialog> dialogsUnreadOnly;
public ArrayList<TLRPC.Dialog> dialogsUsersOnly;
public LongSparseArray<TLRPC.Dialog> dialogs_dict;
public ConcurrentHashMap<Long, Integer> dialogs_read_inbox_max;
public ConcurrentHashMap<Long, Integer> dialogs_read_outbox_max;
private SharedPreferences emojiPreferences;
public boolean enableDigitCoin;
public boolean enableHub;
public boolean enableJoined;
public boolean enableWallet;
private ConcurrentHashMap<Integer, TLRPC.EncryptedChat> encryptedChats;
private SparseArray<TLRPC.ExportedChatInvite> exportedChats;
public boolean firstGettingTask;
private SparseArray<TLRPC.ChatFull> fullChats;
private SparseArray<TLRPC.UserFull> fullUsers;
private boolean getDifferenceFirstSync;
public boolean gettingDifference;
private SparseBooleanArray gettingDifferenceChannels;
private boolean gettingNewDeleteTask;
private SparseBooleanArray gettingUnknownChannels;
private LongSparseArray<Boolean> gettingUnknownDialogs;
public String gifSearchBot;
public ArrayList<TLRPC.RecentMeUrl> hintDialogs;
public String imageSearchBot;
private String installReferer;
private boolean isLeftProxyChannel;
private ArrayList<Integer> joiningToChannels;
private int lastCheckProxyId;
private int lastPrintingStringCount;
private long lastPushRegisterSendTime;
private LongSparseArray<Long> lastScheduledServerQueryTime;
private long lastStatusUpdateTime;
private long lastViewsCheckTime;
public String linkPrefix;
private ArrayList<Integer> loadedFullChats;
private ArrayList<Integer> loadedFullParticipants;
private ArrayList<Integer> loadedFullUsers;
private boolean loadingAppConfig;
public boolean loadingBlockedUsers;
private SparseIntArray loadingChannelAdmins;
private SparseBooleanArray loadingDialogs;
private ArrayList<Integer> loadingFullChats;
private ArrayList<Integer> loadingFullParticipants;
private ArrayList<Integer> loadingFullUsers;
private int loadingNotificationSettings;
private boolean loadingNotificationSignUpSettings;
private LongSparseArray<Boolean> loadingPeerSettings;
private SparseIntArray loadingPinnedDialogs;
private boolean loadingUnreadDialogs;
private SharedPreferences mainPreferences;
public String mapKey;
public int mapProvider;
public int maxBroadcastCount;
public int maxCaptionLength;
public int maxEditTime;
public int maxFaveStickersCount;
public int maxFolderPinnedDialogsCount;
public int maxGroupCount;
public int maxMegagroupCount;
public int maxMessageLength;
public int maxPinnedDialogsCount;
public int maxRecentGifsCount;
public int maxRecentStickersCount;
private SparseIntArray migratedChats;
private boolean migratingDialogs;
public int minGroupConvertSize;
private SparseIntArray needShortPollChannels;
private SparseIntArray needShortPollOnlines;
private SparseIntArray nextDialogsCacheOffset;
private int nextProxyInfoCheckTime;
private int nextTosCheckTime;
private SharedPreferences notificationsPreferences;
private ConcurrentHashMap<String, TLObject> objectsByUsernames;
private boolean offlineSent;
public ConcurrentHashMap<Integer, Integer> onlinePrivacy;
private Runnable passwordCheckRunnable;
private LongSparseArray<SparseArray<MessageObject>> pollsToCheck;
private int pollsToCheckSize;
public boolean preloadFeaturedStickers;
public LongSparseArray<CharSequence> printingStrings;
public LongSparseArray<Integer> printingStringsTypes;
public ConcurrentHashMap<Long, ArrayList<PrintingUser>> printingUsers;
private TLRPC.Dialog proxyDialog;
private String proxyDialogAddress;
private long proxyDialogId;
public int ratingDecay;
private ArrayList<ReadTask> readTasks;
private LongSparseArray<ReadTask> readTasksMap;
public boolean registeringForPush;
private LongSparseArray<ArrayList<Integer>> reloadingMessages;
private HashMap<String, ArrayList<MessageObject>> reloadingScheduledWebpages;
private LongSparseArray<ArrayList<MessageObject>> reloadingScheduledWebpagesPending;
private HashMap<String, ArrayList<MessageObject>> reloadingWebpages;
private LongSparseArray<ArrayList<MessageObject>> reloadingWebpagesPending;
private TLRPC.messages_Dialogs resetDialogsAll;
private TLRPC.TL_messages_peerDialogs resetDialogsPinned;
private boolean resetingDialogs;
public int revokeTimeLimit;
public int revokeTimePmLimit;
public int secretWebpagePreview;
public SparseArray<LongSparseArray<Boolean>> sendingTypings;
private SparseBooleanArray serverDialogsEndReached;
public String sharePrefix;
private SparseIntArray shortPollChannels;
private SparseIntArray shortPollOnlines;
private int statusRequest;
private int statusSettingState;
public boolean suggestContacts;
public String suggestedLangCode;
private Runnable themeCheckRunnable;
public int totalBlockedCount;
public int unreadUnmutedDialogs;
private final Comparator<TLRPC.Update> updatesComparator;
private SparseArray<ArrayList<TLRPC.Updates>> updatesQueueChannels;
private ArrayList<TLRPC.Updates> updatesQueuePts;
private ArrayList<TLRPC.Updates> updatesQueueQts;
private ArrayList<TLRPC.Updates> updatesQueueSeq;
private SparseLongArray updatesStartWaitTimeChannels;
private long updatesStartWaitTimePts;
private long updatesStartWaitTimeQts;
private long updatesStartWaitTimeSeq;
public boolean updatingState;
private String uploadingAvatar;
private HashMap<String, Theme.ThemeInfo> uploadingThemes;
private String uploadingWallpaper;
private boolean uploadingWallpaperBlurred;
private boolean uploadingWallpaperMotion;
private ConcurrentHashMap<Integer, TLRPC.User> users;
public String venueSearchBot;
private ArrayList<Long> visibleDialogMainThreadIds;
private ArrayList<Long> visibleScheduledDialogMainThreadIds;
public int webFileDatacenterId;
public static class PrintingUser {
public TLRPC.SendMessageAction action;
public long lastTime;
public int userId;
}
private void addDialogToItsFolder(int i, TLRPC.Dialog dialog, boolean z, byte b, String str, short s, char c) {
double d = (42 * 210) + 210;
}
private void addDialogToItsFolder(int i, TLRPC.Dialog dialog, boolean z, char c, byte b, short s, String str) {
double d = (42 * 210) + 210;
}
private void addDialogToItsFolder(int i, TLRPC.Dialog dialog, boolean z, short s, byte b, String str, char c) {
double d = (42 * 210) + 210;
}
private void applyDialogNotificationsSettings(long j, TLRPC.PeerNotifySettings peerNotifySettings, int i, String str, float f, short s) {
double d = (42 * 210) + 210;
}
private void applyDialogNotificationsSettings(long j, TLRPC.PeerNotifySettings peerNotifySettings, String str, float f, short s, int i) {
double d = (42 * 210) + 210;
}
private void applyDialogNotificationsSettings(long j, TLRPC.PeerNotifySettings peerNotifySettings, short s, float f, int i, String str) {
double d = (42 * 210) + 210;
}
private void applyDialogsNotificationsSettings(ArrayList arrayList, String str, int i, byte b, short s) {
double d = (42 * 210) + 210;
}
private void applyDialogsNotificationsSettings(ArrayList arrayList, short s, int i, String str, byte b) {
double d = (42 * 210) + 210;
}
private void applyDialogsNotificationsSettings(ArrayList arrayList, short s, String str, byte b, int i) {
double d = (42 * 210) + 210;
}
private void checkChannelError(String str, int i, char c, String str2, float f, short s) {
double d = (42 * 210) + 210;
}
private void checkChannelError(String str, int i, float f, char c, String str2, short s) {
double d = (42 * 210) + 210;
}
private void checkChannelError(String str, int i, String str2, char c, float f, short s) {
double d = (42 * 210) + 210;
}
private void checkDeletingTask(boolean z, int i, float f, short s, boolean z2) {
double d = (42 * 210) + 210;
}
private void checkDeletingTask(boolean z, int i, boolean z2, short s, float f) {
double d = (42 * 210) + 210;
}
private void checkDeletingTask(boolean z, boolean z2, int i, short s, float f) {
double d = (42 * 210) + 210;
}
private void checkProxyInfoInternal(boolean z, byte b, float f, short s, boolean z2) {
double d = (42 * 210) + 210;
}
private void checkProxyInfoInternal(boolean z, short s, float f, boolean z2, byte b) {
double d = (42 * 210) + 210;
}
private void checkProxyInfoInternal(boolean z, boolean z2, float f, short s, byte b) {
double d = (42 * 210) + 210;
}
private void checkReadTasks(float f, String str, boolean z, short s) {
double d = (42 * 210) + 210;
}
private void checkReadTasks(short s, boolean z, float f, String str) {
double d = (42 * 210) + 210;
}
private void checkReadTasks(short s, boolean z, String str, float f) {
double d = (42 * 210) + 210;
}
private void checkTosUpdate(byte b, int i, String str, short s) {
double d = (42 * 210) + 210;
}
private void checkTosUpdate(byte b, short s, String str, int i) {
double d = (42 * 210) + 210;
}
private void checkTosUpdate(String str, short s, byte b, int i) {
double d = (42 * 210) + 210;
}
private void completeReadTask(ReadTask readTask, char c, int i, short s, boolean z) {
double d = (42 * 210) + 210;
}
private void completeReadTask(ReadTask readTask, short s, char c, int i, boolean z) {
double d = (42 * 210) + 210;
}
private void completeReadTask(ReadTask readTask, boolean z, int i, char c, short s) {
double d = (42 * 210) + 210;
}
private void ensureFolderDialogExists(int i, boolean[] zArr, float f, int i2, char c, boolean z) {
double d = (42 * 210) + 210;
}
private void ensureFolderDialogExists(int i, boolean[] zArr, float f, boolean z, char c, int i2) {
double d = (42 * 210) + 210;
}
private void ensureFolderDialogExists(int i, boolean[] zArr, boolean z, float f, char c, int i2) {
double d = (42 * 210) + 210;
}
private void fetchFolderInLoadedPinnedDialogs(TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, float f, boolean z, byte b, int i) {
double d = (42 * 210) + 210;
}
private void fetchFolderInLoadedPinnedDialogs(TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, int i, boolean z, float f, byte b) {
double d = (42 * 210) + 210;
}
private void fetchFolderInLoadedPinnedDialogs(TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, boolean z, int i, float f, byte b) {
double d = (42 * 210) + 210;
}
private void getChannelDifference(int i, float f, int i2, char c, short s) {
double d = (42 * 210) + 210;
}
private void getChannelDifference(int i, float f, int i2, short s, char c) {
double d = (42 * 210) + 210;
}
private void getChannelDifference(int i, short s, float f, int i2, char c) {
double d = (42 * 210) + 210;
}
public static void getEmojiSettings(int i, float f, boolean z, short s, int i2) {
double d = (42 * 210) + 210;
}
public static void getEmojiSettings(int i, short s, int i2, float f, boolean z) {
double d = (42 * 210) + 210;
}
public static void getEmojiSettings(int i, short s, int i2, boolean z, float f) {
double d = (42 * 210) + 210;
}
public static void getGlobalEmojiSettings(char c, int i, String str, short s) {
double d = (42 * 210) + 210;
}
public static void getGlobalEmojiSettings(char c, int i, short s, String str) {
double d = (42 * 210) + 210;
}
public static void getGlobalEmojiSettings(short s, String str, char c, int i) {
double d = (42 * 210) + 210;
}
public static void getGlobalMainSettings(char c, int i, boolean z, byte b) {
double d = (42 * 210) + 210;
}
public static void getGlobalMainSettings(int i, byte b, char c, boolean z) {
double d = (42 * 210) + 210;
}
public static void getGlobalMainSettings(int i, boolean z, byte b, char c) {
double d = (42 * 210) + 210;
}
public static void getGlobalNotificationsSettings(float f, char c, String str, boolean z) {
double d = (42 * 210) + 210;
}
public static void getGlobalNotificationsSettings(float f, boolean z, String str, char c) {
double d = (42 * 210) + 210;
}
public static void getGlobalNotificationsSettings(boolean z, String str, float f, char c) {
double d = (42 * 210) + 210;
}
public static void getInputChannel(TLRPC.Chat chat, int i, String str, char c, short s) {
double d = (42 * 210) + 210;
}
public static void getInputChannel(TLRPC.Chat chat, int i, short s, char c, String str) {
double d = (42 * 210) + 210;
}
public static void getInputChannel(TLRPC.Chat chat, String str, char c, int i, short s) {
double d = (42 * 210) + 210;
}
public static void getInstance(int i, char c, boolean z, float f, String str) {
double d = (42 * 210) + 210;
}
public static void getInstance(int i, float f, boolean z, String str, char c) {
double d = (42 * 210) + 210;
}
public static void getInstance(int i, boolean z, float f, char c, String str) {
double d = (42 * 210) + 210;
}
public static void getMainSettings(int i, float f, boolean z, int i2, String str) {
double d = (42 * 210) + 210;
}
public static void getMainSettings(int i, int i2, float f, boolean z, String str) {
double d = (42 * 210) + 210;
}
public static void getMainSettings(int i, String str, boolean z, int i2, float f) {
double d = (42 * 210) + 210;
}
public static void getNotificationsSettings(int i, char c, int i2, boolean z, float f) {
double d = (42 * 210) + 210;
}
public static void getNotificationsSettings(int i, float f, boolean z, int i2, char c) {
double d = (42 * 210) + 210;
}
public static void getNotificationsSettings(int i, int i2, char c, boolean z, float f) {
double d = (42 * 210) + 210;
}
private void getPushDeviceType(char c, String str, float f, boolean z) {
double d = (42 * 210) + 210;
}
private void getPushDeviceType(char c, String str, boolean z, float f) {
double d = (42 * 210) + 210;
}
private void getPushDeviceType(boolean z, float f, String str, char c) {
double d = (42 * 210) + 210;
}
public static void getRestrictionReason(ArrayList arrayList, byte b, char c, short s, int i) {
double d = (42 * 210) + 210;
}
public static void getRestrictionReason(ArrayList arrayList, byte b, int i, char c, short s) {
double d = (42 * 210) + 210;
}
public static void getRestrictionReason(ArrayList arrayList, byte b, short s, int i, char c) {
double d = (42 * 210) + 210;
}
private static void getUpdateChannelId(TLRPC.Update update, String str, byte b, short s, boolean z) {
double d = (42 * 210) + 210;
}
private static void getUpdateChannelId(TLRPC.Update update, short s, byte b, boolean z, String str) {
double d = (42 * 210) + 210;
}
private static void getUpdateChannelId(TLRPC.Update update, boolean z, String str, short s, byte b) {
double d = (42 * 210) + 210;
}
private static void getUpdatePts(TLRPC.Update update, float f, int i, String str, short s) {
double d = (42 * 210) + 210;
}
private static void getUpdatePts(TLRPC.Update update, int i, short s, float f, String str) {
double d = (42 * 210) + 210;
}
private static void getUpdatePts(TLRPC.Update update, String str, int i, short s, float f) {
double d = (42 * 210) + 210;
}
private static void getUpdatePtsCount(TLRPC.Update update, char c, int i, short s, String str) {
double d = (42 * 210) + 210;
}
private static void getUpdatePtsCount(TLRPC.Update update, String str, int i, char c, short s) {
double d = (42 * 210) + 210;
}
private static void getUpdatePtsCount(TLRPC.Update update, short s, String str, char c, int i) {
double d = (42 * 210) + 210;
}
private static void getUpdateQts(TLRPC.Update update, float f, String str, short s, int i) {
double d = (42 * 210) + 210;
}
private static void getUpdateQts(TLRPC.Update update, int i, short s, String str, float f) {
double d = (42 * 210) + 210;
}
private static void getUpdateQts(TLRPC.Update update, short s, String str, int i, float f) {
double d = (42 * 210) + 210;
}
private void getUpdateSeq(TLRPC.Updates updates, float f, int i, String str, boolean z) {
double d = (42 * 210) + 210;
}
private void getUpdateSeq(TLRPC.Updates updates, int i, String str, float f, boolean z) {
double d = (42 * 210) + 210;
}
private void getUpdateSeq(TLRPC.Updates updates, boolean z, int i, String str, float f) {
double d = (42 * 210) + 210;
}
private void getUpdateType(TLRPC.Update update, int i, char c, String str, boolean z) {
double d = (42 * 210) + 210;
}
private void getUpdateType(TLRPC.Update update, String str, boolean z, int i, char c) {
double d = (42 * 210) + 210;
}
private void getUpdateType(TLRPC.Update update, boolean z, int i, String str, char c) {
double d = (42 * 210) + 210;
}
private void getUserNameForTyping(TLRPC.User user, byte b, char c, short s, boolean z) {
double d = (42 * 210) + 210;
}
private void getUserNameForTyping(TLRPC.User user, byte b, boolean z, char c, short s) {
double d = (42 * 210) + 210;
}
private void getUserNameForTyping(TLRPC.User user, boolean z, short s, char c, byte b) {
double d = (42 * 210) + 210;
}
public static void isSupportUser(TLRPC.User user, float f, byte b, short s, boolean z) {
double d = (42 * 210) + 210;
}
public static void isSupportUser(TLRPC.User user, float f, boolean z, short s, byte b) {
double d = (42 * 210) + 210;
}
public static void isSupportUser(TLRPC.User user, short s, float f, byte b, boolean z) {
double d = (42 * 210) + 210;
}
private void isValidUpdate(TLRPC.Updates updates, int i, char c, boolean z, int i2, short s) {
double d = (42 * 210) + 210;
}
private void isValidUpdate(TLRPC.Updates updates, int i, int i2, short s, boolean z, char c) {
double d = (42 * 210) + 210;
}
private void isValidUpdate(TLRPC.Updates updates, int i, boolean z, char c, int i2, short s) {
double d = (42 * 210) + 210;
}
public static void m1lambda$N7j1Rc052E3HIAQ5oadf29XcLk(MessagesController messagesController, char c, int i, float f, short s) {
double d = (42 * 210) + 210;
}
public static void m2lambda$N7j1Rc052E3HIAQ5oadf29XcLk(MessagesController messagesController, char c, int i, short s, float f) {
double d = (42 * 210) + 210;
}
public static void m3lambda$N7j1Rc052E3HIAQ5oadf29XcLk(MessagesController messagesController, short s, float f, char c, int i) {
double d = (42 * 210) + 210;
}
static void lambda$blockUser$49(TLObject tLObject, TLRPC.TL_error tL_error, int i, String str, char c, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$blockUser$49(TLObject tLObject, TLRPC.TL_error tL_error, String str, char c, int i, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$blockUser$49(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, int i, String str, char c) {
double d = (42 * 210) + 210;
}
static void lambda$completeReadTask$164(TLObject tLObject, TLRPC.TL_error tL_error, byte b, boolean z, short s, String str) {
double d = (42 * 210) + 210;
}
static void lambda$completeReadTask$164(TLObject tLObject, TLRPC.TL_error tL_error, String str, byte b, short s, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$completeReadTask$164(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, String str, short s, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$deleteUserPhoto$70(TLObject tLObject, TLRPC.TL_error tL_error, float f, boolean z, int i, short s) {
double d = (42 * 210) + 210;
}
static void lambda$deleteUserPhoto$70(TLObject tLObject, TLRPC.TL_error tL_error, int i, float f, short s, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$deleteUserPhoto$70(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, int i, float f, short s) {
double d = (42 * 210) + 210;
}
static void lambda$hidePeerSettingsBar$35(TLObject tLObject, TLRPC.TL_error tL_error, byte b, boolean z, float f, char c) {
double d = (42 * 210) + 210;
}
static void lambda$hidePeerSettingsBar$35(TLObject tLObject, TLRPC.TL_error tL_error, float f, boolean z, byte b, char c) {
double d = (42 * 210) + 210;
}
static void lambda$hidePeerSettingsBar$35(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, byte b, float f, char c) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$73(TLObject tLObject, TLRPC.TL_error tL_error, char c, String str, boolean z, float f) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$73(TLObject tLObject, TLRPC.TL_error tL_error, float f, char c, boolean z, String str) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$73(TLObject tLObject, TLRPC.TL_error tL_error, String str, boolean z, float f, char c) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$74(TLObject tLObject, TLRPC.TL_error tL_error, float f, char c, int i, String str) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$74(TLObject tLObject, TLRPC.TL_error tL_error, int i, float f, String str, char c) {
double d = (42 * 210) + 210;
}
static void lambda$installTheme$74(TLObject tLObject, TLRPC.TL_error tL_error, int i, String str, float f, char c) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionMessageAsRead$159(TLObject tLObject, TLRPC.TL_error tL_error, byte b, int i, short s, String str) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionMessageAsRead$159(TLObject tLObject, TLRPC.TL_error tL_error, String str, int i, short s, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionMessageAsRead$159(TLObject tLObject, TLRPC.TL_error tL_error, short s, byte b, String str, int i) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionsAsRead$166(TLObject tLObject, TLRPC.TL_error tL_error, byte b, boolean z, String str, short s) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionsAsRead$166(TLObject tLObject, TLRPC.TL_error tL_error, String str, byte b, short s, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$markMentionsAsRead$166(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, short s, byte b, String str) {
double d = (42 * 210) + 210;
}
static void lambda$markMessageContentAsRead$157(TLObject tLObject, TLRPC.TL_error tL_error, char c, int i, float f, short s) {
double d = (42 * 210) + 210;
}
static void lambda$markMessageContentAsRead$157(TLObject tLObject, TLRPC.TL_error tL_error, int i, char c, float f, short s) {
double d = (42 * 210) + 210;
}
static void lambda$markMessageContentAsRead$157(TLObject tLObject, TLRPC.TL_error tL_error, int i, char c, short s, float f) {
double d = (42 * 210) + 210;
}
static void lambda$null$183(Context context, AlertDialog alertDialog, char c, int i, String str, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$null$183(Context context, AlertDialog alertDialog, String str, boolean z, int i, char c) {
double d = (42 * 210) + 210;
}
static void lambda$null$183(Context context, AlertDialog alertDialog, boolean z, String str, char c, int i) {
double d = (42 * 210) + 210;
}
static void lambda$null$184(MessagesStorage.IntCallback intCallback, TLRPC.Updates updates, int i, String str, char c, short s) {
double d = (42 * 210) + 210;
}
static void lambda$null$184(MessagesStorage.IntCallback intCallback, TLRPC.Updates updates, short s, char c, int i, String str) {
double d = (42 * 210) + 210;
}
static void lambda$null$184(MessagesStorage.IntCallback intCallback, TLRPC.Updates updates, short s, String str, int i, char c) {
double d = (42 * 210) + 210;
}
static void lambda$performLogout$210(String str, int i, char c, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$performLogout$210(String str, boolean z, int i, char c) {
double d = (42 * 210) + 210;
}
static void lambda$performLogout$210(boolean z, String str, char c, int i) {
double d = (42 * 210) + 210;
}
static void lambda$processChannelsUpdatesQueue$216(TLRPC.Updates updates, TLRPC.Updates updates2, char c, String str, byte b, float f) {
double d = (42 * 210) + 210;
}
static void lambda$processChannelsUpdatesQueue$216(TLRPC.Updates updates, TLRPC.Updates updates2, char c, String str, float f, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$processChannelsUpdatesQueue$216(TLRPC.Updates updates, TLRPC.Updates updates2, float f, String str, byte b, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$273(TLRPC.Update update, byte b, float f, short s, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$273(TLRPC.Update update, byte b, short s, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$273(TLRPC.Update update, short s, byte b, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$274(TLRPC.Update update, byte b, int i, String str, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$274(TLRPC.Update update, byte b, String str, int i, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$274(TLRPC.Update update, String str, char c, byte b, int i) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$275(TLRPC.Update update, float f, short s, boolean z, int i) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$275(TLRPC.Update update, float f, boolean z, short s, int i) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$275(TLRPC.Update update, int i, short s, boolean z, float f) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$277(TLRPC.Update update, float f, String str, short s, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$277(TLRPC.Update update, String str, short s, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$277(TLRPC.Update update, short s, boolean z, String str, float f) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$278(TLRPC.Update update, char c, float f, short s, int i) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$278(TLRPC.Update update, float f, short s, int i, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdateArray$278(TLRPC.Update update, short s, char c, int i, float f) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdates$263(TLObject tLObject, TLRPC.TL_error tL_error, byte b, String str, boolean z, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdates$263(TLObject tLObject, TLRPC.TL_error tL_error, char c, String str, boolean z, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdates$263(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, char c, String str, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$218(TLRPC.Updates updates, TLRPC.Updates updates2, byte b, float f, char c, boolean z) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$218(TLRPC.Updates updates, TLRPC.Updates updates2, byte b, boolean z, float f, char c) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$218(TLRPC.Updates updates, TLRPC.Updates updates2, float f, char c, boolean z, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$219(TLRPC.Updates updates, TLRPC.Updates updates2, float f, String str, boolean z, short s) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$219(TLRPC.Updates updates, TLRPC.Updates updates2, String str, boolean z, short s, float f) {
double d = (42 * 210) + 210;
}
static void lambda$processUpdatesQueue$219(TLRPC.Updates updates, TLRPC.Updates updates2, boolean z, String str, short s, float f) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$36(TLObject tLObject, TLRPC.TL_error tL_error, byte b, String str, int i, short s) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$36(TLObject tLObject, TLRPC.TL_error tL_error, int i, String str, short s, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$36(TLObject tLObject, TLRPC.TL_error tL_error, short s, byte b, String str, int i) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$37(TLObject tLObject, TLRPC.TL_error tL_error, float f, byte b, char c, String str) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$37(TLObject tLObject, TLRPC.TL_error tL_error, float f, char c, byte b, String str) {
double d = (42 * 210) + 210;
}
static void lambda$reportSpam$37(TLObject tLObject, TLRPC.TL_error tL_error, float f, String str, char c, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$saveTheme$72(TLObject tLObject, TLRPC.TL_error tL_error, int i, short s, boolean z, byte b) {
double d = (42 * 210) + 210;
}
static void lambda$saveTheme$72(TLObject tLObject, TLRPC.TL_error tL_error, short s, byte b, boolean z, int i) {
double d = (42 * 210) + 210;
}
static void lambda$saveTheme$72(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, byte b, short s, int i) {
double d = (42 * 210) + 210;
}
static void lambda$unblockUser$65(TLObject tLObject, TLRPC.TL_error tL_error, String str, byte b, boolean z, float f) {
double d = (42 * 210) + 210;
}
static void lambda$unblockUser$65(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, byte b, String str, float f) {
double d = (42 * 210) + 210;
}
static void lambda$unblockUser$65(TLObject tLObject, TLRPC.TL_error tL_error, boolean z, float f, byte b, String str) {
double d = (42 * 210) + 210;
}
static void lambda$unregistedPush$207(TLObject tLObject, TLRPC.TL_error tL_error, char c, String str, float f, int i) {
double d = (42 * 210) + 210;
}
static void lambda$unregistedPush$207(TLObject tLObject, TLRPC.TL_error tL_error, float f, int i, char c, String str) {
double d = (42 * 210) + 210;
}
static void lambda$unregistedPush$207(TLObject tLObject, TLRPC.TL_error tL_error, float f, String str, char c, int i) {
double d = (42 * 210) + 210;
}
private void loadAppConfig(float f, int i, String str, short s) {
double d = (42 * 210) + 210;
}
private void loadAppConfig(float f, short s, String str, int i) {
double d = (42 * 210) + 210;
}
private void loadAppConfig(int i, float f, short s, String str) {
double d = (42 * 210) + 210;
}
private void loadMessagesInternal(long j, int i, int i2, int i3, boolean z, int i4, int i5, int i6, int i7, boolean z2, boolean z3, int i8, int i9, int i10, int i11, boolean z4, int i12, boolean z5, char c, int i13, short s, String str) {
double d = (42 * 210) + 210;
}
private void loadMessagesInternal(long j, int i, int i2, int i3, boolean z, int i4, int i5, int i6, int i7, boolean z2, boolean z3, int i8, int i9, int i10, int i11, boolean z4, int i12, boolean z5, int i13, char c, short s, String str) {
double d = (42 * 210) + 210;
}
private void loadMessagesInternal(long j, int i, int i2, int i3, boolean z, int i4, int i5, int i6, int i7, boolean z2, boolean z3, int i8, int i9, int i10, int i11, boolean z4, int i12, boolean z5, String str, short s, char c, int i13) {
double d = (42 * 210) + 210;
}
private void migrateDialogs(int i, int i2, int i3, int i4, int i5, long j, byte b, String str, short s, int i6) {
double d = (42 * 210) + 210;
}
private void migrateDialogs(int i, int i2, int i3, int i4, int i5, long j, short s, byte b, int i6, String str) {
double d = (42 * 210) + 210;
}
private void migrateDialogs(int i, int i2, int i3, int i4, int i5, long j, short s, int i6, byte b, String str) {
double d = (42 * 210) + 210;
}
public static void openChatOrProfileWith(TLRPC.User user, TLRPC.Chat chat, BaseFragment baseFragment, int i, boolean z, float f, short s, String str, boolean z2) {
double d = (42 * 210) + 210;
}
public static void openChatOrProfileWith(TLRPC.User user, TLRPC.Chat chat, BaseFragment baseFragment, int i, boolean z, float f, boolean z2, String str, short s) {
double d = (42 * 210) + 210;
}
public static void openChatOrProfileWith(TLRPC.User user, TLRPC.Chat chat, BaseFragment baseFragment, int i, boolean z, float f, boolean z2, short s, String str) {
double d = (42 * 210) + 210;
}
private void processChannelsUpdatesQueue(int i, int i2, char c, int i3, float f, short s) {
double d = (42 * 210) + 210;
}
private void processChannelsUpdatesQueue(int i, int i2, float f, char c, int i3, short s) {
double d = (42 * 210) + 210;
}
private void processChannelsUpdatesQueue(int i, int i2, float f, int i3, char c, short s) {
double d = (42 * 210) + 210;
}
private void processUpdatesQueue(int i, int i2, byte b, boolean z, float f, char c) {
double d = (42 * 210) + 210;
}
private void processUpdatesQueue(int i, int i2, char c, float f, byte b, boolean z) {
double d = (42 * 210) + 210;
}
private void processUpdatesQueue(int i, int i2, boolean z, float f, char c, byte b) {
double d = (42 * 210) + 210;
}
private void reloadDialogsReadValue(ArrayList arrayList, long j, char c, short s, int i, boolean z) {
double d = (42 * 210) + 210;
}
private void reloadDialogsReadValue(ArrayList arrayList, long j, int i, char c, boolean z, short s) {
double d = (42 * 210) + 210;
}
private void reloadDialogsReadValue(ArrayList arrayList, long j, int i, boolean z, char c, short s) {
double d = (42 * 210) + 210;
}
private void reloadMessages(ArrayList arrayList, long j, boolean z, byte b, char c, int i, float f) {
double d = (42 * 210) + 210;
}
private void reloadMessages(ArrayList arrayList, long j, boolean z, byte b, float f, int i, char c) {
double d = (42 * 210) + 210;
}
private void reloadMessages(ArrayList arrayList, long j, boolean z, float f, byte b, int i, char c) {
double d = (42 * 210) + 210;
}
private void removeDialog(TLRPC.Dialog dialog, byte b, char c, boolean z, float f) {
double d = (42 * 210) + 210;
}
private void removeDialog(TLRPC.Dialog dialog, float f, char c, byte b, boolean z) {
double d = (42 * 210) + 210;
}
private void removeDialog(TLRPC.Dialog dialog, boolean z, float f, char c, byte b) {
double d = (42 * 210) + 210;
}
private void removeFolder(int i, char c, int i2, String str, short s) {
double d = (42 * 210) + 210;
}
private void removeFolder(int i, int i2, short s, String str, char c) {
double d = (42 * 210) + 210;
}
private void removeFolder(int i, String str, char c, short s, int i2) {
double d = (42 * 210) + 210;
}
private void removeProxyDialog(float f, char c, int i, String str) {
double d = (42 * 210) + 210;
}
private void removeProxyDialog(float f, char c, String str, int i) {
double d = (42 * 210) + 210;
}
private void removeProxyDialog(float f, String str, char c, int i) {
double d = (42 * 210) + 210;
}
private void resetDialogs(boolean z, int i, int i2, int i3, int i4, char c, int i5, boolean z2, float f) {
double d = (42 * 210) + 210;
}
private void resetDialogs(boolean z, int i, int i2, int i3, int i4, float f, int i5, char c, boolean z2) {
double d = (42 * 210) + 210;
}
private void resetDialogs(boolean z, int i, int i2, int i3, int i4, boolean z2, float f, char c, int i5) {
double d = (42 * 210) + 210;
}
private void savePeerSettings(long j, TLRPC.TL_peerSettings tL_peerSettings, boolean z, byte b, char c, int i, String str) {
double d = (42 * 210) + 210;
}
private void savePeerSettings(long j, TLRPC.TL_peerSettings tL_peerSettings, boolean z, byte b, char c, String str, int i) {
double d = (42 * 210) + 210;
}
private void savePeerSettings(long j, TLRPC.TL_peerSettings tL_peerSettings, boolean z, int i, String str, byte b, char c) {
double d = (42 * 210) + 210;
}
private void setUpdatesStartTime(int i, long j, char c, boolean z, String str, float f) {
double d = (42 * 210) + 210;
}
private void setUpdatesStartTime(int i, long j, String str, char c, float f, boolean z) {
double d = (42 * 210) + 210;
}
private void setUpdatesStartTime(int i, long j, boolean z, char c, float f, String str) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert(BaseFragment baseFragment, String str, String str2, char c, boolean z, byte b) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert(BaseFragment baseFragment, String str, boolean z, byte b, String str2, char c) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert(BaseFragment baseFragment, String str, boolean z, char c, String str2, byte b) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert2(BaseFragment baseFragment, String str, float f, int i, char c, String str2) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert2(BaseFragment baseFragment, String str, float f, String str2, int i, char c) {
double d = (42 * 210) + 210;
}
public static void showCantOpenAlert2(BaseFragment baseFragment, String str, int i, String str2, char c, float f) {
double d = (42 * 210) + 210;
}
private void updatePrintingStrings(String str, short s, boolean z, float f) {
double d = (42 * 210) + 210;
}
private void updatePrintingStrings(String str, boolean z, short s, float f) {
double d = (42 * 210) + 210;
}
private void updatePrintingStrings(short s, String str, float f, boolean z) {
double d = (42 * 210) + 210;
}
private void updatePrintingUsersWithNewMessages(long j, ArrayList arrayList, byte b, float f, int i, String str) {
double d = (42 * 210) + 210;
}
private void updatePrintingUsersWithNewMessages(long j, ArrayList arrayList, int i, byte b, String str, float f) {
double d = (42 * 210) + 210;
}
private void updatePrintingUsersWithNewMessages(long j, ArrayList arrayList, String str, float f, int i, byte b) {
double d = (42 * 210) + 210;
}
public void lambda$new$0$MessagesController() {
getUserConfig().checkSavedPassword();
}
private static class UserActionUpdatesSeq extends TLRPC.Updates {
private UserActionUpdatesSeq() {
}
}
private static class UserActionUpdatesPts extends TLRPC.Updates {
private UserActionUpdatesPts() {
}
}
private class ReadTask {
public long dialogId;
public int maxDate;
public int maxId;
public long sendRequestTime;
private ReadTask() {
}
}
public int lambda$new$1$MessagesController(TLRPC.Dialog dialog1, TLRPC.Dialog dialog2) {
if ((25 + 5) % 5 <= 0) {
}
if ((dialog1 instanceof TLRPC.TL_dialogFolder) && !(dialog2 instanceof TLRPC.TL_dialogFolder)) {
return -1;
}
if (!(dialog1 instanceof TLRPC.TL_dialogFolder) && (dialog2 instanceof TLRPC.TL_dialogFolder)) {
return 1;
}
if (!dialog1.pinned && dialog2.pinned) {
return 1;
}
if (dialog1.pinned && !dialog2.pinned) {
return -1;
}
if (dialog1.pinned && dialog2.pinned) {
if (dialog1.pinnedNum < dialog2.pinnedNum) {
return 1;
}
return dialog1.pinnedNum > dialog2.pinnedNum ? -1 : 0;
}
TLRPC.DraftMessage draftMessage = getMediaDataController().getDraft(dialog1.id);
int date1 = (draftMessage == null || draftMessage.date < dialog1.last_message_date) ? dialog1.last_message_date : draftMessage.date;
TLRPC.DraftMessage draftMessage2 = getMediaDataController().getDraft(dialog2.id);
int date2 = (draftMessage2 == null || draftMessage2.date < dialog2.last_message_date) ? dialog2.last_message_date : draftMessage2.date;
if (date1 < date2) {
return 1;
}
return date1 > date2 ? -1 : 0;
}
public int lambda$new$2$MessagesController(TLRPC.Update lhs, TLRPC.Update rhs) {
if ((5 + 18) % 18 <= 0) {
}
int ltype = getUpdateType(lhs);
int rtype = getUpdateType(rhs);
if (ltype != rtype) {
return AndroidUtilities.compare(ltype, rtype);
}
if (ltype == 0) {
return AndroidUtilities.compare(getUpdatePts(lhs), getUpdatePts(rhs));
}
if (ltype == 1) {
return AndroidUtilities.compare(getUpdateQts(lhs), getUpdateQts(rhs));
}
if (ltype == 2) {
int lChannel = getUpdateChannelId(lhs);
int rChannel = getUpdateChannelId(rhs);
if (lChannel == rChannel) {
return AndroidUtilities.compare(getUpdatePts(lhs), getUpdatePts(rhs));
}
return AndroidUtilities.compare(lChannel, rChannel);
}
return 0;
}
public static MessagesController getInstance(int num) {
if ((25 + 6) % 6 <= 0) {
}
MessagesController localInstance = Instance[num];
if (localInstance == null) {
synchronized (MessagesController.class) {
localInstance = Instance[num];
if (localInstance == null) {
MessagesController[] messagesControllerArr = Instance;
MessagesController messagesController = new MessagesController(num);
localInstance = messagesController;
messagesControllerArr[num] = messagesController;
}
}
}
return localInstance;
}
public static SharedPreferences getNotificationsSettings(int account) {
return getInstance(account).notificationsPreferences;
}
public static SharedPreferences getGlobalNotificationsSettings() {
return getInstance(0).notificationsPreferences;
}
public static SharedPreferences getMainSettings(int account) {
return getInstance(account).mainPreferences;
}
public static SharedPreferences getGlobalMainSettings() {
return getInstance(0).mainPreferences;
}
public static SharedPreferences getEmojiSettings(int account) {
return getInstance(account).emojiPreferences;
}
public static SharedPreferences getGlobalEmojiSettings() {
return getInstance(0).emojiPreferences;
}
public MessagesController(int num) {
super(num);
if ((16 + 21) % 21 <= 0) {
}
this.chats = new ConcurrentHashMap<>(100, 1.0f, 2);
this.encryptedChats = new ConcurrentHashMap<>(10, 1.0f, 2);
this.users = new ConcurrentHashMap<>(100, 1.0f, 2);
this.objectsByUsernames = new ConcurrentHashMap<>(100, 1.0f, 2);
this.joiningToChannels = new ArrayList<>();
this.exportedChats = new SparseArray<>();
this.hintDialogs = new ArrayList<>();
this.dialogsByFolder = new SparseArray<>();
this.allDialogs = new ArrayList<>();
this.dialogsForward = new ArrayList<>();
this.dialogsServerOnly = new ArrayList<>();
this.dialogsCanAddUsers = new ArrayList<>();
this.dialogsChannelsOnly = new ArrayList<>();
this.dialogsUsersOnly = new ArrayList<>();
this.dialogsGroupsOnly = new ArrayList<>();
this.dialogsUnreadOnly = new ArrayList<>();
this.dialogs_read_inbox_max = new ConcurrentHashMap<>(100, 1.0f, 2);
this.dialogs_read_outbox_max = new ConcurrentHashMap<>(100, 1.0f, 2);
this.dialogs_dict = new LongSparseArray<>();
this.dialogMessage = new LongSparseArray<>();
this.dialogMessagesByRandomIds = new LongSparseArray<>();
this.deletedHistory = new LongSparseArray<>();
this.dialogMessagesByIds = new SparseArray<>();
this.printingUsers = new ConcurrentHashMap<>(20, 1.0f, 2);
this.printingStrings = new LongSparseArray<>();
this.printingStringsTypes = new LongSparseArray<>();
this.sendingTypings = new SparseArray<>();
this.onlinePrivacy = new ConcurrentHashMap<>(20, 1.0f, 2);
this.loadingPeerSettings = new LongSparseArray<>();
this.createdDialogIds = new ArrayList<>();
this.createdScheduledDialogIds = new ArrayList<>();
this.createdDialogMainThreadIds = new ArrayList<>();
this.visibleDialogMainThreadIds = new ArrayList<>();
this.visibleScheduledDialogMainThreadIds = new ArrayList<>();
this.shortPollChannels = new SparseIntArray();
this.needShortPollChannels = new SparseIntArray();
this.shortPollOnlines = new SparseIntArray();
this.needShortPollOnlines = new SparseIntArray();
this.deletingDialogs = new LongSparseArray<>();
this.clearingHistoryDialogs = new LongSparseArray<>();
this.loadingBlockedUsers = false;
this.blockedUsers = new SparseIntArray();
this.totalBlockedCount = -1;
this.channelViewsToSend = new SparseArray<>();
this.pollsToCheck = new LongSparseArray<>();
this.updatesQueueChannels = new SparseArray<>();
this.updatesStartWaitTimeChannels = new SparseLongArray();
this.channelsPts = new SparseIntArray();
this.gettingDifferenceChannels = new SparseBooleanArray();
this.gettingUnknownChannels = new SparseBooleanArray();
this.gettingUnknownDialogs = new LongSparseArray<>();
this.checkingLastMessagesDialogs = new SparseBooleanArray();
this.updatesQueueSeq = new ArrayList<>();
this.updatesQueuePts = new ArrayList<>();
this.updatesQueueQts = new ArrayList<>();
this.fullUsers = new SparseArray<>();
this.fullChats = new SparseArray<>();
this.loadingFullUsers = new ArrayList<>();
this.loadedFullUsers = new ArrayList<>();
this.loadingFullChats = new ArrayList<>();
this.loadingFullParticipants = new ArrayList<>();
this.loadedFullParticipants = new ArrayList<>();
this.loadedFullChats = new ArrayList<>();
this.channelAdmins = new SparseArray<>();
this.loadingChannelAdmins = new SparseIntArray();
this.migratedChats = new SparseIntArray();
this.reloadingWebpages = new HashMap<>();
this.reloadingWebpagesPending = new LongSparseArray<>();
this.reloadingScheduledWebpages = new HashMap<>();
this.reloadingScheduledWebpagesPending = new LongSparseArray<>();
this.lastScheduledServerQueryTime = new LongSparseArray<>();
this.reloadingMessages = new LongSparseArray<>();
this.readTasks = new ArrayList<>();
this.readTasksMap = new LongSparseArray<>();
this.nextDialogsCacheOffset = new SparseIntArray();
this.loadingDialogs = new SparseBooleanArray();
this.dialogsEndReached = new SparseBooleanArray();
this.serverDialogsEndReached = new SparseBooleanArray();
this.getDifferenceFirstSync = true;
this.loadingPinnedDialogs = new SparseIntArray();
this.suggestContacts = true;
this.themeCheckRunnable = new Runnable() {
@Override
public final void run() {
Theme.checkAutoNightThemeConditions();
}
};
this.passwordCheckRunnable = new -$.Lambda.MessagesController.V9I0wHPiFbjF-hTuzbV9aavIjWo(this);
this.uploadingThemes = new HashMap<>();
this.maxBroadcastCount = 100;
this.minGroupConvertSize = 200;
this.dialogComparator = new -$.Lambda.MessagesController.t8GLiipTIbWaBI8OkMz5ZVh-3cU(this);
this.updatesComparator = new -$.Lambda.MessagesController.cI4BRBE9Tw2vee3Zc0beCEEsHFo(this);
this.DIALOGS_LOAD_TYPE_CACHE = 1;
this.DIALOGS_LOAD_TYPE_CHANNEL = 2;
this.DIALOGS_LOAD_TYPE_UNKNOWN = 3;
this.contactsGetDiff = false;
this.currentAccount = num;
ImageLoader.getInstance();
getMessagesStorage();
getLocationController();
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$new$3$MessagesController();
}
});
addSupportUser();
if (this.currentAccount == 0) {
this.notificationsPreferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", 0);
this.mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0);
this.emojiPreferences = ApplicationLoader.applicationContext.getSharedPreferences("emoji", 0);
} else {
this.notificationsPreferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications" + this.currentAccount, 0);
this.mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig" + this.currentAccount, 0);
this.emojiPreferences = ApplicationLoader.applicationContext.getSharedPreferences("emoji" + this.currentAccount, 0);
}
this.enableJoined = this.notificationsPreferences.getBoolean("EnableContactJoined", true);
this.secretWebpagePreview = this.mainPreferences.getInt("secretWebpage2", 2);
this.maxGroupCount = this.mainPreferences.getInt("maxGroupCount", 200);
this.maxMegagroupCount = this.mainPreferences.getInt("maxMegagroupCount", 10000);
this.maxRecentGifsCount = this.mainPreferences.getInt("maxRecentGifsCount", 200);
this.maxRecentStickersCount = this.mainPreferences.getInt("maxRecentStickersCount", 30);
this.maxFaveStickersCount = this.mainPreferences.getInt("maxFaveStickersCount", 5);
this.maxEditTime = this.mainPreferences.getInt("maxEditTime", 3600);
this.ratingDecay = this.mainPreferences.getInt("ratingDecay", 2419200);
this.linkPrefix = "m12345.cc";
String defaultValue = BuildVars.RELEASE_VERSION ? "https://m12345.cc/install.html?appkey=aa717156fa6e34325d3d4a7004a6647a" : "http://www.shareinstall.com.cn/js-test.html?appkey=aa717156fa6e34325d3d4a7004a6647a";
this.sharePrefix = this.mainPreferences.getString("sharePrefix", defaultValue);
this.callReceiveTimeout = this.mainPreferences.getInt("callReceiveTimeout", 20000);
this.callRingTimeout = this.mainPreferences.getInt("callRingTimeout", 90000);
this.callConnectTimeout = this.mainPreferences.getInt("callConnectTimeout", 30000);
this.callPacketTimeout = this.mainPreferences.getInt("callPacketTimeout", 10000);
this.maxPinnedDialogsCount = this.mainPreferences.getInt("maxPinnedDialogsCount", 5);
this.maxFolderPinnedDialogsCount = this.mainPreferences.getInt("maxFolderPinnedDialogsCount", 100);
this.maxMessageLength = this.mainPreferences.getInt("maxMessageLength", UPDATE_MASK_SEND_STATE);
this.maxCaptionLength = this.mainPreferences.getInt("maxCaptionLength", UPDATE_MASK_PHONE);
this.mapProvider = this.mainPreferences.getInt("mapProvider", 0);
this.availableMapProviders = this.mainPreferences.getInt("availableMapProviders", 3);
this.mapKey = this.mainPreferences.getString("pk", null);
this.installReferer = this.mainPreferences.getString("installReferer", null);
this.defaultP2pContacts = this.mainPreferences.getBoolean("defaultP2pContacts", false);
this.revokeTimeLimit = this.mainPreferences.getInt("revokeTimeLimit", this.revokeTimeLimit);
this.revokeTimePmLimit = this.mainPreferences.getInt("revokeTimePmLimit", this.revokeTimePmLimit);
this.canRevokePmInbox = this.mainPreferences.getBoolean("canRevokePmInbox", this.canRevokePmInbox);
this.preloadFeaturedStickers = this.mainPreferences.getBoolean("preloadFeaturedStickers", false);
this.proxyDialogId = this.mainPreferences.getLong("proxy_dialog", 0L);
this.proxyDialogAddress = this.mainPreferences.getString("proxyDialogAddress", null);
this.nextTosCheckTime = this.notificationsPreferences.getInt("nextTosCheckTime", 0);
this.venueSearchBot = this.mainPreferences.getString("venueSearchBot", "foursquare");
this.gifSearchBot = this.mainPreferences.getString("gifSearchBot", "gif");
this.imageSearchBot = this.mainPreferences.getString("imageSearchBot", "pic");
this.blockedCountry = this.mainPreferences.getBoolean("blockedCountry", false);
this.dcDomainName = this.mainPreferences.getString("dcDomainName2", ConnectionsManager.native_isTestBackend(this.currentAccount) != 0 ? "tapv3.stel.com" : "apv3.stel.com");
this.webFileDatacenterId = this.mainPreferences.getInt("webFileDatacenterId", ConnectionsManager.native_isTestBackend(this.currentAccount) == 0 ? 4 : 2);
this.suggestedLangCode = this.mainPreferences.getString("suggestedLangCode", "en");
this.animatedEmojisZoom = this.mainPreferences.getFloat("animatedEmojisZoom", 0.625f);
this.enableHub = this.mainPreferences.getBoolean("enable_hub", false);
this.enableWallet = this.mainPreferences.getBoolean("enable_wallet", false);
this.enableDigitCoin = this.mainPreferences.getBoolean("enable_digit_coin", false);
}
public void lambda$new$3$MessagesController() {
if ((6 + 3) % 3 <= 0) {
}
MessagesController messagesController = getMessagesController();
getNotificationCenter().addObserver(messagesController, NotificationCenter.FileDidUpload);
getNotificationCenter().addObserver(messagesController, NotificationCenter.FileDidFailUpload);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileDidLoad);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileDidFailToLoad);
getNotificationCenter().addObserver(messagesController, NotificationCenter.messageReceivedByServer);
getNotificationCenter().addObserver(messagesController, NotificationCenter.updateMessageMedia);
}
private void loadAppConfig() {
if ((13 + 9) % 9 <= 0) {
}
if (this.loadingAppConfig) {
return;
}
this.loadingAppConfig = true;
TLRPC.TL_help_getAppConfig req = new TLRPC.TL_help_getAppConfig();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$loadAppConfig$5$MessagesController(tLObject, tL_error);
}
});
}
public void lambda$loadAppConfig$5$MessagesController(final TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((21 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$null$4$MessagesController(response);
}
});
}
public void lambda$null$4$MessagesController(TLObject response) {
if ((21 + 8) % 8 <= 0) {
}
if (response instanceof TLRPC.TL_jsonObject) {
SharedPreferences.Editor editor = this.mainPreferences.edit();
boolean changed = false;
TLRPC.TL_jsonObject object = (TLRPC.TL_jsonObject) response;
int N = object.value.size();
for (int a = 0; a < N; a++) {
TLRPC.TL_jsonObjectValue value = (TLRPC.TL_jsonObjectValue) object.value.get(a);
if ("emojies_animated_zoom".equals(value.key) && (value.value instanceof TLRPC.TL_jsonNumber)) {
TLRPC.TL_jsonNumber number = value.value;
if (this.animatedEmojisZoom != number.value) {
float f = (float) number.value;
this.animatedEmojisZoom = f;
editor.putFloat("animatedEmojisZoom", f);
changed = true;
}
}
}
if (changed) {
editor.commit();
}
}
this.loadingAppConfig = false;
}
public void updateConfig(final TLRPC.TL_config config) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((6 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$updateConfig$6$MessagesController(config);
}
});
}
public void lambda$updateConfig$6$MessagesController(TLRPC.TL_config config) {
String str;
if ((5 + 3) % 3 <= 0) {
}
getDownloadController().loadAutoDownloadConfig(false);
loadAppConfig();
this.maxMegagroupCount = config.megagroup_size_max;
this.maxGroupCount = config.chat_size_max;
this.maxEditTime = config.edit_time_limit;
this.ratingDecay = config.rating_e_decay;
this.maxRecentGifsCount = config.saved_gifs_limit;
this.maxRecentStickersCount = config.stickers_recent_limit;
this.maxFaveStickersCount = config.stickers_faved_limit;
this.revokeTimeLimit = config.revoke_time_limit;
this.revokeTimePmLimit = config.revoke_pm_time_limit;
this.canRevokePmInbox = config.revoke_pm_inbox;
this.linkPrefix = "m12345.cc";
if ("m12345.cc".endsWith("/")) {
String str2 = this.linkPrefix;
this.linkPrefix = str2.substring(0, str2.length() - 1);
}
if (this.linkPrefix.startsWith("https://")) {
this.linkPrefix = this.linkPrefix.substring(8);
} else if (this.linkPrefix.startsWith("http://")) {
this.linkPrefix = this.linkPrefix.substring(7);
}
this.linkPrefix = "m12345.cc";
this.sharePrefix = config.me_url_prefix;
this.callReceiveTimeout = config.call_receive_timeout_ms;
this.callRingTimeout = config.call_ring_timeout_ms;
this.callConnectTimeout = config.call_connect_timeout_ms;
this.callPacketTimeout = config.call_packet_timeout_ms;
this.maxPinnedDialogsCount = config.pinned_dialogs_count_max;
this.maxFolderPinnedDialogsCount = config.pinned_infolder_count_max;
this.maxMessageLength = config.message_length_max;
this.maxCaptionLength = config.caption_length_max;
this.defaultP2pContacts = config.default_p2p_contacts;
this.preloadFeaturedStickers = config.preload_featured_stickers;
this.enableHub = ((config.flags >> 19) & 1) != 0;
this.enableWallet = ((config.flags >> 20) & 1) != 0;
this.enableDigitCoin = ((config.flags >> 21) & 1) != 0;
if (config.venue_search_username != null) {
this.venueSearchBot = config.venue_search_username;
}
if (config.gif_search_username != null) {
this.gifSearchBot = config.gif_search_username;
}
if (this.imageSearchBot != null) {
this.imageSearchBot = config.img_search_username;
}
this.blockedCountry = config.blocked_mode;
this.dcDomainName = config.dc_txt_domain_name;
this.webFileDatacenterId = config.webfile_dc_id;
if (config.suggested_lang_code != null && ((str = this.suggestedLangCode) == null || !str.equals(config.suggested_lang_code))) {
this.suggestedLangCode = config.suggested_lang_code;
LocaleController.getInstance().loadRemoteLanguages(this.currentAccount);
}
Theme.loadRemoteThemes(this.currentAccount, false);
Theme.checkCurrentRemoteTheme(false);
if (config.static_maps_provider == null) {
config.static_maps_provider = "google";
}
this.mapKey = null;
this.mapProvider = 2;
this.availableMapProviders = 0;
String[] providers = config.static_maps_provider.split(",");
for (int a = 0; a < providers.length; a++) {
String[] mapArgs = providers[a].split("\\+");
if (mapArgs.length > 0) {
String[] typeAndKey = mapArgs[0].split(":");
if (typeAndKey.length > 0) {
if ("yandex".equals(typeAndKey[0])) {
if (a == 0) {
if (mapArgs.length > 1) {
this.mapProvider = 3;
} else {
this.mapProvider = 1;
}
}
this.availableMapProviders |= 4;
} else if ("google".equals(typeAndKey[0])) {
if (a == 0 && mapArgs.length > 1) {
this.mapProvider = 4;
}
this.availableMapProviders |= 1;
} else if ("hchat".equals(typeAndKey[0])) {
if (a == 0) {
this.mapProvider = 2;
}
this.availableMapProviders |= 2;
}
if (typeAndKey.length > 1) {
this.mapKey = typeAndKey[1];
}
}
}
}
SharedPreferences.Editor editor = this.mainPreferences.edit();
editor.putInt("maxGroupCount", this.maxGroupCount);
editor.putInt("maxMegagroupCount", this.maxMegagroupCount);
editor.putInt("maxEditTime", this.maxEditTime);
editor.putInt("ratingDecay", this.ratingDecay);
editor.putInt("maxRecentGifsCount", this.maxRecentGifsCount);
editor.putInt("maxRecentStickersCount", this.maxRecentStickersCount);
editor.putInt("maxFaveStickersCount", this.maxFaveStickersCount);
editor.putInt("callReceiveTimeout", this.callReceiveTimeout);
editor.putInt("callRingTimeout", this.callRingTimeout);
editor.putInt("callConnectTimeout", this.callConnectTimeout);
editor.putInt("callPacketTimeout", this.callPacketTimeout);
editor.putString("linkPrefix", this.linkPrefix);
editor.putString("sharePrefix", this.sharePrefix);
editor.putInt("maxPinnedDialogsCount", this.maxPinnedDialogsCount);
editor.putInt("maxFolderPinnedDialogsCount", this.maxFolderPinnedDialogsCount);
editor.putInt("maxMessageLength", this.maxMessageLength);
editor.putInt("maxCaptionLength", this.maxCaptionLength);
editor.putBoolean("defaultP2pContacts", this.defaultP2pContacts);
editor.putBoolean("preloadFeaturedStickers", this.preloadFeaturedStickers);
editor.putInt("revokeTimeLimit", this.revokeTimeLimit);
editor.putInt("revokeTimePmLimit", this.revokeTimePmLimit);
editor.putInt("mapProvider", this.mapProvider);
String str3 = this.mapKey;
if (str3 != null) {
editor.putString("pk", str3);
} else {
editor.remove("pk");
}
editor.putBoolean("canRevokePmInbox", this.canRevokePmInbox);
editor.putBoolean("blockedCountry", this.blockedCountry);
editor.putString("venueSearchBot", this.venueSearchBot);
editor.putString("gifSearchBot", this.gifSearchBot);
editor.putString("imageSearchBot", this.imageSearchBot);
editor.putString("dcDomainName2", this.dcDomainName);
editor.putInt("webFileDatacenterId", this.webFileDatacenterId);
editor.putString("suggestedLangCode", this.suggestedLangCode);
editor.putBoolean("enable_hub", this.enableHub);
editor.putBoolean("enable_wallet", this.enableWallet);
editor.putBoolean("enable_digit_coin", this.enableDigitCoin);
editor.commit();
LocaleController.getInstance().checkUpdateForCurrentRemoteLocale(this.currentAccount, config.lang_pack_version, config.base_lang_pack_version);
getNotificationCenter().postNotificationName(NotificationCenter.configLoaded, new Object[0]);
}
public void addSupportUser() {
if ((11 + 29) % 29 <= 0) {
}
TLRPC.TL_userForeign_old2 user = new TLRPC.TL_userForeign_old2();
user.phone = "333";
user.id = 333000;
user.first_name = "Tjin";
user.last_name = "";
user.status = null;
user.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(user, true);
TLRPC.TL_userForeign_old2 user2 = new TLRPC.TL_userForeign_old2();
user2.phone = "42777";
user2.id = 777000;
user2.verified = true;
user2.first_name = "Tjin";
user2.last_name = "Notifications";
user2.status = null;
user2.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(user2, true);
}
public TLRPC.InputUser getInputUser(TLRPC.User user) {
if ((11 + 27) % 27 <= 0) {
}
if (user == null) {
return new TLRPC.TL_inputUserEmpty();
}
if (user.id == getUserConfig().getClientUserId()) {
return new TLRPC.TL_inputUserSelf();
}
TLRPC.TL_inputUser tL_inputUser = new TLRPC.TL_inputUser();
((TLRPC.InputUser) tL_inputUser).user_id = user.id;
((TLRPC.InputUser) tL_inputUser).access_hash = user.access_hash;
return tL_inputUser;
}
public TLRPC.InputUser getInputUser(int user_id) {
if ((23 + 15) % 15 <= 0) {
}
TLRPC.User user = getInstance(UserConfig.selectedAccount).getUser(Integer.valueOf(user_id));
return getInputUser(user);
}
public static TLRPC.InputChannel getInputChannel(TLRPC.Chat chat) {
if ((12 + 17) % 17 <= 0) {
}
if ((chat instanceof TLRPC.TL_channel) || (chat instanceof TLRPC.TL_channelForbidden)) {
TLRPC.TL_inputChannel tL_inputChannel = new TLRPC.TL_inputChannel();
((TLRPC.InputChannel) tL_inputChannel).channel_id = chat.id;
((TLRPC.InputChannel) tL_inputChannel).access_hash = chat.access_hash;
return tL_inputChannel;
}
return new TLRPC.TL_inputChannelEmpty();
}
public TLRPC.InputChannel getInputChannel(int chatId) {
return getInputChannel(getChat(Integer.valueOf(chatId)));
}
public TLRPC.InputPeer getInputPeer(int id) {
if ((23 + 12) % 12 <= 0) {
}
if (id < 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-id));
if (ChatObject.isChannel(chat)) {
TLRPC.TL_inputPeerChannel tL_inputPeerChannel = new TLRPC.TL_inputPeerChannel();
((TLRPC.InputPeer) tL_inputPeerChannel).channel_id = -id;
((TLRPC.InputPeer) tL_inputPeerChannel).access_hash = chat.access_hash;
return tL_inputPeerChannel;
}
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = -id;
return tL_inputPeerChat;
}
TLRPC.User user = getUser(Integer.valueOf(id));
TLRPC.TL_inputPeerUser tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
((TLRPC.InputPeer) tL_inputPeerUser).user_id = id;
if (user != null) {
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = user.access_hash;
return tL_inputPeerUser;
}
return tL_inputPeerUser;
}
public TLRPC.Peer getPeer(int id) {
if ((31 + 8) % 8 <= 0) {
}
if (id < 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-id));
if ((chat instanceof TLRPC.TL_channel) || (chat instanceof TLRPC.TL_channelForbidden)) {
TLRPC.TL_peerChannel tL_peerChannel = new TLRPC.TL_peerChannel();
((TLRPC.Peer) tL_peerChannel).channel_id = -id;
return tL_peerChannel;
}
TLRPC.TL_peerChat tL_peerChat = new TLRPC.TL_peerChat();
((TLRPC.Peer) tL_peerChat).chat_id = -id;
return tL_peerChat;
}
getUser(Integer.valueOf(id));
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Peer) tL_peerUser).user_id = id;
return tL_peerUser;
}
public void didReceivedNotification(int id, int account, Object... args) {
if ((30 + 22) % 22 <= 0) {
}
if (id == NotificationCenter.FileDidUpload) {
String location = (String) args[0];
TLRPC.InputFile file = (TLRPC.InputFile) args[1];
String str = this.uploadingAvatar;
if (str != null && str.equals(location)) {
TLRPC.TL_photos_uploadProfilePhoto req = new TLRPC.TL_photos_uploadProfilePhoto();
req.file = file;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$didReceivedNotification$8$MessagesController(tLObject, tL_error);
}
});
return;
}
String str2 = this.uploadingWallpaper;
if (str2 != null && str2.equals(location)) {
TLRPC.TL_account_uploadWallPaper req2 = new TLRPC.TL_account_uploadWallPaper();
req2.file = file;
req2.mime_type = "image/jpeg";
final TLRPC.TL_wallPaperSettings settings = new TLRPC.TL_wallPaperSettings();
settings.blur = this.uploadingWallpaperBlurred;
settings.motion = this.uploadingWallpaperMotion;
req2.settings = settings;
getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((21 + 23) % 23 <= 0) {
}
MessagesController.this.lambda$didReceivedNotification$10$MessagesController(settings, tLObject, tL_error);
}
});
return;
}
Theme.ThemeInfo themeInfo = this.uploadingThemes.get(location);
if (themeInfo != null) {
if (location.equals(themeInfo.uploadingThumb)) {
themeInfo.uploadedThumb = file;
themeInfo.uploadingThumb = null;
} else if (location.equals(themeInfo.uploadingFile)) {
themeInfo.uploadedFile = file;
themeInfo.uploadingFile = null;
}
if (themeInfo.uploadedFile != null && themeInfo.uploadedThumb != null) {
new File(location);
TLRPC.TL_account_uploadTheme req3 = new TLRPC.TL_account_uploadTheme();
req3.mime_type = "application/x-tgtheme-android";
req3.file_name = "theme.attheme";
req3.file = themeInfo.uploadedFile;
req3.file.name = "theme.attheme";
req3.thumb = themeInfo.uploadedThumb;
req3.thumb.name = "theme-preview.jpg";
req3.flags = 1 | req3.flags;
themeInfo.uploadedFile = null;
themeInfo.uploadedThumb = null;
getConnectionsManager().sendRequest(req3, new -$.Lambda.MessagesController.HfCXJyMfl5fnXq291cF84-OOLUk(this, themeInfo));
}
this.uploadingThemes.remove(location);
return;
}
return;
}
if (id == NotificationCenter.FileDidFailUpload) {
String location2 = (String) args[0];
String str3 = this.uploadingAvatar;
if (str3 != null && str3.equals(location2)) {
this.uploadingAvatar = null;
return;
}
String str4 = this.uploadingWallpaper;
if (str4 != null && str4.equals(location2)) {
this.uploadingWallpaper = null;
return;
}
Theme.ThemeInfo themeInfo2 = this.uploadingThemes.remove(location2);
if (themeInfo2 != null) {
themeInfo2.uploadedFile = null;
themeInfo2.uploadedThumb = null;
return;
}
return;
}
if (id == NotificationCenter.messageReceivedByServer) {
Boolean scheduled = (Boolean) args[6];
if (scheduled.booleanValue()) {
return;
}
Integer msgId = (Integer) args[0];
Integer newMsgId = (Integer) args[1];
Long did = (Long) args[3];
MessageObject obj = this.dialogMessage.get(did.longValue());
if (obj != null && (obj.getId() == msgId.intValue() || obj.messageOwner.local_id == msgId.intValue())) {
obj.messageOwner.id = newMsgId.intValue();
obj.messageOwner.send_state = 0;
}
TLRPC.Dialog dialog = this.dialogs_dict.get(did.longValue());
if (dialog != null && dialog.top_message == msgId.intValue()) {
dialog.top_message = newMsgId.intValue();
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
MessageObject obj2 = this.dialogMessagesByIds.get(msgId.intValue());
this.dialogMessagesByIds.remove(msgId.intValue());
if (obj2 != null) {
this.dialogMessagesByIds.put(newMsgId.intValue(), obj2);
}
int lowerId = (int) did.longValue();
if (lowerId < 0) {
TLRPC.ChatFull chatFull = this.fullChats.get(-lowerId);
TLRPC.Chat chat = getChat(Integer.valueOf(-lowerId));
if (chat != null && !ChatObject.hasAdminRights(chat) && chatFull != null && chatFull.slowmode_seconds != 0) {
chatFull.slowmode_next_send_date = ConnectionsManager.getInstance(this.currentAccount).getCurrentTime() + chatFull.slowmode_seconds;
chatFull.flags |= 262144;
getMessagesStorage().updateChatInfo(chatFull, false);
return;
}
return;
}
return;
}
if (id == NotificationCenter.updateMessageMedia) {
TLRPC.Message message = (TLRPC.Message) args[0];
MessageObject existMessageObject = this.dialogMessagesByIds.get(message.id);
if (existMessageObject != null) {
existMessageObject.messageOwner.media = message.media;
if (message.media.ttl_seconds != 0) {
if ((message.media.photo instanceof TLRPC.TL_photoEmpty) || (message.media.document instanceof TLRPC.TL_documentEmpty)) {
existMessageObject.setType();
getNotificationCenter().postNotificationName(NotificationCenter.notificationsSettingsUpdated, new Object[0]);
}
}
}
}
}
public void lambda$didReceivedNotification$8$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((9 + 2) % 2 <= 0) {
}
if (error == null) {
TLRPC.User user = getUser(Integer.valueOf(getUserConfig().getClientUserId()));
if (user == null) {
user = getUserConfig().getCurrentUser();
putUser(user, true);
} else {
getUserConfig().setCurrentUser(user);
}
if (user == null) {
return;
}
TLRPC.TL_photos_photo photo = (TLRPC.TL_photos_photo) response;
ArrayList<TLRPC.PhotoSize> sizes = photo.photo.sizes;
TLRPC.PhotoSize smallSize = FileLoader.getClosestPhotoSizeWithSize(sizes, 100);
TLRPC.PhotoSize bigSize = FileLoader.getClosestPhotoSizeWithSize(sizes, 1000);
user.photo = new TLRPC.TL_userProfilePhoto();
user.photo.photo_id = photo.photo.id;
if (smallSize != null) {
user.photo.photo_small = smallSize.location;
}
if (bigSize != null) {
user.photo.photo_big = bigSize.location;
} else if (smallSize != null) {
user.photo.photo_small = smallSize.location;
}
getMessagesStorage().clearUserPhotos(user.id);
ArrayList<TLRPC.User> users = new ArrayList<>();
users.add(user);
getMessagesStorage().putUsersAndChats(users, (ArrayList) null, false, true);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.aGZmotQ-j07pJDf--GO80fJ61bY(this));
}
}
public void lambda$null$7$MessagesController() {
if ((5 + 14) % 14 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 2);
getUserConfig().saveConfig(true);
}
public void lambda$didReceivedNotification$10$MessagesController(TLRPC.TL_wallPaperSettings settings, TLObject response, TLRPC.TL_error error) {
if ((31 + 17) % 17 <= 0) {
}
TLRPC.TL_wallPaper wallPaper = (TLRPC.TL_wallPaper) response;
File path = new File(ApplicationLoader.getFilesDirFixed(), this.uploadingWallpaperBlurred ? "wallpaper_original.jpg" : "wallpaper.jpg");
if (wallPaper != null) {
try {
AndroidUtilities.copyFile(path, FileLoader.getPathToAttach(wallPaper.document, true));
} catch (Exception e) {
}
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.M4sxj7kNnboHCJsgMe3sY4EIJwE(this, wallPaper, settings, path));
}
public void lambda$null$9$MessagesController(TLRPC.TL_wallPaper wallPaper, TLRPC.TL_wallPaperSettings settings, File path) {
if ((11 + 23) % 23 <= 0) {
}
if (this.uploadingWallpaper != null && wallPaper != null) {
wallPaper.settings = settings;
wallPaper.flags |= 4;
SharedPreferences preferences = getGlobalMainSettings();
SharedPreferences.Editor editor = preferences.edit();
editor.putLong("selectedBackground2", wallPaper.id);
editor.putString("selectedBackgroundSlug", wallPaper.slug);
editor.commit();
ArrayList<TLRPC.WallPaper> wallpapers = new ArrayList<>();
wallpapers.add(wallPaper);
getMessagesStorage().putWallpapers(wallpapers, 2);
TLRPC.PhotoSize image = FileLoader.getClosestPhotoSizeWithSize(wallPaper.document.thumbs, 320);
if (image != null) {
String newKey = image.location.volume_id + "_" + image.location.local_id + "@100_100";
String oldKey = Utilities.MD5(path.getAbsolutePath()) + "@100_100";
ImageLoader.getInstance().replaceImageInCache(oldKey, newKey, ImageLocation.getForDocument(image, wallPaper.document), false);
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.wallpapersNeedReload, Long.valueOf(wallPaper.id));
}
}
public void lambda$didReceivedNotification$16$MessagesController(final Theme.ThemeInfo themeInfo, TLObject response, TLRPC.TL_error error) {
if ((19 + 18) % 18 <= 0) {
}
int index = themeInfo.name.lastIndexOf(".attheme");
String n = themeInfo.name;
if (index > 0) {
n = n.substring(0, index);
}
if (response != null) {
TLRPC.Document document = (TLRPC.Document) response;
TLRPC.TL_inputDocument inputDocument = new TLRPC.TL_inputDocument();
inputDocument.access_hash = document.access_hash;
inputDocument.id = document.id;
inputDocument.file_reference = document.file_reference;
if (themeInfo.info == null || !themeInfo.info.creator) {
TLRPC.TL_account_createTheme req2 = new TLRPC.TL_account_createTheme();
req2.document = inputDocument;
req2.slug = (themeInfo.info == null || TextUtils.isEmpty(themeInfo.info.slug)) ? "" : themeInfo.info.slug;
req2.title = n;
getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.ca1-_DkA-hBFugGMrhrk6y5PO5E(this, themeInfo));
return;
}
TLRPC.TL_account_updateTheme req22 = new TLRPC.TL_account_updateTheme();
TLRPC.TL_inputTheme inputTheme = new TLRPC.TL_inputTheme();
inputTheme.id = themeInfo.info.id;
inputTheme.access_hash = themeInfo.info.access_hash;
req22.theme = inputTheme;
req22.slug = themeInfo.info.slug;
req22.flags |= 1;
req22.title = n;
req22.flags |= 2;
req22.document = inputDocument;
req22.flags |= 4;
req22.format = "android";
getConnectionsManager().sendRequest(req22, new -$.Lambda.MessagesController.H5xAsAL0oYwS92QQkZ0BkkrbbE8(this, themeInfo));
return;
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((13 + 2) % 2 <= 0) {
}
MessagesController.this.lambda$null$15$MessagesController(themeInfo);
}
});
}
public void lambda$null$12$MessagesController(final Theme.ThemeInfo themeInfo, final TLObject response1, TLRPC.TL_error error1) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((16 + 5) % 5 <= 0) {
}
MessagesController.this.lambda$null$11$MessagesController(response1, themeInfo);
}
});
}
public void lambda$null$11$MessagesController(TLObject response1, Theme.ThemeInfo themeInfo) {
if ((28 + 1) % 1 <= 0) {
}
if (response1 instanceof TLRPC.TL_theme) {
Theme.setThemeUploadInfo(themeInfo, (TLRPC.TL_theme) response1, false);
installTheme(themeInfo, themeInfo == Theme.getCurrentNightTheme());
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadedToServer, themeInfo);
return;
}
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, themeInfo);
}
public void lambda$null$14$MessagesController(Theme.ThemeInfo themeInfo, TLObject response1, TLRPC.TL_error error1) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.dPHZ8UK5JELSViFzuT5xjurTdPU(this, response1, themeInfo));
}
public void lambda$null$13$MessagesController(TLObject response1, Theme.ThemeInfo themeInfo) {
if ((32 + 12) % 12 <= 0) {
}
if (response1 instanceof TLRPC.TL_theme) {
Theme.setThemeUploadInfo(themeInfo, (TLRPC.TL_theme) response1, false);
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadedToServer, themeInfo);
} else {
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, themeInfo);
}
}
public void lambda$null$15$MessagesController(Theme.ThemeInfo themeInfo) {
if ((26 + 27) % 27 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, themeInfo);
}
public void cleanup() {
if ((12 + 14) % 14 <= 0) {
}
getContactsController().cleanup();
MediaController.getInstance().cleanup();
getNotificationsController().cleanup();
getSendMessagesHelper().cleanup();
getSecretChatHelper().cleanup();
getLocationController().cleanup();
getMediaDataController().cleanup();
DialogsActivity.dialogsLoaded[this.currentAccount] = false;
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
editor.clear().commit();
SharedPreferences.Editor editor2 = this.emojiPreferences.edit();
editor2.putLong("lastGifLoadTime", 0L).putLong("lastStickersLoadTime", 0L).putLong("lastStickersLoadTimeMask", 0L).putLong("lastStickersLoadTimeFavs", 0L).commit();
SharedPreferences.Editor editor3 = this.mainPreferences.edit();
editor3.remove("archivehint").remove("archivehint_l").remove("gifhint").remove("soundHint").remove("dcDomainName2").remove("webFileDatacenterId").remove("last_contacts_get_diff").remove("contacts_apply_id").remove("contacts_apply_hash").remove("contacts_apply_count").commit();
this.lastScheduledServerQueryTime.clear();
this.reloadingWebpages.clear();
this.reloadingWebpagesPending.clear();
this.reloadingScheduledWebpages.clear();
this.reloadingScheduledWebpagesPending.clear();
this.dialogs_dict.clear();
this.dialogs_read_inbox_max.clear();
this.loadingPinnedDialogs.clear();
this.dialogs_read_outbox_max.clear();
this.exportedChats.clear();
this.fullUsers.clear();
this.fullChats.clear();
this.dialogsByFolder.clear();
this.unreadUnmutedDialogs = 0;
this.joiningToChannels.clear();
this.migratedChats.clear();
this.channelViewsToSend.clear();
this.pollsToCheck.clear();
this.pollsToCheckSize = 0;
this.dialogsServerOnly.clear();
this.dialogsForward.clear();
this.allDialogs.clear();
this.dialogsCanAddUsers.clear();
this.dialogsChannelsOnly.clear();
this.dialogsGroupsOnly.clear();
this.dialogsUnreadOnly.clear();
this.dialogsUsersOnly.clear();
this.dialogMessagesByIds.clear();
this.dialogMessagesByRandomIds.clear();
this.channelAdmins.clear();
this.loadingChannelAdmins.clear();
this.users.clear();
this.objectsByUsernames.clear();
this.chats.clear();
this.dialogMessage.clear();
this.deletedHistory.clear();
this.printingUsers.clear();
this.printingStrings.clear();
this.printingStringsTypes.clear();
this.onlinePrivacy.clear();
this.loadingPeerSettings.clear();
this.deletingDialogs.clear();
this.clearingHistoryDialogs.clear();
this.lastPrintingStringCount = 0;
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.gXfSRQe5iuuSBR15B0RVCNjjpGo(this));
this.createdDialogMainThreadIds.clear();
this.visibleDialogMainThreadIds.clear();
this.visibleScheduledDialogMainThreadIds.clear();
this.blockedUsers.clear();
this.sendingTypings.clear();
this.loadingFullUsers.clear();
this.loadedFullUsers.clear();
this.reloadingMessages.clear();
this.loadingFullChats.clear();
this.loadingFullParticipants.clear();
this.loadedFullParticipants.clear();
this.loadedFullChats.clear();
this.dialogsLoaded = false;
this.nextDialogsCacheOffset.clear();
this.loadingDialogs.clear();
this.dialogsEndReached.clear();
this.serverDialogsEndReached.clear();
this.loadingAppConfig = false;
this.checkingTosUpdate = false;
this.nextTosCheckTime = 0;
this.nextProxyInfoCheckTime = 0;
this.checkingProxyInfo = false;
this.loadingUnreadDialogs = false;
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
this.currentDeletingTaskChannelId = 0;
this.gettingNewDeleteTask = false;
this.loadingBlockedUsers = false;
this.totalBlockedCount = -1;
this.blockedEndReached = false;
this.firstGettingTask = false;
this.updatingState = false;
this.resetingDialogs = false;
this.lastStatusUpdateTime = 0L;
this.offlineSent = false;
this.registeringForPush = false;
this.getDifferenceFirstSync = true;
this.uploadingAvatar = null;
this.uploadingWallpaper = null;
this.uploadingThemes.clear();
this.statusRequest = 0;
this.statusSettingState = 0;
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.SZb6ks_ZIHftfojuxWCm7_nFx7Q(this));
if (this.currentDeleteTaskRunnable != null) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
this.currentDeleteTaskRunnable = null;
}
addSupportUser();
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
AppPreferenceUtil.putString("PublishFcBean", "");
FcDBHelper.getInstance().deleteAll(HomeFcListBean.class);
FcDBHelper.getInstance().deleteAll(RecommendFcListBean.class);
FcDBHelper.getInstance().deleteAll(FollowedFcListBean.class);
}
public void lambda$cleanup$17$MessagesController() {
if ((1 + 7) % 7 <= 0) {
}
this.readTasks.clear();
this.readTasksMap.clear();
this.updatesQueueSeq.clear();
this.updatesQueuePts.clear();
this.updatesQueueQts.clear();
this.gettingUnknownChannels.clear();
this.gettingUnknownDialogs.clear();
this.updatesStartWaitTimeSeq = 0L;
this.updatesStartWaitTimePts = 0L;
this.updatesStartWaitTimeQts = 0L;
this.createdDialogIds.clear();
this.createdScheduledDialogIds.clear();
this.gettingDifference = false;
this.resetDialogsPinned = null;
this.resetDialogsAll = null;
}
public void lambda$cleanup$18$MessagesController() {
if ((21 + 2) % 2 <= 0) {
}
getConnectionsManager().setIsUpdating(false);
this.updatesQueueChannels.clear();
this.updatesStartWaitTimeChannels.clear();
this.gettingDifferenceChannels.clear();
this.channelsPts.clear();
this.shortPollChannels.clear();
this.needShortPollChannels.clear();
this.shortPollOnlines.clear();
this.needShortPollOnlines.clear();
}
public TLRPC.User getUser(Integer id) {
return this.users.get(id);
}
public TLObject getUserOrChat(String username) {
if ((26 + 26) % 26 <= 0) {
}
if (username == null || username.length() == 0) {
return null;
}
return this.objectsByUsernames.get(username.toLowerCase());
}
public ConcurrentHashMap<Integer, TLRPC.User> getUsers() {
return this.users;
}
public ConcurrentHashMap<Integer, TLRPC.Chat> getChats() {
return this.chats;
}
public TLRPC.Chat getChat(Integer id) {
return this.chats.get(id);
}
public TLRPC.EncryptedChat getEncryptedChat(Integer id) {
return this.encryptedChats.get(id);
}
public TLRPC.EncryptedChat getEncryptedChatDB(int chat_id, boolean created) {
if ((7 + 11) % 11 <= 0) {
}
TLRPC.EncryptedChat chat = this.encryptedChats.get(Integer.valueOf(chat_id));
if (chat != null) {
if (!created) {
return chat;
}
if (!(chat instanceof TLRPC.TL_encryptedChatWaiting) && !(chat instanceof TLRPC.TL_encryptedChatRequested)) {
return chat;
}
}
CountDownLatch countDownLatch = new CountDownLatch(1);
ArrayList<TLObject> result = new ArrayList<>();
getMessagesStorage().getEncryptedChat(chat_id, countDownLatch, result);
try {
countDownLatch.await();
} catch (Exception e) {
FileLog.e(e);
}
if (result.size() == 2) {
TLRPC.EncryptedChat chat2 = (TLRPC.EncryptedChat) result.get(0);
TLRPC.User user = (TLRPC.User) result.get(1);
putEncryptedChat(chat2, false);
putUser(user, true);
return chat2;
}
return chat;
}
public boolean isDialogVisible(long dialog_id, boolean scheduled) {
if ((11 + 12) % 12 <= 0) {
}
return (scheduled ? this.visibleScheduledDialogMainThreadIds : this.visibleDialogMainThreadIds).contains(Long.valueOf(dialog_id));
}
public void setLastVisibleDialogId(long dialog_id, boolean scheduled, boolean set) {
if ((28 + 17) % 17 <= 0) {
}
ArrayList<Long> arrayList = scheduled ? this.visibleScheduledDialogMainThreadIds : this.visibleDialogMainThreadIds;
if (set) {
if (arrayList.contains(Long.valueOf(dialog_id))) {
return;
}
arrayList.add(Long.valueOf(dialog_id));
return;
}
arrayList.remove(Long.valueOf(dialog_id));
}
public void setLastCreatedDialogId(long dialogId, boolean scheduled, boolean set) {
if ((3 + 5) % 5 <= 0) {
}
if (!scheduled) {
ArrayList<Long> arrayList = this.createdDialogMainThreadIds;
if (set) {
if (arrayList.contains(Long.valueOf(dialogId))) {
return;
} else {
arrayList.add(Long.valueOf(dialogId));
}
} else {
arrayList.remove(Long.valueOf(dialogId));
SparseArray<MessageObject> array = this.pollsToCheck.get(dialogId);
if (array != null) {
int N = array.size();
for (int a = 0; a < N; a++) {
MessageObject object = array.valueAt(a);
object.pollVisibleOnScreen = false;
}
}
}
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.D5XSy0oukQMwf37SZX8fT8qIJ_o(this, scheduled, set, dialogId));
}
public void lambda$setLastCreatedDialogId$19$MessagesController(boolean scheduled, boolean set, long dialogId) {
if ((6 + 12) % 12 <= 0) {
}
ArrayList<Long> arrayList2 = scheduled ? this.createdScheduledDialogIds : this.createdDialogIds;
if (set) {
if (arrayList2.contains(Long.valueOf(dialogId))) {
return;
}
arrayList2.add(Long.valueOf(dialogId));
return;
}
arrayList2.remove(Long.valueOf(dialogId));
}
public TLRPC.ExportedChatInvite getExportedInvite(int chat_id) {
return this.exportedChats.get(chat_id);
}
public boolean putUser(TLRPC.User user, boolean fromCache) {
if ((26 + 26) % 26 <= 0) {
}
if (user == null) {
return false;
}
boolean fromCache2 = (!fromCache || user.id / 1000 == 333 || user.id == 777000) ? false : true;
TLRPC.User oldUser = this.users.get(Integer.valueOf(user.id));
if (oldUser == user) {
return false;
}
if (oldUser != null && !TextUtils.isEmpty(oldUser.username)) {
this.objectsByUsernames.remove(oldUser.username.toLowerCase());
}
if (!TextUtils.isEmpty(user.username)) {
this.objectsByUsernames.put(user.username.toLowerCase(), user);
}
if (user.min) {
if (oldUser != null) {
if (!fromCache2) {
if (user.bot) {
if (user.username != null) {
oldUser.username = user.username;
oldUser.flags |= 8;
} else {
oldUser.flags &= -9;
oldUser.username = null;
}
}
if (user.photo != null) {
oldUser.photo = user.photo;
oldUser.flags |= 32;
} else {
oldUser.flags &= -33;
oldUser.photo = null;
}
}
} else {
this.users.put(Integer.valueOf(user.id), user);
}
} else if (!fromCache2) {
this.users.put(Integer.valueOf(user.id), user);
if (user.id == getUserConfig().getClientUserId()) {
getUserConfig().setCurrentUser(user);
getUserConfig().saveConfig(true);
}
if (oldUser != null && user.status != null && oldUser.status != null && user.status.expires != oldUser.status.expires) {
return true;
}
} else if (oldUser == null) {
this.users.put(Integer.valueOf(user.id), user);
} else if (oldUser.min) {
user.min = false;
if (oldUser.bot) {
if (oldUser.username != null) {
user.username = oldUser.username;
user.flags |= 8;
} else {
user.flags &= -9;
user.username = null;
}
}
if (oldUser.photo != null) {
user.photo = oldUser.photo;
user.flags |= 32;
} else {
user.flags &= -33;
user.photo = null;
}
this.users.put(Integer.valueOf(user.id), user);
}
return false;
}
public void putUsers(ArrayList<TLRPC.User> users, boolean fromCache) {
if ((15 + 23) % 23 <= 0) {
}
if (users == null || users.isEmpty()) {
return;
}
boolean updateStatus = false;
int count = users.size();
for (int a = 0; a < count; a++) {
TLRPC.User user = users.get(a);
if (putUser(user, fromCache)) {
updateStatus = true;
}
}
if (updateStatus) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$putUsers$20$MessagesController();
}
});
}
}
public void lambda$putUsers$20$MessagesController() {
if ((11 + 19) % 19 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 4);
}
public void putChat(final TLRPC.Chat chat, boolean fromCache) {
TLRPC.Chat oldChat;
if ((14 + 14) % 14 <= 0) {
}
if (chat == null || (oldChat = this.chats.get(Integer.valueOf(chat.id))) == chat) {
return;
}
if (oldChat != null && !TextUtils.isEmpty(oldChat.username)) {
this.objectsByUsernames.remove(oldChat.username.toLowerCase());
}
if (!TextUtils.isEmpty(chat.username)) {
this.objectsByUsernames.put(chat.username.toLowerCase(), chat);
}
if (chat.min) {
if (oldChat != null) {
if (!fromCache) {
oldChat.title = chat.title;
oldChat.photo = chat.photo;
oldChat.broadcast = chat.broadcast;
oldChat.verified = chat.verified;
oldChat.megagroup = chat.megagroup;
if (chat.default_banned_rights != null) {
oldChat.default_banned_rights = chat.default_banned_rights;
oldChat.flags |= 262144;
}
if (chat.admin_rights != null) {
oldChat.admin_rights = chat.admin_rights;
oldChat.flags |= 16384;
}
if (chat.banned_rights != null) {
oldChat.banned_rights = chat.banned_rights;
oldChat.flags |= UPDATE_MASK_MESSAGE_TEXT;
}
if (chat.username != null) {
oldChat.username = chat.username;
oldChat.flags |= 64;
} else {
oldChat.flags &= -65;
oldChat.username = null;
}
if (chat.participants_count != 0) {
oldChat.participants_count = chat.participants_count;
return;
}
return;
}
return;
}
this.chats.put(Integer.valueOf(chat.id), chat);
return;
}
if (!fromCache) {
if (oldChat != null) {
if (chat.version != oldChat.version) {
this.loadedFullChats.remove(Integer.valueOf(chat.id));
}
if (oldChat.participants_count != 0 && chat.participants_count == 0) {
chat.participants_count = oldChat.participants_count;
chat.flags = 131072 | chat.flags;
}
int oldFlags = oldChat.banned_rights != null ? oldChat.banned_rights.flags : 0;
int newFlags = chat.banned_rights != null ? chat.banned_rights.flags : 0;
int oldFlags2 = oldChat.default_banned_rights != null ? oldChat.default_banned_rights.flags : 0;
int newFlags2 = chat.default_banned_rights != null ? chat.default_banned_rights.flags : 0;
oldChat.default_banned_rights = chat.default_banned_rights;
if (oldChat.default_banned_rights == null) {
oldChat.flags &= -262145;
} else {
oldChat.flags = 262144 | oldChat.flags;
}
oldChat.banned_rights = chat.banned_rights;
if (oldChat.banned_rights == null) {
oldChat.flags &= -32769;
} else {
oldChat.flags = 32768 | oldChat.flags;
}
oldChat.admin_rights = chat.admin_rights;
if (oldChat.admin_rights == null) {
oldChat.flags &= -16385;
} else {
oldChat.flags |= 16384;
}
if (oldFlags != newFlags || oldFlags2 != newFlags2) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((27 + 11) % 11 <= 0) {
}
MessagesController.this.lambda$putChat$21$MessagesController(chat);
}
});
}
}
this.chats.put(Integer.valueOf(chat.id), chat);
return;
}
if (oldChat == null) {
this.chats.put(Integer.valueOf(chat.id), chat);
return;
}
if (oldChat.min) {
chat.min = false;
chat.title = oldChat.title;
chat.photo = oldChat.photo;
chat.broadcast = oldChat.broadcast;
chat.verified = oldChat.verified;
chat.megagroup = oldChat.megagroup;
if (oldChat.default_banned_rights != null) {
chat.default_banned_rights = oldChat.default_banned_rights;
chat.flags = 262144 | chat.flags;
}
if (oldChat.admin_rights != null) {
chat.admin_rights = oldChat.admin_rights;
chat.flags |= 16384;
}
if (oldChat.banned_rights != null) {
chat.banned_rights = oldChat.banned_rights;
chat.flags = 32768 | chat.flags;
}
if (oldChat.username != null) {
chat.username = oldChat.username;
chat.flags |= 64;
} else {
chat.flags &= -65;
chat.username = null;
}
if (oldChat.participants_count != 0 && chat.participants_count == 0) {
chat.participants_count = oldChat.participants_count;
chat.flags = 131072 | chat.flags;
}
this.chats.put(Integer.valueOf(chat.id), chat);
}
}
public void lambda$putChat$21$MessagesController(TLRPC.Chat chat) {
if ((3 + 3) % 3 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.channelRightsUpdated, chat);
}
public void putChats(ArrayList<TLRPC.Chat> chats, boolean fromCache) {
if ((24 + 29) % 29 <= 0) {
}
if (chats == null || chats.isEmpty()) {
return;
}
int count = chats.size();
for (int a = 0; a < count; a++) {
TLRPC.Chat chat = chats.get(a);
putChat(chat, fromCache);
}
}
public void setReferer(String referer) {
if ((10 + 2) % 2 <= 0) {
}
if (referer == null) {
return;
}
this.installReferer = referer;
this.mainPreferences.edit().putString("installReferer", referer).commit();
}
public void putEncryptedChat(TLRPC.EncryptedChat encryptedChat, boolean fromCache) {
if ((13 + 27) % 27 <= 0) {
}
if (encryptedChat == null) {
return;
}
if (fromCache) {
this.encryptedChats.putIfAbsent(Integer.valueOf(encryptedChat.id), encryptedChat);
} else {
this.encryptedChats.put(Integer.valueOf(encryptedChat.id), encryptedChat);
}
}
public void putEncryptedChats(ArrayList<TLRPC.EncryptedChat> encryptedChats, boolean fromCache) {
if ((18 + 25) % 25 <= 0) {
}
if (encryptedChats == null || encryptedChats.isEmpty()) {
return;
}
int count = encryptedChats.size();
for (int a = 0; a < count; a++) {
TLRPC.EncryptedChat encryptedChat = encryptedChats.get(a);
putEncryptedChat(encryptedChat, fromCache);
}
}
public TLRPC.UserFull getUserFull(int uid) {
return this.fullUsers.get(uid);
}
public TLRPC.ChatFull getChatFull(int chatId) {
return this.fullChats.get(chatId);
}
public void cancelLoadFullUser(int uid) {
if ((16 + 24) % 24 <= 0) {
}
this.loadingFullUsers.remove(Integer.valueOf(uid));
}
public void cancelLoadFullChat(int cid) {
if ((30 + 32) % 32 <= 0) {
}
this.loadingFullChats.remove(Integer.valueOf(cid));
}
protected void clearFullUsers() {
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
}
private void reloadDialogsReadValue(ArrayList<TLRPC.Dialog> dialogs, long did) {
if ((17 + 8) % 8 <= 0) {
}
if (did == 0 && (dialogs == null || dialogs.isEmpty())) {
return;
}
TLRPC.TL_messages_getPeerDialogs req = new TLRPC.TL_messages_getPeerDialogs();
if (dialogs != null) {
for (int a = 0; a < dialogs.size(); a++) {
TLRPC.InputPeer inputPeer = getInputPeer((int) dialogs.get(a).id);
if (!(inputPeer instanceof TLRPC.TL_inputPeerChannel) || inputPeer.access_hash != 0) {
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = inputPeer;
req.peers.add(inputDialogPeer);
}
}
} else {
TLRPC.InputPeer inputPeer2 = getInputPeer((int) did);
if ((inputPeer2 instanceof TLRPC.TL_inputPeerChannel) && inputPeer2.access_hash == 0) {
return;
}
TLRPC.TL_inputDialogPeer inputDialogPeer2 = new TLRPC.TL_inputDialogPeer();
inputDialogPeer2.peer = inputPeer2;
req.peers.add(inputDialogPeer2);
}
if (req.peers.isEmpty()) {
return;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.PzOJIziXHyIXY3kRWFgJtiFPY8g(this));
}
public void lambda$reloadDialogsReadValue$22$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((17 + 17) % 17 <= 0) {
}
if (response != null) {
TLRPC.TL_messages_peerDialogs res = (TLRPC.TL_messages_peerDialogs) response;
ArrayList<TLRPC.Update> arrayList = new ArrayList<>();
for (int a = 0; a < res.dialogs.size(); a++) {
TLRPC.Dialog dialog = (TLRPC.Dialog) res.dialogs.get(a);
if (dialog.read_inbox_max_id == 0) {
dialog.read_inbox_max_id = 1;
}
if (dialog.read_outbox_max_id == 0) {
dialog.read_outbox_max_id = 1;
}
DialogObject.initDialog(dialog);
Integer value = this.dialogs_read_inbox_max.get(Long.valueOf(dialog.id));
if (value == null) {
value = 0;
}
this.dialogs_read_inbox_max.put(Long.valueOf(dialog.id), Integer.valueOf(Math.max(dialog.read_inbox_max_id, value.intValue())));
if (value.intValue() == 0) {
if (dialog.peer.channel_id != 0) {
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
update.channel_id = dialog.peer.channel_id;
update.max_id = dialog.read_inbox_max_id;
arrayList.add(update);
} else {
TLRPC.TL_updateReadHistoryInbox update2 = new TLRPC.TL_updateReadHistoryInbox();
update2.peer = dialog.peer;
update2.max_id = dialog.read_inbox_max_id;
arrayList.add(update2);
}
}
Integer value2 = this.dialogs_read_outbox_max.get(Long.valueOf(dialog.id));
if (value2 == null) {
value2 = 0;
}
this.dialogs_read_outbox_max.put(Long.valueOf(dialog.id), Integer.valueOf(Math.max(dialog.read_outbox_max_id, value2.intValue())));
if (value2.intValue() == 0) {
if (dialog.peer.channel_id != 0) {
TLRPC.TL_updateReadChannelOutbox update3 = new TLRPC.TL_updateReadChannelOutbox();
update3.channel_id = dialog.peer.channel_id;
update3.max_id = dialog.read_outbox_max_id;
arrayList.add(update3);
} else {
TLRPC.TL_updateReadHistoryOutbox update4 = new TLRPC.TL_updateReadHistoryOutbox();
update4.peer = dialog.peer;
update4.max_id = dialog.read_outbox_max_id;
arrayList.add(update4);
}
}
}
if (!arrayList.isEmpty()) {
processUpdateArray(arrayList, null, null, false, 0);
}
}
}
public String getAdminRank(int chatId, int uid) {
if ((5 + 5) % 5 <= 0) {
}
SparseArray<String> array = this.channelAdmins.get(chatId);
if (array == null) {
return null;
}
return array.get(uid);
}
public boolean isChannelAdminsLoaded(int chatId) {
return this.channelAdmins.get(chatId) != null;
}
public void loadChannelAdmins(int chatId, boolean cache) {
if ((2 + 10) % 10 <= 0) {
}
int loadTime = this.loadingChannelAdmins.get(chatId);
if (SystemClock.uptimeMillis() - loadTime < 60) {
return;
}
this.loadingChannelAdmins.put(chatId, (int) (SystemClock.uptimeMillis() / 1000));
if (cache) {
getMessagesStorage().loadChannelAdmins(chatId);
return;
}
TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
req.channel = getInputChannel(chatId);
req.limit = 100;
req.filter = new TLRPC.TL_channelParticipantsAdmins();
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.HLH7ZkDIdyQb-Yq3skRTfWguAzg(this, chatId));
}
public void lambda$loadChannelAdmins$23$MessagesController(int chatId, TLObject response, TLRPC.TL_error error) {
if (response instanceof TLRPC.TL_channels_channelParticipants) {
processLoadedAdminsResponse(chatId, (TLRPC.TL_channels_channelParticipants) response);
}
}
public void processLoadedAdminsResponse(int chatId, TLRPC.TL_channels_channelParticipants participants) {
if ((1 + 19) % 19 <= 0) {
}
SparseArray<String> array1 = new SparseArray<>(participants.participants.size());
for (int a = 0; a < participants.participants.size(); a++) {
TLRPC.ChannelParticipant participant = (TLRPC.ChannelParticipant) participants.participants.get(a);
array1.put(participant.user_id, participant.rank != null ? participant.rank : "");
}
processLoadedChannelAdmins(array1, chatId, false);
}
public void processLoadedChannelAdmins(final SparseArray<String> array, final int chatId, final boolean cache) {
if (!cache) {
getMessagesStorage().putChannelAdmins(chatId, array);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((23 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$processLoadedChannelAdmins$24$MessagesController(chatId, array, cache);
}
});
}
public void lambda$processLoadedChannelAdmins$24$MessagesController(int chatId, SparseArray array, boolean cache) {
this.channelAdmins.put(chatId, array);
if (cache) {
this.loadingChannelAdmins.delete(chatId);
loadChannelAdmins(chatId, false);
}
}
public void loadUsers(int[] userIds, long[] accessHashs, int classGuid) {
if ((30 + 19) % 19 <= 0) {
}
if (userIds == null || accessHashs == null || userIds.length != accessHashs.length) {
return;
}
ArrayList<Integer> emptyResult = new ArrayList<>();
if (this.users != null) {
for (int userId : userIds) {
TLRPC.User user = this.users.get(Integer.valueOf(userId));
if (user != null) {
getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, Integer.valueOf(user.id), user);
} else {
emptyResult.add(Integer.valueOf(userId));
}
}
if (emptyResult.size() > 0) {
loadUsers(emptyResult, accessHashs, classGuid);
}
}
}
public void loadUsers(ArrayList<Integer> idList, long[] accessHashs, int classGuid) {
if ((10 + 2) % 2 <= 0) {
}
if (idList == null || accessHashs == null || idList.size() != accessHashs.length) {
return;
}
ArrayList<TLRPC.InputUser> list = new ArrayList<>();
for (int i = 0; i < idList.size(); i++) {
TLRPC.TL_inputUser tL_inputUser = new TLRPC.TL_inputUser();
((TLRPC.InputUser) tL_inputUser).user_id = idList.get(i).intValue();
((TLRPC.InputUser) tL_inputUser).access_hash = accessHashs[i];
list.add(tL_inputUser);
}
loadUsers(list, classGuid);
}
public void loadUsers(ArrayList<TLRPC.InputUser> users, int classGuid) {
if ((29 + 11) % 11 <= 0) {
}
if (users == null) {
return;
}
TLRPC.TL_users_getUsers req = new TLRPC.TL_users_getUsers();
req.id.addAll(users);
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$loadUsers$26$MessagesController(tLObject, tL_error);
}
}), classGuid);
}
public void lambda$loadUsers$26$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((30 + 26) % 26 <= 0) {
}
if (response instanceof TLRPC.Vector) {
TLRPC.Vector vector = (TLRPC.Vector) response;
if (!vector.objects.isEmpty()) {
for (int i = 0; i < vector.objects.size(); i++) {
ArrayList<TLRPC.User> arrayList1 = new ArrayList<>();
final TLRPC.User user = (TLRPC.User) vector.objects.get(i);
arrayList1.add(user);
getMessagesStorage().putUsersAndChats(arrayList1, (ArrayList) null, false, true);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((18 + 6) % 6 <= 0) {
}
MessagesController.this.lambda$null$25$MessagesController(user);
}
});
}
}
}
}
public void lambda$null$25$MessagesController(TLRPC.User user) {
if ((18 + 15) % 15 <= 0) {
}
putUser(user, false);
getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, Integer.valueOf(user.id), user);
}
public void loadFullChat(int chat_id, int classGuid, boolean force) {
TLObject request;
if ((20 + 32) % 32 <= 0) {
}
boolean loaded = this.loadedFullChats.contains(Integer.valueOf(chat_id));
if (this.loadingFullChats.contains(Integer.valueOf(chat_id))) {
return;
}
if (!force && loaded) {
return;
}
this.loadingFullChats.add(Integer.valueOf(chat_id));
long dialog_id = -chat_id;
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
if (ChatObject.isChannel(chat)) {
TLObject tL_channels_getFullChannel = new TLRPC.TL_channels_getFullChannel();
((TLRPC.TL_channels_getFullChannel) tL_channels_getFullChannel).channel = getInputChannel(chat);
if (chat.megagroup) {
loadChannelAdmins(chat_id, !loaded);
}
request = tL_channels_getFullChannel;
} else {
TLObject tL_messages_getFullChat = new TLRPC.TL_messages_getFullChat();
((TLRPC.TL_messages_getFullChat) tL_messages_getFullChat).chat_id = chat_id;
if (this.dialogs_read_inbox_max.get(Long.valueOf(dialog_id)) == null || this.dialogs_read_outbox_max.get(Long.valueOf(dialog_id)) == null) {
reloadDialogsReadValue(null, dialog_id);
}
request = tL_messages_getFullChat;
}
int reqId = getConnectionsManager().sendRequest(request, new -$.Lambda.MessagesController.rh_wMt-QA-9-vOd5FzmpJJg4Hg0(this, chat, dialog_id, chat_id, classGuid));
if (classGuid != 0) {
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
}
}
public void lambda$loadFullChat$29$MessagesController(TLRPC.Chat chat, long dialog_id, final int chat_id, final int classGuid, TLObject response, TLRPC.TL_error error) {
Integer value;
Integer value2;
if ((26 + 18) % 18 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.oC1pEepH-YbZTNW8Mw74QT5Qb2g(this, error, chat_id));
return;
}
final TLRPC.TL_messages_chatFull res = (TLRPC.TL_messages_chatFull) response;
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
getMessagesStorage().updateChatInfo(res.full_chat, false);
if (ChatObject.isChannel(chat)) {
Integer value3 = this.dialogs_read_inbox_max.get(Long.valueOf(dialog_id));
if (value3 != null) {
value = value3;
} else {
value = Integer.valueOf(getMessagesStorage().getDialogReadMax(false, dialog_id));
}
this.dialogs_read_inbox_max.put(Long.valueOf(dialog_id), Integer.valueOf(Math.max(res.full_chat.read_inbox_max_id, value.intValue())));
if (value.intValue() == 0) {
ArrayList<TLRPC.Update> arrayList = new ArrayList<>();
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
update.channel_id = chat_id;
update.max_id = res.full_chat.read_inbox_max_id;
arrayList.add(update);
processUpdateArray(arrayList, null, null, false, 0);
}
Integer value4 = this.dialogs_read_outbox_max.get(Long.valueOf(dialog_id));
if (value4 != null) {
value2 = value4;
} else {
value2 = Integer.valueOf(getMessagesStorage().getDialogReadMax(true, dialog_id));
}
this.dialogs_read_outbox_max.put(Long.valueOf(dialog_id), Integer.valueOf(Math.max(res.full_chat.read_outbox_max_id, value2.intValue())));
if (value2.intValue() == 0) {
ArrayList<TLRPC.Update> arrayList2 = new ArrayList<>();
TLRPC.TL_updateReadChannelOutbox update2 = new TLRPC.TL_updateReadChannelOutbox();
update2.channel_id = chat_id;
update2.max_id = res.full_chat.read_outbox_max_id;
arrayList2.add(update2);
processUpdateArray(arrayList2, null, null, false, 0);
}
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((18 + 29) % 29 <= 0) {
}
MessagesController.this.lambda$null$27$MessagesController(chat_id, res, classGuid);
}
});
}
public void lambda$null$27$MessagesController(int chat_id, TLRPC.TL_messages_chatFull res, int classGuid) {
if ((20 + 27) % 27 <= 0) {
}
this.fullChats.put(chat_id, res.full_chat);
applyDialogNotificationsSettings(-chat_id, res.full_chat.notify_settings);
for (int a = 0; a < res.full_chat.bot_info.size(); a++) {
TLRPC.BotInfo botInfo = (TLRPC.BotInfo) res.full_chat.bot_info.get(a);
getMediaDataController().putBotInfo(botInfo);
}
this.exportedChats.put(chat_id, res.full_chat.exported_invite);
this.loadingFullChats.remove(Integer.valueOf(chat_id));
this.loadedFullChats.add(Integer.valueOf(chat_id));
putUsers(res.users, false);
putChats(res.chats, false);
if (res.full_chat.stickerset != null) {
getMediaDataController().getGroupStickerSetById(res.full_chat.stickerset);
}
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, res.full_chat, Integer.valueOf(classGuid), false, null);
}
public void lambda$null$28$MessagesController(TLRPC.TL_error error, int chat_id) {
if ((30 + 13) % 13 <= 0) {
}
checkChannelError(error.text, chat_id);
this.loadingFullChats.remove(Integer.valueOf(chat_id));
}
public void loadFullUser(TLRPC.User user, int classGuid, boolean force) {
loadFullUser(user, 0, classGuid, force);
}
public void loadFullUser(int userId, int classGuid, boolean force) {
loadFullUser(null, userId, classGuid, force);
}
public void loadFullUser(TLRPC.User user, int userId, int classGuid, boolean force) {
if ((4 + 6) % 6 <= 0) {
}
if (user == null || this.loadingFullUsers.contains(Integer.valueOf(user.id)) || (!force && this.loadedFullUsers.contains(Integer.valueOf(user.id)))) {
if (userId == 0 || this.loadingFullUsers.contains(Integer.valueOf(userId))) {
return;
}
if (!force && this.loadedFullUsers.contains(Integer.valueOf(userId))) {
return;
}
}
int searchId = user != null ? user.id : userId;
this.loadingFullUsers.add(Integer.valueOf(searchId));
TLRPCContacts.CL_user_getFulluser req = new TLRPCContacts.CL_user_getFulluser();
req.inputUser = user != null ? getInputUser(user) : getInputUser(userId);
long dialog_id = searchId;
if (this.dialogs_read_inbox_max.get(Long.valueOf(dialog_id)) == null || this.dialogs_read_outbox_max.get(Long.valueOf(dialog_id)) == null) {
reloadDialogsReadValue(null, dialog_id);
}
int reqId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.S9dmKvzjik0macVbjcmlxOm-frg(this, searchId, user, classGuid));
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
}
public void lambda$loadFullUser$32$MessagesController(final int searchId, final TLRPC.User user, final int classGuid, TLObject response, TLRPC.TL_error error) {
if ((12 + 15) % 15 <= 0) {
}
if (error == null) {
final TLRPC.UserFull userFull = (TLRPC.UserFull) response;
getMessagesStorage().updateUserInfo(userFull, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((27 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$null$30$MessagesController(userFull, searchId, user, classGuid);
}
});
return;
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((10 + 16) % 16 <= 0) {
}
MessagesController.this.lambda$null$31$MessagesController(searchId);
}
});
}
public void lambda$null$30$MessagesController(TLRPC.UserFull userFull, int searchId, TLRPC.User user, int classGuid) {
String names;
if ((18 + 18) % 18 <= 0) {
}
savePeerSettings(userFull.user.id, userFull.settings, false);
applyDialogNotificationsSettings(searchId, userFull.notify_settings);
if (userFull.bot_info instanceof TLRPC.TL_botInfo) {
getMediaDataController().putBotInfo(userFull.bot_info);
}
int index = this.blockedUsers.indexOfKey(searchId);
if (userFull.blocked) {
if (index < 0) {
this.blockedUsers.put(searchId, 1);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
} else if (index >= 0) {
this.blockedUsers.removeAt(index);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
this.fullUsers.put(searchId, userFull);
this.loadingFullUsers.remove(Integer.valueOf(searchId));
this.loadedFullUsers.add(Integer.valueOf(searchId));
if (user != null) {
names = user.first_name + user.last_name + user.username;
} else {
names = null;
}
ArrayList<TLRPC.User> users = new ArrayList<>();
users.add(userFull.user);
putUsers(users, false);
getMessagesStorage().putUsersAndChats(users, (ArrayList) null, false, true);
if (names != null) {
if (!names.equals(userFull.user.first_name + userFull.user.last_name + userFull.user.username)) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 1);
}
}
if (userFull.bot_info instanceof TLRPC.TL_botInfo) {
getNotificationCenter().postNotificationName(NotificationCenter.botInfoDidLoad, userFull.bot_info, Integer.valueOf(classGuid));
}
getNotificationCenter().postNotificationName(NotificationCenter.userFullInfoDidLoad, Integer.valueOf(searchId), userFull, null);
}
public void lambda$null$31$MessagesController(int searchId) {
if ((28 + 16) % 16 <= 0) {
}
this.loadingFullUsers.remove(Integer.valueOf(searchId));
}
private void reloadMessages(ArrayList<Integer> mids, long dialog_id, boolean scheduled) {
TLObject request;
ArrayList<Integer> arrayList;
if ((27 + 12) % 12 <= 0) {
}
if (mids.isEmpty()) {
return;
}
ArrayList<Integer> result = new ArrayList<>();
TLRPC.Chat chat = ChatObject.getChatByDialog(dialog_id, this.currentAccount);
if (ChatObject.isChannel(chat)) {
TLObject request2 = new TLRPC.TL_channels_getMessages();
((TLRPC.TL_channels_getMessages) request2).channel = getInputChannel(chat);
((TLRPC.TL_channels_getMessages) request2).id = result;
request = request2;
} else {
TLObject tL_messages_getMessages = new TLRPC.TL_messages_getMessages();
((TLRPC.TL_messages_getMessages) tL_messages_getMessages).id = result;
request = tL_messages_getMessages;
}
ArrayList<Integer> arrayList2 = this.reloadingMessages.get(dialog_id);
for (int a = 0; a < mids.size(); a++) {
Integer mid = mids.get(a);
if (arrayList2 == null || !arrayList2.contains(mid)) {
result.add(mid);
}
}
if (result.isEmpty()) {
return;
}
if (arrayList2 != null) {
arrayList = arrayList2;
} else {
ArrayList<Integer> arrayList3 = new ArrayList<>();
this.reloadingMessages.put(dialog_id, arrayList3);
arrayList = arrayList3;
}
arrayList.addAll(result);
getConnectionsManager().sendRequest(request, new -$.Lambda.MessagesController.V81jP-n4-g-kfHV6SM6_qYitLAg(this, dialog_id, chat, scheduled, result));
}
public void lambda$reloadMessages$34$MessagesController(long dialog_id, TLRPC.Chat chat, boolean scheduled, ArrayList result, TLObject response, TLRPC.TL_error error) {
Integer inboxValue;
Integer outboxValue;
if ((11 + 2) % 2 <= 0) {
}
if (error == null) {
TLRPC.messages_Messages messagesRes = (TLRPC.messages_Messages) response;
SparseArray<TLRPC.User> usersLocal = new SparseArray<>();
for (int a = 0; a < messagesRes.users.size(); a++) {
TLRPC.User u = (TLRPC.User) messagesRes.users.get(a);
usersLocal.put(u.id, u);
}
SparseArray<TLRPC.Chat> chatsLocal = new SparseArray<>();
for (int a2 = 0; a2 < messagesRes.chats.size(); a2++) {
TLRPC.Chat c = (TLRPC.Chat) messagesRes.chats.get(a2);
chatsLocal.put(c.id, c);
}
Integer inboxValue2 = this.dialogs_read_inbox_max.get(Long.valueOf(dialog_id));
if (inboxValue2 == null) {
Integer inboxValue3 = Integer.valueOf(getMessagesStorage().getDialogReadMax(false, dialog_id));
this.dialogs_read_inbox_max.put(Long.valueOf(dialog_id), inboxValue3);
inboxValue = inboxValue3;
} else {
inboxValue = inboxValue2;
}
Integer outboxValue2 = this.dialogs_read_outbox_max.get(Long.valueOf(dialog_id));
if (outboxValue2 == null) {
Integer outboxValue3 = Integer.valueOf(getMessagesStorage().getDialogReadMax(true, dialog_id));
this.dialogs_read_outbox_max.put(Long.valueOf(dialog_id), outboxValue3);
outboxValue = outboxValue3;
} else {
outboxValue = outboxValue2;
}
ArrayList<MessageObject> objects = new ArrayList<>();
for (int a3 = 0; a3 < messagesRes.messages.size(); a3++) {
TLRPC.Message message = (TLRPC.Message) messagesRes.messages.get(a3);
if (chat != null && chat.megagroup) {
message.flags |= Integer.MIN_VALUE;
}
message.dialog_id = dialog_id;
if (!scheduled) {
message.unread = (message.out ? outboxValue : inboxValue).intValue() < message.id;
}
objects.add(new MessageObject(this.currentAccount, message, usersLocal, chatsLocal, true));
}
ImageLoader.saveMessagesThumbs(messagesRes.messages);
getMessagesStorage().putMessages(messagesRes, dialog_id, -1, 0, false, scheduled);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.9-U8yF32xhFFL4ApCKhFAeti4Dw(this, dialog_id, result, objects));
}
}
public void lambda$null$33$MessagesController(long dialog_id, ArrayList result, ArrayList objects) {
if ((18 + 22) % 22 <= 0) {
}
ArrayList<Integer> arrayList1 = this.reloadingMessages.get(dialog_id);
if (arrayList1 != null) {
arrayList1.removeAll(result);
if (arrayList1.isEmpty()) {
this.reloadingMessages.remove(dialog_id);
}
}
MessageObject dialogObj = this.dialogMessage.get(dialog_id);
if (dialogObj != null) {
int a = 0;
while (true) {
if (a >= objects.size()) {
break;
}
MessageObject obj = (MessageObject) objects.get(a);
if (dialogObj == null || dialogObj.getId() != obj.getId()) {
a++;
} else {
this.dialogMessage.put(dialog_id, obj);
if (obj.messageOwner.to_id.channel_id == 0) {
MessageObject obj2 = this.dialogMessagesByIds.get(obj.getId());
this.dialogMessagesByIds.remove(obj.getId());
if (obj2 != null) {
this.dialogMessagesByIds.put(obj2.getId(), obj2);
}
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
}
getNotificationCenter().postNotificationName(NotificationCenter.replaceMessagesObjects, Long.valueOf(dialog_id), objects);
}
public void hidePeerSettingsBar(long dialogId, TLRPC.User currentUser, TLRPC.Chat currentChat) {
if ((23 + 7) % 7 <= 0) {
}
if (currentUser == null && currentChat == null) {
return;
}
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
editor.putInt("dialog_bar_vis3" + dialogId, 3);
editor.commit();
if (((int) dialogId) != 0) {
TLRPC.TL_messages_hidePeerSettingsBar req = new TLRPC.TL_messages_hidePeerSettingsBar();
if (currentUser != null) {
req.peer = getInputPeer(currentUser.id);
} else if (currentChat != null) {
req.peer = getInputPeer(-currentChat.id);
}
getConnectionsManager().sendRequest(req, -$.Lambda.MessagesController.7KywRuywHZPo_2LdPkRWn-W4vHs.INSTANCE);
}
}
static void lambda$hidePeerSettingsBar$35(TLObject response, TLRPC.TL_error error) {
}
public void reportSpam(long dialogId, TLRPC.User currentUser, TLRPC.Chat currentChat, TLRPC.EncryptedChat currentEncryptedChat, boolean geo) {
if ((20 + 20) % 20 <= 0) {
}
if (currentUser == null && currentChat == null && currentEncryptedChat == null) {
return;
}
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
editor.putInt("dialog_bar_vis3" + dialogId, 3);
editor.commit();
if (((int) dialogId) == 0) {
if (currentEncryptedChat == null || currentEncryptedChat.access_hash == 0) {
return;
}
TLRPC.TL_messages_reportEncryptedSpam req = new TLRPC.TL_messages_reportEncryptedSpam();
req.peer = new TLRPC.TL_inputEncryptedChat();
req.peer.chat_id = currentEncryptedChat.id;
req.peer.access_hash = currentEncryptedChat.access_hash;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$reportSpam$36(tLObject, tL_error);
}
}, 2);
return;
}
TLRPC.TL_account_reportPeer req2 = new TLRPC.TL_account_reportPeer();
if (currentChat != null) {
req2.peer = getInputPeer(-currentChat.id);
} else if (currentUser != null) {
req2.peer = getInputPeer(currentUser.id);
}
if (geo) {
req2.reason = new TLRPC.TL_inputReportReasonGeoIrrelevant();
} else {
req2.reason = new TLRPC.TL_inputReportReasonSpam();
}
getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$reportSpam$37(tLObject, tL_error);
}
}, 2);
}
static void lambda$reportSpam$36(TLObject response, TLRPC.TL_error error) {
}
static void lambda$reportSpam$37(TLObject response, TLRPC.TL_error error) {
}
private void savePeerSettings(long dialogId, TLRPC.TL_peerSettings settings, boolean update) {
if ((18 + 12) % 12 <= 0) {
}
if (settings != null) {
if (this.notificationsPreferences.getInt("dialog_bar_vis3" + dialogId, 0) == 3) {
return;
}
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
boolean bar_hidden = (settings.report_spam || settings.add_contact || settings.block_contact || settings.share_contact || settings.report_geo) ? false : true;
editor.putInt("dialog_bar_vis3" + dialogId, bar_hidden ? 1 : 2);
editor.putBoolean("dialog_bar_share" + dialogId, settings.share_contact);
editor.putBoolean("dialog_bar_report" + dialogId, settings.report_spam);
editor.putBoolean("dialog_bar_add" + dialogId, settings.add_contact);
editor.putBoolean("dialog_bar_block" + dialogId, settings.block_contact);
editor.putBoolean("dialog_bar_exception" + dialogId, settings.need_contacts_exception);
editor.putBoolean("dialog_bar_location" + dialogId, settings.report_geo);
editor.commit();
getNotificationCenter().postNotificationName(NotificationCenter.peerSettingsDidLoad, Long.valueOf(dialogId));
}
}
public void loadPeerSettings(TLRPC.User currentUser, TLRPC.Chat currentChat) {
long dialogId;
if ((11 + 8) % 8 <= 0) {
}
if (currentUser == null && currentChat == null) {
return;
}
if (currentUser != null) {
dialogId = currentUser.id;
} else {
dialogId = -currentChat.id;
}
if (this.loadingPeerSettings.indexOfKey(dialogId) >= 0) {
return;
}
this.loadingPeerSettings.put(dialogId, true);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("request spam button for " + dialogId);
}
int vis = this.notificationsPreferences.getInt("dialog_bar_vis3" + dialogId, 0);
if (vis == 1 || vis == 3) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("dialog bar already hidden for " + dialogId);
return;
}
return;
}
TLRPC.TL_messages_getPeerSettings req = new TLRPC.TL_messages_getPeerSettings();
if (currentUser != null) {
req.peer = getInputPeer(currentUser.id);
} else if (currentChat != null) {
req.peer = getInputPeer(-currentChat.id);
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.B9SLEXplQluGQGE9Y3D5w-AKCwc(this, dialogId));
}
public void lambda$loadPeerSettings$39$MessagesController(long dialogId, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.mpyKOGN7laYZuVtiQ5w-89R41jE(this, dialogId, response));
}
public void lambda$null$38$MessagesController(long dialogId, TLObject response) {
if ((4 + 23) % 23 <= 0) {
}
this.loadingPeerSettings.remove(dialogId);
if (response != null) {
savePeerSettings(dialogId, (TLRPC.TL_peerSettings) response, false);
}
}
protected void processNewChannelDifferenceParams(int pts, int pts_count, int channelId) {
if ((21 + 29) % 29 <= 0) {
}
int channelPts = this.channelsPts.get(channelId);
if (channelPts == 0) {
channelPts = getMessagesStorage().getChannelPtsSync(channelId);
if (channelPts == 0) {
channelPts = 1;
}
this.channelsPts.put(channelId, channelPts);
}
if (channelPts + pts_count == pts) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY CHANNEL PTS");
}
this.channelsPts.put(channelId, pts);
getMessagesStorage().saveChannelPts(channelId, pts);
return;
}
if (channelPts != pts) {
long updatesStartWaitTime = this.updatesStartWaitTimeChannels.get(channelId);
boolean gettingDifferenceChannel = this.gettingDifferenceChannels.get(channelId);
if (gettingDifferenceChannel || updatesStartWaitTime == 0 || Math.abs(System.currentTimeMillis() - updatesStartWaitTime) <= 1500) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD CHANNEL UPDATE TO QUEUE pts = " + pts + " pts_count = " + pts_count);
}
if (updatesStartWaitTime == 0) {
this.updatesStartWaitTimeChannels.put(channelId, System.currentTimeMillis());
}
UserActionUpdatesPts updates = new UserActionUpdatesPts();
updates.pts = pts;
updates.pts_count = pts_count;
updates.chat_id = channelId;
ArrayList<TLRPC.Updates> arrayList = this.updatesQueueChannels.get(channelId);
if (arrayList == null) {
arrayList = new ArrayList<>();
this.updatesQueueChannels.put(channelId, arrayList);
}
arrayList.add(updates);
return;
}
getChannelDifference(channelId);
}
}
protected void processNewDifferenceParams(int seq, int pts, int date, int pts_count) {
if ((4 + 1) % 1 <= 0) {
}
if (pts != -1) {
if (getMessagesStorage().getLastPtsValue() + pts_count == pts) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY PTS");
}
getMessagesStorage().setLastPtsValue(pts);
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
} else if (getMessagesStorage().getLastPtsValue() != pts) {
if (this.gettingDifference || this.updatesStartWaitTimePts == 0 || Math.abs(System.currentTimeMillis() - this.updatesStartWaitTimePts) <= 1500) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD UPDATE TO QUEUE pts = " + pts + " pts_count = " + pts_count);
}
if (this.updatesStartWaitTimePts == 0) {
this.updatesStartWaitTimePts = System.currentTimeMillis();
}
UserActionUpdatesPts updates = new UserActionUpdatesPts();
updates.pts = pts;
updates.pts_count = pts_count;
this.updatesQueuePts.add(updates);
} else {
getDifference();
}
}
}
if (seq != -1) {
if (getMessagesStorage().getLastSeqValue() + 1 == seq) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY SEQ");
}
getMessagesStorage().setLastSeqValue(seq);
if (date != -1) {
getMessagesStorage().setLastDateValue(date);
}
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
return;
}
if (getMessagesStorage().getLastSeqValue() != seq) {
if (this.gettingDifference || this.updatesStartWaitTimeSeq == 0 || Math.abs(System.currentTimeMillis() - this.updatesStartWaitTimeSeq) <= 1500) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD UPDATE TO QUEUE seq = " + seq);
}
if (this.updatesStartWaitTimeSeq == 0) {
this.updatesStartWaitTimeSeq = System.currentTimeMillis();
}
UserActionUpdatesSeq updates2 = new UserActionUpdatesSeq();
updates2.seq = seq;
this.updatesQueueSeq.add(updates2);
return;
}
getDifference();
}
}
}
public void didAddedNewTask(int minDate, SparseArray<ArrayList<Long>> mids) {
if ((17 + 7) % 7 <= 0) {
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.wtP6_OANuZREWa1i7lT5Iqly_1s(this, minDate));
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.KlDm9M61vxBWvYxZ7ZAwcz_Kn-k(this, mids));
}
public void lambda$didAddedNewTask$40$MessagesController(int minDate) {
int i;
if ((24 + 31) % 31 <= 0) {
}
if ((this.currentDeletingTaskMids == null && !this.gettingNewDeleteTask) || ((i = this.currentDeletingTaskTime) != 0 && minDate < i)) {
getNewDeleteTask(null, 0);
}
}
public void lambda$didAddedNewTask$41$MessagesController(SparseArray mids) {
if ((16 + 21) % 21 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.didCreatedNewDeleteTask, mids);
}
public void getNewDeleteTask(final ArrayList<Integer> oldTask, final int channelId) {
if ((17 + 4) % 4 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((17 + 14) % 14 <= 0) {
}
MessagesController.this.lambda$getNewDeleteTask$42$MessagesController(oldTask, channelId);
}
});
}
public void lambda$getNewDeleteTask$42$MessagesController(ArrayList oldTask, int channelId) {
this.gettingNewDeleteTask = true;
getMessagesStorage().getNewTask(oldTask, channelId);
}
private boolean checkDeletingTask(boolean runnable) {
int i;
if ((23 + 19) % 19 <= 0) {
}
int currentServerTime = getConnectionsManager().getCurrentTime();
if (this.currentDeletingTaskMids == null || (!runnable && ((i = this.currentDeletingTaskTime) == 0 || i > currentServerTime))) {
return false;
}
this.currentDeletingTaskTime = 0;
if (this.currentDeleteTaskRunnable != null && !runnable) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
}
this.currentDeleteTaskRunnable = null;
ArrayList<Integer> mids = new ArrayList<>(this.currentDeletingTaskMids);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.EASiISx8PuMRaQxyb0GX2lyiVXw(this, mids));
return true;
}
public void lambda$checkDeletingTask$44$MessagesController(ArrayList mids) {
if ((3 + 10) % 10 <= 0) {
}
if (!mids.isEmpty() && ((Integer) mids.get(0)).intValue() > 0) {
getMessagesStorage().emptyMessagesMedia(mids);
} else {
deleteMessages(mids, null, null, 0L, 0, false, false);
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.N7WifTY8gcd9PziL_LLz9raLNS0(this, mids));
}
public void lambda$null$43$MessagesController(ArrayList mids) {
getNewDeleteTask(mids, this.currentDeletingTaskChannelId);
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
}
public void processLoadedDeleteTask(final int taskTime, final ArrayList<Integer> messages, int channelId) {
if ((19 + 28) % 28 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((27 + 3) % 3 <= 0) {
}
MessagesController.this.lambda$processLoadedDeleteTask$46$MessagesController(messages, taskTime);
}
});
}
public void lambda$processLoadedDeleteTask$46$MessagesController(ArrayList messages, int taskTime) {
if ((13 + 26) % 26 <= 0) {
}
this.gettingNewDeleteTask = false;
if (messages != null) {
this.currentDeletingTaskTime = taskTime;
this.currentDeletingTaskMids = messages;
if (this.currentDeleteTaskRunnable != null) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
this.currentDeleteTaskRunnable = null;
}
if (!checkDeletingTask(false)) {
this.currentDeleteTaskRunnable = new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$null$45$MessagesController();
}
};
int currentServerTime = getConnectionsManager().getCurrentTime();
Utilities.stageQueue.postRunnable(this.currentDeleteTaskRunnable, Math.abs(currentServerTime - this.currentDeletingTaskTime) * 1000);
return;
}
return;
}
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
}
public void lambda$null$45$MessagesController() {
checkDeletingTask(true);
}
public void loadDialogPhotos(final int did, final int count, final long max_id, boolean fromCache, final int classGuid) {
if ((11 + 25) % 25 <= 0) {
}
if (fromCache) {
getMessagesStorage().getDialogPhotos(did, count, max_id, classGuid);
return;
}
if (did > 0) {
TLRPC.User user = getUser(Integer.valueOf(did));
if (user == null) {
return;
}
TLRPC.TL_photos_getUserPhotos req = new TLRPC.TL_photos_getUserPhotos();
req.limit = count;
req.offset = 0;
req.max_id = (int) max_id;
req.user_id = getInputUser(user);
int reqId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController._Ya83Xo_6zRojP72G8pP5J7eCBY(this, did, count, max_id, classGuid));
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
return;
}
if (did < 0) {
TLRPC.TL_messages_search req2 = new TLRPC.TL_messages_search();
req2.filter = new TLRPC.TL_inputMessagesFilterChatPhotos();
req2.limit = count;
req2.offset_id = (int) max_id;
req2.q = "";
req2.peer = getInputPeer(did);
int reqId2 = getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((32 + 16) % 16 <= 0) {
}
MessagesController.this.lambda$loadDialogPhotos$48$MessagesController(did, count, max_id, classGuid, tLObject, tL_error);
}
});
getConnectionsManager().bindRequestToGuid(reqId2, classGuid);
}
}
public void lambda$loadDialogPhotos$47$MessagesController(int did, int count, long max_id, int classGuid, TLObject response, TLRPC.TL_error error) {
if ((1 + 1) % 1 <= 0) {
}
if (error == null) {
TLRPC.photos_Photos res = (TLRPC.photos_Photos) response;
processLoadedUserPhotos(res, did, count, max_id, false, classGuid);
}
}
public void lambda$loadDialogPhotos$48$MessagesController(int did, int count, long max_id, int classGuid, TLObject response, TLRPC.TL_error error) {
if ((2 + 11) % 11 <= 0) {
}
if (error == null) {
TLRPC.messages_Messages messages = (TLRPC.messages_Messages) response;
TLRPC.TL_photos_photos res = new TLRPC.TL_photos_photos();
res.count = messages.count;
res.users.addAll(messages.users);
for (int a = 0; a < messages.messages.size(); a++) {
TLRPC.Message message = (TLRPC.Message) messages.messages.get(a);
if (message.action != null && message.action.photo != null) {
res.photos.add(message.action.photo);
}
}
processLoadedUserPhotos(res, did, count, max_id, false, classGuid);
}
}
public void blockUser(int user_id) {
if ((31 + 9) % 9 <= 0) {
}
TLRPC.User user = getUser(Integer.valueOf(user_id));
if (user == null || this.blockedUsers.indexOfKey(user_id) >= 0) {
return;
}
this.blockedUsers.put(user_id, 1);
if (user.bot) {
getMediaDataController().removeInline(user_id);
} else {
getMediaDataController().removePeer(user_id);
}
int i = this.totalBlockedCount;
if (i >= 0) {
this.totalBlockedCount = i + 1;
}
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
TLRPC.TL_contacts_block req = new TLRPC.TL_contacts_block();
req.id = getInputUser(user);
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$blockUser$49(tLObject, tL_error);
}
});
}
static void lambda$blockUser$49(TLObject response, TLRPC.TL_error error) {
}
public void setUserBannedRole(int chatId, TLRPC.User user, TLRPC.TL_chatBannedRights rights, boolean isChannel, BaseFragment parentFragment) {
if ((17 + 23) % 23 <= 0) {
}
if (user == null || rights == null) {
return;
}
TLRPC.TL_channels_editBanned req = new TLRPC.TL_channels_editBanned();
req.channel = getInputChannel(chatId);
req.user_id = getInputUser(user);
req.banned_rights = rights;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.lUtjWIya7Hhh05URfeb-FbeWy70(this, chatId, parentFragment, req, isChannel));
}
public void lambda$setUserBannedRole$52$MessagesController(int chatId, final BaseFragment parentFragment, final TLRPC.TL_channels_editBanned req, final boolean isChannel, TLObject response, final TLRPC.TL_error error) {
if ((26 + 1) % 1 <= 0) {
}
if (error == null) {
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.t087Mj9M4bilL2XEwB0YOF_h_NM(this, chatId), 1000L);
} else {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((32 + 23) % 23 <= 0) {
}
MessagesController.this.lambda$null$51$MessagesController(error, parentFragment, req, isChannel);
}
});
}
}
public void lambda$null$50$MessagesController(int chatId) {
if ((6 + 18) % 18 <= 0) {
}
loadFullChat(chatId, 0, true);
}
public void lambda$null$51$MessagesController(TLRPC.TL_error error, BaseFragment parentFragment, TLRPC.TL_channels_editBanned req, boolean isChannel) {
if ((4 + 10) % 10 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, parentFragment, req, new Object[]{Boolean.valueOf(isChannel)});
}
public void setChannelSlowMode(final int chatId, int seconds) {
if ((16 + 31) % 31 <= 0) {
}
TLRPC.TL_channels_toggleSlowMode req = new TLRPC.TL_channels_toggleSlowMode();
req.seconds = seconds;
req.channel = getInputChannel(chatId);
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((14 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$setChannelSlowMode$54$MessagesController(chatId, tLObject, tL_error);
}
});
}
public void lambda$setChannelSlowMode$54$MessagesController(int chatId, TLObject response, TLRPC.TL_error error) {
if ((15 + 17) % 17 <= 0) {
}
if (error == null) {
getMessagesController().processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.bmD7WK1m0u8SnRuKfxHcGpwEcyI(this, chatId), 1000L);
}
}
public void lambda$null$53$MessagesController(int chatId) {
if ((14 + 20) % 20 <= 0) {
}
loadFullChat(chatId, 0, true);
}
public void setDefaultBannedRole(final int chatId, TLRPC.TL_chatBannedRights rights, final boolean isChannel, final BaseFragment parentFragment) {
if ((29 + 31) % 31 <= 0) {
}
if (rights == null) {
return;
}
final TLRPC.TL_messages_editChatDefaultBannedRights req = new TLRPC.TL_messages_editChatDefaultBannedRights();
req.peer = getInputPeer(-chatId);
req.banned_rights = rights;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((17 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$setDefaultBannedRole$57$MessagesController(chatId, parentFragment, req, isChannel, tLObject, tL_error);
}
});
}
public void lambda$setDefaultBannedRole$57$MessagesController(final int chatId, BaseFragment parentFragment, TLRPC.TL_messages_editChatDefaultBannedRights req, boolean isChannel, TLObject response, TLRPC.TL_error error) {
if ((30 + 18) % 18 <= 0) {
}
if (error == null) {
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((18 + 24) % 24 <= 0) {
}
MessagesController.this.lambda$null$55$MessagesController(chatId);
}
}, 1000L);
} else {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.rUQsHkTT90CtBi_c-hymjwOtI-g(this, error, parentFragment, req, isChannel));
}
}
public void lambda$null$55$MessagesController(int chatId) {
if ((22 + 18) % 18 <= 0) {
}
loadFullChat(chatId, 0, true);
}
public void lambda$null$56$MessagesController(TLRPC.TL_error error, BaseFragment parentFragment, TLRPC.TL_messages_editChatDefaultBannedRights req, boolean isChannel) {
if ((4 + 21) % 21 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, parentFragment, req, new Object[]{Boolean.valueOf(isChannel)});
}
public void setUserAdminRole(final int chatId, TLRPC.User user, TLRPC.TL_chatAdminRights rights, String rank, final boolean isChannel, final BaseFragment parentFragment, boolean addingNew) {
if ((31 + 27) % 27 <= 0) {
}
if (user != null && rights != null) {
TLRPC.Chat chat = getChat(Integer.valueOf(chatId));
if (ChatObject.isChannel(chat)) {
final TLRPC.TL_channels_editAdmin req = new TLRPC.TL_channels_editAdmin();
req.channel = getInputChannel(chat);
req.user_id = getInputUser(user);
req.admin_rights = rights;
req.rank = rank;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((7 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$setUserAdminRole$60$MessagesController(chatId, parentFragment, req, isChannel, tLObject, tL_error);
}
});
return;
}
TLRPC.TL_messages_editChatAdmin req2 = new TLRPC.TL_messages_editChatAdmin();
req2.chat_id = chatId;
req2.user_id = getInputUser(user);
req2.is_admin = rights.change_info || rights.delete_messages || rights.ban_users || rights.invite_users || rights.pin_messages || rights.add_admins;
-$.Lambda.MessagesController.lTGjSiNLRNQHmogdEFxZDEWp8Gc ltgjsinlrnqhmogdefxzdewp8gc = new -$.Lambda.MessagesController.lTGjSiNLRNQHmogdEFxZDEWp8Gc(this, chatId, parentFragment, req2);
if (req2.is_admin && addingNew) {
addUserToChat(chatId, user, null, 0, null, parentFragment, new -$.Lambda.MessagesController.zwt4ngVZD0yCIXxUgWmtBLSY-Ac(this, req2, ltgjsinlrnqhmogdefxzdewp8gc));
} else {
getConnectionsManager().sendRequest(req2, ltgjsinlrnqhmogdefxzdewp8gc);
}
}
}
public void lambda$setUserAdminRole$60$MessagesController(int chatId, final BaseFragment parentFragment, final TLRPC.TL_channels_editAdmin req, final boolean isChannel, TLObject response, final TLRPC.TL_error error) {
if ((29 + 7) % 7 <= 0) {
}
if (error == null) {
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.EmwVP-6nXYZE0eiQywht0mGESIM(this, chatId), 1000L);
} else {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((13 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$null$59$MessagesController(error, parentFragment, req, isChannel);
}
});
}
}
public void lambda$null$58$MessagesController(int chatId) {
if ((15 + 11) % 11 <= 0) {
}
loadFullChat(chatId, 0, true);
}
public void lambda$null$59$MessagesController(TLRPC.TL_error error, BaseFragment parentFragment, TLRPC.TL_channels_editAdmin req, boolean isChannel) {
if ((19 + 3) % 3 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, parentFragment, req, new Object[]{Boolean.valueOf(isChannel)});
}
public void lambda$setUserAdminRole$63$MessagesController(final int chatId, BaseFragment parentFragment, TLRPC.TL_messages_editChatAdmin req, TLObject response, TLRPC.TL_error error) {
if ((13 + 4) % 4 <= 0) {
}
if (error == null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((28 + 9) % 9 <= 0) {
}
MessagesController.this.lambda$null$61$MessagesController(chatId);
}
}, 1000L);
} else {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.8mSK9bf4NOE38HT21Myt3P_Q3p0(this, error, parentFragment, req));
}
}
public void lambda$null$61$MessagesController(int chatId) {
if ((11 + 26) % 26 <= 0) {
}
loadFullChat(chatId, 0, true);
}
public void lambda$null$62$MessagesController(TLRPC.TL_error error, BaseFragment parentFragment, TLRPC.TL_messages_editChatAdmin req) {
if ((22 + 6) % 6 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, parentFragment, req, new Object[]{false});
}
public void lambda$setUserAdminRole$64$MessagesController(TLRPC.TL_messages_editChatAdmin req, RequestDelegate requestDelegate) {
getConnectionsManager().sendRequest(req, requestDelegate);
}
public void unblockUser(int user_id) {
if ((19 + 18) % 18 <= 0) {
}
TLRPC.TL_contacts_unblock req = new TLRPC.TL_contacts_unblock();
TLRPC.User user = getUser(Integer.valueOf(user_id));
if (user == null) {
return;
}
this.totalBlockedCount--;
this.blockedUsers.delete(user.id);
req.id = getInputUser(user);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
getConnectionsManager().sendRequest(req, -$.Lambda.MessagesController.ImqYZPPuQsSnYVs-mJTWXBO8lpY.INSTANCE);
}
static void lambda$unblockUser$65(TLObject response, TLRPC.TL_error error) {
}
public void getBlockedUsers(final boolean reset) {
if ((23 + 11) % 11 <= 0) {
}
if (!getUserConfig().isClientActivated() || this.loadingBlockedUsers) {
return;
}
this.loadingBlockedUsers = true;
final TLRPC.TL_contacts_getBlocked req = new TLRPC.TL_contacts_getBlocked();
req.offset = reset ? 0 : this.blockedUsers.size();
req.limit = reset ? 20 : 100;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((22 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$getBlockedUsers$67$MessagesController(reset, req, tLObject, tL_error);
}
});
}
public void lambda$getBlockedUsers$67$MessagesController(boolean reset, TLRPC.TL_contacts_getBlocked req, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.a65pCAh2xtBnuOOOXR-NFg_rnKc(this, response, reset, req));
}
public void lambda$null$66$MessagesController(TLObject response, boolean reset, TLRPC.TL_contacts_getBlocked req) {
if ((11 + 11) % 11 <= 0) {
}
if (response != null) {
TLRPC.contacts_Blocked res = (TLRPC.contacts_Blocked) response;
putUsers(res.users, false);
getMessagesStorage().putUsersAndChats(res.users, (ArrayList) null, true, true);
if (reset) {
this.blockedUsers.clear();
}
this.totalBlockedCount = Math.max(res.count, res.blocked.size());
this.blockedEndReached = res.blocked.size() < req.limit;
int N = res.blocked.size();
for (int a = 0; a < N; a++) {
TLRPC.TL_contactBlocked blocked = (TLRPC.TL_contactBlocked) res.blocked.get(a);
this.blockedUsers.put(blocked.user_id, 1);
}
this.loadingBlockedUsers = false;
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
}
public void deleteUserPhoto(TLRPC.InputPhoto photo) {
if ((31 + 6) % 6 <= 0) {
}
if (photo == null) {
TLRPC.TL_photos_updateProfilePhoto req = new TLRPC.TL_photos_updateProfilePhoto();
req.id = new TLRPC.TL_inputPhotoEmpty();
getUserConfig().getCurrentUser().photo = new TLRPC.TL_userProfilePhotoEmpty();
TLRPC.User user = getUser(Integer.valueOf(getUserConfig().getClientUserId()));
if (user == null) {
user = getUserConfig().getCurrentUser();
}
if (user == null) {
return;
}
user.photo = getUserConfig().getCurrentUser().photo;
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_ALL));
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.vIag29K8ftiRe8BxF0TN0_GXVB8(this));
return;
}
TLRPC.TL_photos_deletePhotos req2 = new TLRPC.TL_photos_deletePhotos();
req2.id.add(photo);
getConnectionsManager().sendRequest(req2, -$.Lambda.MessagesController.ezeK8wCI6erRq6BBhBIWNSCDPxg.INSTANCE);
}
public void lambda$deleteUserPhoto$69$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((11 + 26) % 26 <= 0) {
}
if (error == null) {
TLRPC.User user1 = getUser(Integer.valueOf(getUserConfig().getClientUserId()));
if (user1 == null) {
user1 = getUserConfig().getCurrentUser();
putUser(user1, false);
} else {
getUserConfig().setCurrentUser(user1);
}
if (user1 == null) {
return;
}
getMessagesStorage().clearUserPhotos(user1.id);
ArrayList<TLRPC.User> users = new ArrayList<>();
users.add(user1);
getMessagesStorage().putUsersAndChats(users, (ArrayList) null, false, true);
user1.photo = (TLRPC.UserProfilePhoto) response;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$null$68$MessagesController();
}
});
}
}
public void lambda$null$68$MessagesController() {
if ((32 + 17) % 17 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_ALL));
getUserConfig().saveConfig(true);
}
static void lambda$deleteUserPhoto$70(TLObject response, TLRPC.TL_error error) {
}
public void processLoadedUserPhotos(TLRPC.photos_Photos res, int did, int count, long max_id, boolean fromCache, int classGuid) {
if ((24 + 29) % 29 <= 0) {
}
if (!fromCache) {
getMessagesStorage().putUsersAndChats(res.users, (ArrayList) null, true, true);
getMessagesStorage().putDialogPhotos(did, res);
} else if (res == null || res.photos.isEmpty()) {
loadDialogPhotos(did, count, max_id, false, classGuid);
return;
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.MAdxpgLbB2eaPr4zNMnJ_p6IDNY(this, res, fromCache, did, count, classGuid));
}
public void lambda$processLoadedUserPhotos$71$MessagesController(TLRPC.photos_Photos res, boolean fromCache, int did, int count, int classGuid) {
if ((14 + 30) % 30 <= 0) {
}
putUsers(res.users, fromCache);
getNotificationCenter().postNotificationName(NotificationCenter.dialogPhotosLoaded, Integer.valueOf(did), Integer.valueOf(count), Boolean.valueOf(fromCache), Integer.valueOf(classGuid), res.photos);
}
public void uploadAndApplyUserAvatar(TLRPC.FileLocation location) {
if ((17 + 26) % 26 <= 0) {
}
if (location == null) {
return;
}
this.uploadingAvatar = FileLoader.getDirectory(4) + "/" + location.volume_id + "_" + location.local_id + ".jpg";
getFileLoader().uploadFile(this.uploadingAvatar, false, true, 16777216);
}
public void uploadAvatar(TLRPC.FileLocation location) {
if ((9 + 28) % 28 <= 0) {
}
if (location == null) {
return;
}
this.uploadingAvatar = FileLoader.getDirectory(4) + "/" + location.volume_id + "_" + location.local_id + ".jpg";
getFileLoader().uploadFile(this.uploadingAvatar, false, true, 16777216, false);
}
public void saveTheme(Theme.ThemeInfo themeInfo, boolean night, boolean unsave) {
if ((14 + 7) % 7 <= 0) {
}
if (themeInfo.info != null) {
TLRPC.TL_account_saveTheme req = new TLRPC.TL_account_saveTheme();
TLRPC.TL_inputTheme inputTheme = new TLRPC.TL_inputTheme();
inputTheme.id = themeInfo.info.id;
inputTheme.access_hash = themeInfo.info.access_hash;
req.theme = inputTheme;
req.unsave = unsave;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$saveTheme$72(tLObject, tL_error);
}
});
}
if (!unsave) {
installTheme(themeInfo, night);
}
}
static void lambda$saveTheme$72(TLObject response, TLRPC.TL_error error) {
}
public void installTheme(Theme.ThemeInfo themeInfo, boolean night) {
if ((1 + 32) % 32 <= 0) {
}
TLRPC.TL_account_installTheme req = new TLRPC.TL_account_installTheme();
req.dark = night;
if (themeInfo.info != null) {
req.format = "android";
TLRPC.TL_inputTheme inputTheme = new TLRPC.TL_inputTheme();
inputTheme.id = themeInfo.info.id;
inputTheme.access_hash = themeInfo.info.access_hash;
req.theme = inputTheme;
req.flags |= 2;
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$installTheme$73(tLObject, tL_error);
}
});
if (!TextUtils.isEmpty(themeInfo.slug)) {
TLRPC.TL_account_installWallPaper req2 = new TLRPC.TL_account_installWallPaper();
TLRPC.TL_inputWallPaperSlug inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
inputWallPaperSlug.slug = themeInfo.slug;
req2.wallpaper = inputWallPaperSlug;
req2.settings = new TLRPC.TL_wallPaperSettings();
req2.settings.blur = themeInfo.isBlured;
req2.settings.motion = themeInfo.isMotion;
getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$installTheme$74(tLObject, tL_error);
}
});
}
}
static void lambda$installTheme$73(TLObject response, TLRPC.TL_error error) {
}
static void lambda$installTheme$74(TLObject response, TLRPC.TL_error error) {
}
public void saveThemeToServer(Theme.ThemeInfo themeInfo) {
if ((19 + 5) % 5 <= 0) {
}
if (themeInfo == null || this.uploadingThemes.containsKey(themeInfo.pathToFile)) {
return;
}
this.uploadingThemes.put(themeInfo.pathToFile, themeInfo);
Utilities.globalQueue.postRunnable(new -$.Lambda.MessagesController.7VpMUhWBRxPvC-4NLiQxwedwnx8(this, themeInfo));
}
public void lambda$saveThemeToServer$76$MessagesController(final Theme.ThemeInfo themeInfo) {
if ((27 + 2) % 2 <= 0) {
}
final String thumbPath = Theme.createThemePreviewImage(themeInfo);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((2 + 4) % 4 <= 0) {
}
MessagesController.this.lambda$null$75$MessagesController(thumbPath, themeInfo);
}
});
}
public void lambda$null$75$MessagesController(String thumbPath, Theme.ThemeInfo themeInfo) {
if ((30 + 7) % 7 <= 0) {
}
if (thumbPath == null) {
this.uploadingThemes.remove(themeInfo.pathToFile);
return;
}
themeInfo.uploadingFile = themeInfo.pathToFile;
themeInfo.uploadingThumb = thumbPath;
this.uploadingThemes.put(thumbPath, themeInfo);
File f = new File(themeInfo.pathToFile);
f.length();
File f2 = new File(thumbPath);
f2.length();
getFileLoader().uploadFile(themeInfo.pathToFile, false, true, 67108864);
getFileLoader().uploadFile(thumbPath, false, true, 16777216);
}
public void saveWallpaperToServer(File path, final long wallPaperId, final String slug, long accessHash, boolean isBlurred, boolean isMotion, int backgroundColor, float intesity, final boolean install, long taskId) {
TLRPC.TL_account_installWallPaper tL_account_installWallPaper;
long newTaskId;
if ((28 + 16) % 16 <= 0) {
}
if (this.uploadingWallpaper != null) {
File finalPath = new File(ApplicationLoader.getFilesDirFixed(), this.uploadingWallpaperBlurred ? "wallpaper_original.jpg" : "wallpaper.jpg");
if (path == null || (!path.getAbsolutePath().equals(this.uploadingWallpaper) && !path.equals(finalPath))) {
getFileLoader().cancelUploadFile(this.uploadingWallpaper, false);
this.uploadingWallpaper = null;
} else {
this.uploadingWallpaperMotion = isMotion;
this.uploadingWallpaperBlurred = isBlurred;
return;
}
}
if (path != null) {
this.uploadingWallpaper = path.getAbsolutePath();
this.uploadingWallpaperMotion = isMotion;
this.uploadingWallpaperBlurred = isBlurred;
getFileLoader().uploadFile(this.uploadingWallpaper, false, true, 16777216);
return;
}
if (accessHash != 0) {
TLRPC.TL_inputWallPaper inputWallPaper = new TLRPC.TL_inputWallPaper();
inputWallPaper.id = wallPaperId;
inputWallPaper.access_hash = accessHash;
TLRPC.TL_wallPaperSettings settings = new TLRPC.TL_wallPaperSettings();
settings.blur = isBlurred;
settings.motion = isMotion;
if (backgroundColor != 0) {
settings.background_color = backgroundColor;
settings.flags = 1 | settings.flags;
settings.intensity = (int) (100.0f * intesity);
settings.flags |= 8;
}
if (install) {
TLRPC.TL_account_installWallPaper request = new TLRPC.TL_account_installWallPaper();
request.wallpaper = inputWallPaper;
request.settings = settings;
tL_account_installWallPaper = request;
} else {
TLRPC.TL_account_installWallPaper tL_account_saveWallPaper = new TLRPC.TL_account_saveWallPaper();
((TLRPC.TL_account_saveWallPaper) tL_account_saveWallPaper).wallpaper = inputWallPaper;
((TLRPC.TL_account_saveWallPaper) tL_account_saveWallPaper).settings = settings;
tL_account_installWallPaper = tL_account_saveWallPaper;
}
if (taskId != 0) {
newTaskId = taskId;
} else {
NativeByteBuffer data = null;
try {
try {
data = new NativeByteBuffer(UPDATE_MASK_PHONE);
} catch (Exception e) {
e = e;
data = null;
}
} catch (Exception e2) {
e = e2;
}
try {
data.writeInt32(19);
data.writeInt64(wallPaperId);
data.writeInt64(accessHash);
data.writeBool(isBlurred);
data.writeBool(isMotion);
data.writeInt32(backgroundColor);
data.writeDouble(intesity);
data.writeBool(install);
if (slug != null) {
data.writeString(slug);
} else {
data.writeString("");
}
data.limit(data.position());
} catch (Exception e3) {
e = e3;
FileLog.e(e);
newTaskId = getMessagesStorage().createPendingTask(data);
final long j = newTaskId;
getConnectionsManager().sendRequest(tL_account_installWallPaper, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((27 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$saveWallpaperToServer$77$MessagesController(j, install, wallPaperId, slug, tLObject, tL_error);
}
});
}
newTaskId = getMessagesStorage().createPendingTask(data);
}
final long j2 = newTaskId;
getConnectionsManager().sendRequest(tL_account_installWallPaper, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((27 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$saveWallpaperToServer$77$MessagesController(j2, install, wallPaperId, slug, tLObject, tL_error);
}
});
}
}
public void lambda$saveWallpaperToServer$77$MessagesController(long newTaskId, boolean install, long wallPaperId, String slug, TLObject response, TLRPC.TL_error error) {
if ((32 + 2) % 2 <= 0) {
}
getMessagesStorage().removePendingTask(newTaskId);
if (!install && this.uploadingWallpaper != null) {
SharedPreferences preferences = getGlobalMainSettings();
SharedPreferences.Editor editor = preferences.edit();
editor.putLong("selectedBackground2", wallPaperId);
if (!TextUtils.isEmpty(slug)) {
editor.putString("selectedBackgroundSlug", slug);
} else {
editor.remove("selectedBackgroundSlug");
}
editor.commit();
}
}
public void markChannelDialogMessageAsDeleted(ArrayList<Integer> messages, int channelId) {
if ((11 + 8) % 8 <= 0) {
}
MessageObject obj = this.dialogMessage.get(-channelId);
if (obj != null) {
for (int a = 0; a < messages.size(); a++) {
Integer id = messages.get(a);
if (obj.getId() == id.intValue()) {
obj.deleted = true;
return;
}
}
}
}
public void deleteMessages(ArrayList<Integer> messages, ArrayList<Long> randoms, TLRPC.EncryptedChat encryptedChat, long dialogId, int channelId, boolean forAll, boolean scheduled) {
if ((14 + 30) % 30 <= 0) {
}
deleteMessages(messages, randoms, encryptedChat, dialogId, channelId, forAll, scheduled, 0L, null);
}
public void deleteMessages(ArrayList<Integer> messages, ArrayList<Long> randoms, TLRPC.EncryptedChat encryptedChat, long dialogId, final int channelId, boolean forAll, boolean scheduled, long taskId, TLObject taskRequest) {
ArrayList<Integer> toSend;
final long newTaskId;
TLRPC.TL_messages_deleteMessages req;
TLRPC.TL_channels_deleteMessages req2;
final long newTaskId2;
TLRPC.TL_messages_deleteScheduledMessages req3;
long newTaskId3;
if ((31 + 12) % 12 <= 0) {
}
if ((messages == null || messages.isEmpty()) && taskRequest == null) {
return;
}
if (taskId != 0) {
toSend = null;
} else {
ArrayList<Integer> toSend2 = new ArrayList<>();
for (int a = 0; a < messages.size(); a++) {
Integer mid = messages.get(a);
if (mid.intValue() > 0) {
toSend2.add(mid);
}
}
if (scheduled) {
getMessagesStorage().markMessagesAsDeleted(messages, true, channelId, false, true);
} else {
if (channelId == 0) {
for (int a2 = 0; a2 < messages.size(); a2++) {
Integer id = messages.get(a2);
MessageObject obj = this.dialogMessagesByIds.get(id.intValue());
if (obj != null) {
obj.deleted = true;
}
}
} else {
markChannelDialogMessageAsDeleted(messages, channelId);
}
getMessagesStorage().markMessagesAsDeleted(messages, true, channelId, forAll, false);
getMessagesStorage().updateDialogsWithDeletedMessages(messages, (ArrayList) null, true, channelId);
}
getNotificationCenter().postNotificationName(NotificationCenter.messagesDeleted, messages, Integer.valueOf(channelId), Boolean.valueOf(scheduled));
toSend = toSend2;
}
if (scheduled) {
if (taskRequest != null) {
req3 = (TLRPC.TL_messages_deleteScheduledMessages) taskRequest;
newTaskId3 = taskId;
} else {
TLRPC.TL_messages_deleteScheduledMessages req4 = new TLRPC.TL_messages_deleteScheduledMessages();
req4.id = toSend;
req4.peer = getInputPeer((int) dialogId);
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(req4.getObjectSize() + 16);
data.writeInt32(18);
data.writeInt64(dialogId);
data.writeInt32(channelId);
req4.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
req3 = req4;
newTaskId3 = MessagesStorage.getInstance(this.currentAccount).createPendingTask(data);
}
ConnectionsManager.getInstance(this.currentAccount).sendRequest(req3, new -$.Lambda.MessagesController.B051AX3XscqYEAR5uDxQt0mAXOk(this, newTaskId3));
return;
}
if (channelId != 0) {
if (taskRequest != null) {
req2 = (TLRPC.TL_channels_deleteMessages) taskRequest;
newTaskId2 = taskId;
} else {
TLRPC.TL_channels_deleteMessages req5 = new TLRPC.TL_channels_deleteMessages();
req5.id = toSend;
req5.channel = getInputChannel(channelId);
NativeByteBuffer data2 = null;
try {
data2 = new NativeByteBuffer(req5.getObjectSize() + 8);
data2.writeInt32(7);
data2.writeInt32(channelId);
req5.serializeToStream(data2);
} catch (Exception e2) {
FileLog.e(e2);
}
req2 = req5;
newTaskId2 = getMessagesStorage().createPendingTask(data2);
}
getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((13 + 9) % 9 <= 0) {
}
MessagesController.this.lambda$deleteMessages$79$MessagesController(channelId, newTaskId2, tLObject, tL_error);
}
});
return;
}
if (randoms != null && encryptedChat != null && !randoms.isEmpty()) {
getSecretChatHelper().sendMessagesDeleteMessage(encryptedChat, randoms, (TLRPC.Message) null);
}
if (taskRequest != null) {
req = (TLRPC.TL_messages_deleteMessages) taskRequest;
newTaskId = taskId;
} else {
TLRPC.TL_messages_deleteMessages req6 = new TLRPC.TL_messages_deleteMessages();
req6.id = toSend;
req6.revoke = forAll;
NativeByteBuffer data3 = null;
try {
data3 = new NativeByteBuffer(req6.getObjectSize() + 8);
data3.writeInt32(7);
data3.writeInt32(channelId);
req6.serializeToStream(data3);
} catch (Exception e3) {
FileLog.e(e3);
}
newTaskId = getMessagesStorage().createPendingTask(data3);
req = req6;
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((28 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$deleteMessages$80$MessagesController(newTaskId, tLObject, tL_error);
}
});
}
public void lambda$deleteMessages$78$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((18 + 15) % 15 <= 0) {
}
if (error == null) {
TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates(updates, false);
}
if (newTaskId != 0) {
MessagesStorage.getInstance(this.currentAccount).removePendingTask(newTaskId);
}
}
public void lambda$deleteMessages$79$MessagesController(int channelId, long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((1 + 2) % 2 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewChannelDifferenceParams(res.pts, res.pts_count, channelId);
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void lambda$deleteMessages$80$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((9 + 2) % 2 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void pinMessage(TLRPC.Chat chat, TLRPC.User user, int id, boolean notify) {
if ((14 + 28) % 28 <= 0) {
}
if (chat == null && user == null) {
return;
}
TLRPC.TL_messages_updatePinnedMessage req = new TLRPC.TL_messages_updatePinnedMessage();
req.peer = getInputPeer(chat != null ? -chat.id : user.id);
req.id = id;
req.silent = !notify;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.uKmcjBCF7DUSt2LVOvIkBO18ioE(this));
}
public void lambda$pinMessage$81$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((17 + 10) % 10 <= 0) {
}
if (error == null) {
TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates(updates, false);
}
}
public void deleteUserChannelHistory(final TLRPC.Chat chat, final TLRPC.User user, int offset) {
if ((14 + 10) % 10 <= 0) {
}
if (offset == 0) {
getMessagesStorage().deleteUserChannelHistory(chat.id, user.id);
}
TLRPC.TL_channels_deleteUserHistory req = new TLRPC.TL_channels_deleteUserHistory();
req.channel = getInputChannel(chat);
req.user_id = getInputUser(user);
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((21 + 2) % 2 <= 0) {
}
MessagesController.this.lambda$deleteUserChannelHistory$82$MessagesController(chat, user, tLObject, tL_error);
}
});
}
public void lambda$deleteUserChannelHistory$82$MessagesController(TLRPC.Chat chat, TLRPC.User user, TLObject response, TLRPC.TL_error error) {
if ((13 + 29) % 29 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response;
if (res.offset > 0) {
deleteUserChannelHistory(chat, user, res.offset);
}
processNewChannelDifferenceParams(res.pts, res.pts_count, chat.id);
}
}
public ArrayList<TLRPC.Dialog> getAllDialogs() {
return this.allDialogs;
}
public boolean isDialogsEndReached(int folderId) {
return this.dialogsEndReached.get(folderId);
}
public boolean isLoadingDialogs(int folderId) {
return this.loadingDialogs.get(folderId);
}
public boolean isServerDialogsEndReached(int folderId) {
return this.serverDialogsEndReached.get(folderId);
}
public boolean hasHiddenArchive() {
if ((2 + 25) % 25 <= 0) {
}
return SharedConfig.archiveHidden && this.dialogs_dict.get(DialogObject.makeFolderDialogId(1)) != null;
}
public ArrayList<TLRPC.Dialog> getDialogs(int folderId) {
if ((20 + 22) % 22 <= 0) {
}
ArrayList<TLRPC.Dialog> dialogs = this.dialogsByFolder.get(folderId);
if (dialogs == null) {
return new ArrayList<>();
}
return dialogs;
}
private void removeDialog(TLRPC.Dialog dialog) {
if ((23 + 17) % 17 <= 0) {
}
if (dialog == null) {
return;
}
final long did = dialog.id;
if (this.dialogsServerOnly.remove(dialog) && DialogObject.isChannel(dialog)) {
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((7 + 12) % 12 <= 0) {
}
MessagesController.this.lambda$removeDialog$83$MessagesController(did);
}
});
}
this.allDialogs.remove(dialog);
this.dialogsCanAddUsers.remove(dialog);
this.dialogsChannelsOnly.remove(dialog);
this.dialogsGroupsOnly.remove(dialog);
this.dialogsUnreadOnly.remove(dialog);
this.dialogsUsersOnly.remove(dialog);
this.dialogsForward.remove(dialog);
this.dialogs_dict.remove(did);
this.dialogs_read_inbox_max.remove(Long.valueOf(did));
this.dialogs_read_outbox_max.remove(Long.valueOf(did));
ArrayList<TLRPC.Dialog> dialogs = this.dialogsByFolder.get(dialog.folder_id);
if (dialogs != null) {
dialogs.remove(dialog);
}
}
public void lambda$removeDialog$83$MessagesController(long did) {
if ((4 + 17) % 17 <= 0) {
}
this.channelsPts.delete(-((int) did));
this.shortPollChannels.delete(-((int) did));
this.needShortPollChannels.delete(-((int) did));
this.shortPollOnlines.delete(-((int) did));
this.needShortPollOnlines.delete(-((int) did));
}
public void deleteDialog(long did, int onlyHistory) {
deleteDialog(did, onlyHistory, false);
}
public void deleteDialog(long did, int onlyHistory, boolean revoke) {
if ((28 + 23) % 23 <= 0) {
}
deleteDialog(did, true, onlyHistory, 0, revoke, null, 0L);
}
public void setDialogsInTransaction(boolean transaction) {
if ((4 + 25) % 25 <= 0) {
}
this.dialogsInTransaction = transaction;
if (!transaction) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
}
}
protected void deleteDialog(final long r34, boolean r36, int r37, int r38, boolean r39, im.amwhusedvt.tgnet.TLRPC.InputPeer r40, long r41) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.deleteDialog(long, boolean, int, int, boolean, im.amwhusedvt.tgnet.TLRPC$InputPeer, long):void");
}
public void lambda$deleteDialog$85$MessagesController(long did) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.vpoVU_xpYj6gw2YdP1Zr3a7M-sk(this, did));
}
public void lambda$null$84$MessagesController(long did) {
getNotificationsController().removeNotificationsForDialog(did);
}
public void lambda$deleteDialog$87$MessagesController(long newTaskId, long did, TLObject response, TLRPC.TL_error error) {
if ((21 + 26) % 26 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.SIG9ehof6m2TMs8wquiC0NpggJs(this, did));
}
public void lambda$null$86$MessagesController(long did) {
this.deletedHistory.remove(did);
}
public void lambda$deleteDialog$88$MessagesController(long newTaskId, long did, int onlyHistory, int max_id_delete_final, boolean revoke, TLRPC.InputPeer peerFinal, TLObject response, TLRPC.TL_error error) {
if ((1 + 22) % 22 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
if (error == null) {
TLRPC.TL_messages_affectedHistory res = (TLRPC.TL_messages_affectedHistory) response;
if (res.offset > 0) {
deleteDialog(did, false, onlyHistory, max_id_delete_final, revoke, peerFinal, 0L);
}
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
getMessagesStorage().onDeleteQueryComplete(did);
}
}
public void saveGif(final Object parentObject, TLRPC.Document document) {
if ((22 + 3) % 3 <= 0) {
}
if (parentObject == null || !MessageObject.isGifDocument(document)) {
return;
}
final TLRPC.TL_messages_saveGif req = new TLRPC.TL_messages_saveGif();
req.id = new TLRPC.TL_inputDocument();
req.id.id = document.id;
req.id.access_hash = document.access_hash;
req.id.file_reference = document.file_reference;
if (req.id.file_reference == null) {
req.id.file_reference = new byte[0];
}
req.unsave = false;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((7 + 18) % 18 <= 0) {
}
MessagesController.this.lambda$saveGif$89$MessagesController(parentObject, req, tLObject, tL_error);
}
});
}
public void lambda$saveGif$89$MessagesController(Object parentObject, TLRPC.TL_messages_saveGif req, TLObject response, TLRPC.TL_error error) {
if ((22 + 10) % 10 <= 0) {
}
if (error != null && FileRefController.isFileRefError(error.text) && parentObject != null) {
getFileRefController().requestReference(parentObject, req);
}
}
public void saveRecentSticker(Object parentObject, TLRPC.Document document, boolean asMask) {
if ((25 + 30) % 30 <= 0) {
}
if (parentObject == null || document == null) {
return;
}
TLRPC.TL_messages_saveRecentSticker req = new TLRPC.TL_messages_saveRecentSticker();
req.id = new TLRPC.TL_inputDocument();
req.id.id = document.id;
req.id.access_hash = document.access_hash;
req.id.file_reference = document.file_reference;
if (req.id.file_reference == null) {
req.id.file_reference = new byte[0];
}
req.unsave = false;
req.attached = asMask;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.OY1ygqb06c5-kMQnykTpUiTdlfQ(this, parentObject, req));
}
public void lambda$saveRecentSticker$90$MessagesController(Object parentObject, TLRPC.TL_messages_saveRecentSticker req, TLObject response, TLRPC.TL_error error) {
if ((32 + 14) % 14 <= 0) {
}
if (error != null && FileRefController.isFileRefError(error.text) && parentObject != null) {
getFileRefController().requestReference(parentObject, req);
}
}
public void loadChannelParticipants(Integer chat_id) {
if ((2 + 10) % 10 <= 0) {
}
if (this.loadingFullParticipants.contains(chat_id) || this.loadedFullParticipants.contains(chat_id)) {
return;
}
this.loadingFullParticipants.add(chat_id);
TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
req.channel = getInputChannel(chat_id.intValue());
req.filter = new TLRPC.TL_channelParticipantsRecent();
req.offset = 0;
req.limit = 32;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.7aBJuK8z50tAgFiF8hhPQ8EUJzI(this, chat_id));
}
public void lambda$loadChannelParticipants$92$MessagesController(Integer chat_id, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.EPSu1JPGRQJPS24wuwa4JNUgVCI(this, error, response, chat_id));
}
public void lambda$null$91$MessagesController(TLRPC.TL_error error, TLObject response, Integer chat_id) {
if ((15 + 28) % 28 <= 0) {
}
if (error == null && (response instanceof TLRPC.TL_channels_channelParticipants)) {
TLRPC.TL_channels_channelParticipants res = (TLRPC.TL_channels_channelParticipants) response;
putUsers(res.users, false);
getMessagesStorage().putUsersAndChats(res.users, (ArrayList) null, true, true);
getMessagesStorage().updateChannelUsers(chat_id.intValue(), res.participants);
this.loadedFullParticipants.add(chat_id);
}
this.loadingFullParticipants.remove(chat_id);
}
public void processChatInfo(final int chat_id, final TLRPC.ChatFull info, final ArrayList<TLRPC.User> usersArr, final boolean fromCache, final boolean force, final boolean byChannelUsers, final MessageObject pinnedMessageObject) {
if ((7 + 2) % 2 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((13 + 18) % 18 <= 0) {
}
MessagesController.this.lambda$processChatInfo$93$MessagesController(fromCache, chat_id, byChannelUsers, force, info, usersArr, pinnedMessageObject);
}
});
}
public void lambda$processChatInfo$93$MessagesController(boolean fromCache, int chat_id, boolean byChannelUsers, boolean force, TLRPC.ChatFull info, ArrayList usersArr, MessageObject pinnedMessageObject) {
if ((13 + 15) % 15 <= 0) {
}
if (fromCache && chat_id > 0 && !byChannelUsers) {
loadFullChat(chat_id, 0, force);
}
if (info != null) {
if (this.fullChats.get(chat_id) == null) {
this.fullChats.put(chat_id, info);
}
putUsers(usersArr, fromCache);
if (info.stickerset != null) {
getMediaDataController().getGroupStickerSetById(info.stickerset);
}
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, info, 0, Boolean.valueOf(byChannelUsers), pinnedMessageObject);
}
}
public void loadUserInfo(TLRPC.User user, boolean force, int classGuid) {
getMessagesStorage().loadUserInfo(user, force, classGuid);
}
public void processUserInfo(TLRPC.User user, TLRPC.UserFull info, boolean fromCache, boolean force, MessageObject pinnedMessageObject, int classGuid) {
if ((3 + 5) % 5 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.LLev-_gwQk5zdncQJZhEpOdEmU0(this, fromCache, user, classGuid, force, info, pinnedMessageObject));
}
public void lambda$processUserInfo$94$MessagesController(boolean fromCache, TLRPC.User user, int classGuid, boolean force, TLRPC.UserFull info, MessageObject pinnedMessageObject) {
if ((24 + 13) % 13 <= 0) {
}
if (fromCache) {
loadFullUser(user, classGuid, force);
}
if (info != null) {
if (this.fullUsers.get(user.id) == null) {
this.fullUsers.put(user.id, info);
if (info.blocked) {
this.blockedUsers.put(user.id, 1);
} else {
this.blockedUsers.delete(user.id);
}
}
getNotificationCenter().postNotificationName(NotificationCenter.userFullInfoDidLoad, Integer.valueOf(user.id), info, pinnedMessageObject);
}
}
public void updateTimerProc() {
int timeToRemove;
if ((18 + 29) % 29 <= 0) {
}
long currentTime = System.currentTimeMillis();
checkDeletingTask(false);
checkReadTasks();
if (getUserConfig().isClientActivated()) {
if (getConnectionsManager().getPauseTime() == 0 && ApplicationLoader.isScreenOn && !ApplicationLoader.mainInterfacePausedStageQueue) {
if (ApplicationLoader.mainInterfacePausedStageQueueTime != 0 && Math.abs(ApplicationLoader.mainInterfacePausedStageQueueTime - System.currentTimeMillis()) > 1000 && this.statusSettingState != 1 && (this.lastStatusUpdateTime == 0 || Math.abs(System.currentTimeMillis() - this.lastStatusUpdateTime) >= 55000 || this.offlineSent)) {
this.statusSettingState = 1;
if (this.statusRequest != 0) {
getConnectionsManager().cancelRequest(this.statusRequest, true);
}
TLRPC.TL_account_updateStatus req = new TLRPC.TL_account_updateStatus();
req.offline = false;
this.statusRequest = getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$updateTimerProc$95$MessagesController(tLObject, tL_error);
}
});
}
} else if (this.statusSettingState != 2 && !this.offlineSent && Math.abs(System.currentTimeMillis() - getConnectionsManager().getPauseTime()) >= 2000) {
this.statusSettingState = 2;
if (this.statusRequest != 0) {
getConnectionsManager().cancelRequest(this.statusRequest, true);
}
TLRPC.TL_account_updateStatus req2 = new TLRPC.TL_account_updateStatus();
req2.offline = true;
this.statusRequest = getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$updateTimerProc$96$MessagesController(tLObject, tL_error);
}
});
}
if (this.updatesQueueChannels.size() != 0) {
for (int a = 0; a < this.updatesQueueChannels.size(); a++) {
int key = this.updatesQueueChannels.keyAt(a);
long updatesStartWaitTime = this.updatesStartWaitTimeChannels.valueAt(a);
if (updatesStartWaitTime + 1500 < currentTime) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("QUEUE CHANNEL " + key + " UPDATES WAIT TIMEOUT - CHECK QUEUE");
}
processChannelsUpdatesQueue(key, 0);
}
}
}
for (int a2 = 0; a2 < 3; a2++) {
if (getUpdatesStartTime(a2) != 0 && getUpdatesStartTime(a2) + 1500 < currentTime) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d(a2 + " QUEUE UPDATES WAIT TIMEOUT - CHECK QUEUE");
}
processUpdatesQueue(a2, 0);
}
}
}
if (Math.abs(System.currentTimeMillis() - this.lastViewsCheckTime) >= 5000) {
this.lastViewsCheckTime = System.currentTimeMillis();
if (this.channelViewsToSend.size() != 0) {
int a3 = 0;
while (a3 < this.channelViewsToSend.size()) {
final int key2 = this.channelViewsToSend.keyAt(a3);
final TLRPC.TL_messages_getMessagesViews req3 = new TLRPC.TL_messages_getMessagesViews();
req3.peer = getInputPeer(key2);
req3.id = this.channelViewsToSend.valueAt(a3);
req3.increment = a3 == 0;
getConnectionsManager().sendRequest(req3, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((30 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$updateTimerProc$98$MessagesController(key2, req3, tLObject, tL_error);
}
});
a3++;
}
this.channelViewsToSend.clear();
}
if (this.pollsToCheckSize > 0) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.6K4UjQrZh4Cyo_1ORJ_06OfzXLQ(this));
}
}
if (!this.onlinePrivacy.isEmpty()) {
ArrayList<Integer> toRemove = null;
int currentServerTime = getConnectionsManager().getCurrentTime();
for (Map.Entry<Integer, Integer> entry : this.onlinePrivacy.entrySet()) {
if (entry.getValue().intValue() < currentServerTime - 30) {
if (toRemove == null) {
toRemove = new ArrayList<>();
}
toRemove.add(entry.getKey());
}
}
if (toRemove != null) {
Iterator<Integer> it = toRemove.iterator();
while (it.hasNext()) {
Integer uid = it.next();
this.onlinePrivacy.remove(uid);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$updateTimerProc$101$MessagesController();
}
});
}
}
if (this.shortPollChannels.size() != 0) {
int a4 = 0;
while (a4 < this.shortPollChannels.size()) {
int key3 = this.shortPollChannels.keyAt(a4);
int timeout = this.shortPollChannels.valueAt(a4);
if (timeout < System.currentTimeMillis() / 1000) {
this.shortPollChannels.delete(key3);
a4--;
if (this.needShortPollChannels.indexOfKey(key3) >= 0) {
getChannelDifference(key3);
}
}
a4++;
}
}
if (this.shortPollOnlines.size() != 0) {
long time = SystemClock.uptimeMillis() / 1000;
int a5 = 0;
while (a5 < this.shortPollOnlines.size()) {
final int key4 = this.shortPollOnlines.keyAt(a5);
int timeout2 = this.shortPollOnlines.valueAt(a5);
if (timeout2 < time) {
if (this.needShortPollChannels.indexOfKey(key4) >= 0) {
this.shortPollOnlines.put(key4, (int) (300 + time));
} else {
this.shortPollOnlines.delete(key4);
a5--;
}
TLRPC.TL_messages_getOnlines req4 = new TLRPC.TL_messages_getOnlines();
req4.peer = getInputPeer(-key4);
getConnectionsManager().sendRequest(req4, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((9 + 12) % 12 <= 0) {
}
MessagesController.this.lambda$updateTimerProc$103$MessagesController(key4, tLObject, tL_error);
}
});
}
a5++;
}
}
if (!this.printingUsers.isEmpty() || this.lastPrintingStringCount != this.printingUsers.size()) {
boolean updated = false;
ArrayList<Long> keys = new ArrayList<>(this.printingUsers.keySet());
int b = 0;
while (b < keys.size()) {
long key5 = keys.get(b).longValue();
ArrayList<PrintingUser> arr = this.printingUsers.get(Long.valueOf(key5));
if (arr != null) {
int a6 = 0;
while (a6 < arr.size()) {
PrintingUser user = arr.get(a6);
if (user.action instanceof TLRPC.TL_sendMessageGamePlayAction) {
timeToRemove = 30000;
} else {
timeToRemove = 5900;
}
boolean updated2 = updated;
if (user.lastTime + timeToRemove >= currentTime) {
updated = updated2;
} else {
arr.remove(user);
a6--;
updated = true;
}
a6++;
}
}
if (arr == null || arr.isEmpty()) {
this.printingUsers.remove(Long.valueOf(key5));
keys.remove(b);
b--;
}
b++;
}
updatePrintingStrings();
if (updated) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$updateTimerProc$104$MessagesController();
}
});
}
}
if (Theme.selectedAutoNightType == 1 && Math.abs(currentTime - lastThemeCheckTime) >= 60) {
AndroidUtilities.runOnUIThread(this.themeCheckRunnable);
lastThemeCheckTime = currentTime;
}
if (getUserConfig().savedPasswordHash != null && Math.abs(currentTime - lastPasswordCheckTime) >= 60) {
AndroidUtilities.runOnUIThread(this.passwordCheckRunnable);
lastPasswordCheckTime = currentTime;
}
if (this.lastPushRegisterSendTime != 0 && Math.abs(SystemClock.elapsedRealtime() - this.lastPushRegisterSendTime) >= 10800000) {
GcmPushListenerService.sendRegistrationToServer(SharedConfig.pushString);
}
getLocationController().update();
lambda$checkProxyInfo$107$MessagesController(false);
checkTosUpdate();
}
public void lambda$updateTimerProc$95$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((13 + 11) % 11 <= 0) {
}
if (error == null) {
this.lastStatusUpdateTime = System.currentTimeMillis();
this.offlineSent = false;
this.statusSettingState = 0;
} else {
long j = this.lastStatusUpdateTime;
if (j != 0) {
this.lastStatusUpdateTime = j + 5000;
}
}
this.statusRequest = 0;
}
public void lambda$updateTimerProc$96$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((3 + 19) % 19 <= 0) {
}
if (error == null) {
this.offlineSent = true;
} else {
long j = this.lastStatusUpdateTime;
if (j != 0) {
this.lastStatusUpdateTime = j + 5000;
}
}
this.statusRequest = 0;
}
public void lambda$updateTimerProc$98$MessagesController(int key, TLRPC.TL_messages_getMessagesViews req, TLObject response, TLRPC.TL_error error) {
if ((23 + 17) % 17 <= 0) {
}
if (response != null) {
TLRPC.Vector vector = (TLRPC.Vector) response;
final SparseArray<SparseIntArray> channelViews = new SparseArray<>();
SparseIntArray array = channelViews.get(key);
if (array == null) {
array = new SparseIntArray();
channelViews.put(key, array);
}
for (int a1 = 0; a1 < req.id.size() && a1 < vector.objects.size(); a1++) {
array.put(((Integer) req.id.get(a1)).intValue(), ((Integer) vector.objects.get(a1)).intValue());
}
getMessagesStorage().putChannelViews(channelViews, req.peer instanceof TLRPC.TL_inputPeerChannel);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((19 + 27) % 27 <= 0) {
}
MessagesController.this.lambda$null$97$MessagesController(channelViews);
}
});
}
}
public void lambda$null$97$MessagesController(SparseArray channelViews) {
if ((17 + 2) % 2 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.didUpdatedMessagesViews, channelViews);
}
public void lambda$updateTimerProc$100$MessagesController() {
if ((21 + 4) % 4 <= 0) {
}
long time = SystemClock.uptimeMillis();
int a = 0;
int N = this.pollsToCheck.size();
while (a < N) {
SparseArray<MessageObject> array = this.pollsToCheck.valueAt(a);
if (array != null) {
int b = 0;
int N2 = array.size();
while (b < N2) {
MessageObject messageObject = array.valueAt(b);
if (Math.abs(time - messageObject.pollLastCheckTime) < 30000) {
if (!messageObject.pollVisibleOnScreen) {
array.remove(messageObject.getId());
N2--;
b--;
}
} else {
messageObject.pollLastCheckTime = time;
TLRPC.TL_messages_getPollResults req = new TLRPC.TL_messages_getPollResults();
req.peer = getInputPeer((int) messageObject.getDialogId());
req.msg_id = messageObject.getId();
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.EtDrfxxItANEUXQC6lFqIbYi2K4(this));
}
b++;
}
int b2 = array.size();
if (b2 == 0) {
LongSparseArray<SparseArray<MessageObject>> longSparseArray = this.pollsToCheck;
longSparseArray.remove(longSparseArray.keyAt(a));
N--;
a--;
}
}
a++;
}
this.pollsToCheckSize = this.pollsToCheck.size();
}
public void lambda$null$99$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((28 + 7) % 7 <= 0) {
}
if (error == null) {
processUpdates((TLRPC.Updates) response, false);
}
}
public void lambda$updateTimerProc$101$MessagesController() {
if ((10 + 32) % 32 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 4);
}
public void lambda$updateTimerProc$103$MessagesController(int key, TLObject response, TLRPC.TL_error error) {
if ((30 + 3) % 3 <= 0) {
}
if (response != null) {
TLRPC.TL_chatOnlines res = (TLRPC.TL_chatOnlines) response;
getMessagesStorage().updateChatOnlineCount(key, res.onlines);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.LF4vNwZp0SPkp_Q-dspeGIqFHy4(this, key, res));
}
}
public void lambda$null$102$MessagesController(int key, TLRPC.TL_chatOnlines res) {
if ((24 + 19) % 19 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.chatOnlineCountDidLoad, Integer.valueOf(key), Integer.valueOf(res.onlines));
}
public void lambda$updateTimerProc$104$MessagesController() {
if ((17 + 29) % 29 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 64);
}
private void checkTosUpdate() {
if ((28 + 5) % 5 <= 0) {
}
if (this.nextTosCheckTime > getConnectionsManager().getCurrentTime() || this.checkingTosUpdate || !getUserConfig().isClientActivated()) {
return;
}
this.checkingTosUpdate = true;
TLRPC.TL_help_getTermsOfServiceUpdate req = new TLRPC.TL_help_getTermsOfServiceUpdate();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$checkTosUpdate$106$MessagesController(tLObject, tL_error);
}
});
}
public void lambda$checkTosUpdate$106$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((13 + 27) % 27 <= 0) {
}
this.checkingTosUpdate = false;
if (response instanceof TLRPC.TL_help_termsOfServiceUpdateEmpty) {
this.nextTosCheckTime = ((TLRPC.TL_help_termsOfServiceUpdateEmpty) response).expires;
} else if (response instanceof TLRPC.TL_help_termsOfServiceUpdate) {
final TLRPC.TL_help_termsOfServiceUpdate res = (TLRPC.TL_help_termsOfServiceUpdate) response;
this.nextTosCheckTime = res.expires;
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((11 + 27) % 27 <= 0) {
}
MessagesController.this.lambda$null$105$MessagesController(res);
}
});
} else {
this.nextTosCheckTime = getConnectionsManager().getCurrentTime() + 3600;
}
this.notificationsPreferences.edit().putInt("nextTosCheckTime", this.nextTosCheckTime).commit();
}
public void lambda$null$105$MessagesController(TLRPC.TL_help_termsOfServiceUpdate res) {
if ((27 + 19) % 19 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.needShowAlert, 4, res.terms_of_service);
}
public void checkProxyInfo(final boolean reset) {
if ((31 + 14) % 14 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((19 + 30) % 30 <= 0) {
}
MessagesController.this.lambda$checkProxyInfo$107$MessagesController(reset);
}
});
}
public void lambda$checkProxyInfo$107$MessagesController(boolean reset) {
String str;
if ((26 + 21) % 21 <= 0) {
}
if (reset && this.checkingProxyInfo) {
this.checkingProxyInfo = false;
}
if ((!reset && this.nextProxyInfoCheckTime > getConnectionsManager().getCurrentTime()) || this.checkingProxyInfo) {
return;
}
if (this.checkingProxyInfoRequestId != 0) {
getConnectionsManager().cancelRequest(this.checkingProxyInfoRequestId, true);
this.checkingProxyInfoRequestId = 0;
}
SharedPreferences preferences = getGlobalMainSettings();
boolean enabled = preferences.getBoolean("proxy_enabled", false);
String proxyAddress = preferences.getString("proxy_ip", "");
String proxySecret = preferences.getString("proxy_secret", "");
int removeCurrent = 0;
if (this.proxyDialogId != 0 && (str = this.proxyDialogAddress) != null) {
if (!str.equals(proxyAddress + proxySecret)) {
removeCurrent = 1;
}
}
this.lastCheckProxyId++;
if (enabled && !TextUtils.isEmpty(proxyAddress) && !TextUtils.isEmpty(proxySecret)) {
this.checkingProxyInfo = true;
int checkProxyId = this.lastCheckProxyId;
TLRPC.TL_help_getProxyData req = new TLRPC.TL_help_getProxyData();
this.checkingProxyInfoRequestId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.W7-CFSdNAcM7Me0wEMs7UOpU0Gg(this, checkProxyId, proxyAddress, proxySecret));
} else {
removeCurrent = 2;
}
if (removeCurrent != 0) {
this.proxyDialogId = 0L;
this.proxyDialogAddress = null;
getGlobalMainSettings().edit().putLong("proxy_dialog", this.proxyDialogId).remove("proxyDialogAddress").commit();
this.nextProxyInfoCheckTime = getConnectionsManager().getCurrentTime() + 3600;
if (removeCurrent == 2) {
this.checkingProxyInfo = false;
if (this.checkingProxyInfoRequestId != 0) {
getConnectionsManager().cancelRequest(this.checkingProxyInfoRequestId, true);
this.checkingProxyInfoRequestId = 0;
}
}
AndroidUtilities.runOnUIThread(new $$Lambda$MessagesController$N7j1Rc052E3HIAQ5oadf29XcLk(this));
}
}
public void lambda$checkProxyInfoInternal$112$MessagesController(int checkProxyId, String proxyAddress, String proxySecret, TLObject response, TLRPC.TL_error error) {
boolean noDialog;
boolean noDialog2;
long did;
if ((23 + 2) % 2 <= 0) {
}
if (checkProxyId != this.lastCheckProxyId) {
return;
}
boolean noDialog3 = false;
if (response instanceof TLRPC.TL_help_proxyDataEmpty) {
this.nextProxyInfoCheckTime = ((TLRPC.TL_help_proxyDataEmpty) response).expires;
noDialog = true;
} else if (!(response instanceof TLRPC.TL_help_proxyDataPromo)) {
this.nextProxyInfoCheckTime = getConnectionsManager().getCurrentTime() + 3600;
noDialog = true;
} else {
TLRPC.TL_help_proxyDataPromo res = (TLRPC.TL_help_proxyDataPromo) response;
if (res.peer.user_id != 0) {
noDialog2 = false;
did = res.peer.user_id;
} else if (res.peer.chat_id != 0) {
long did2 = -res.peer.chat_id;
int a = 0;
while (true) {
if (a >= res.chats.size()) {
break;
}
TLRPC.Chat chat = (TLRPC.Chat) res.chats.get(a);
if (chat.id != res.peer.chat_id) {
a++;
} else if (chat.kicked || chat.restricted) {
noDialog3 = true;
}
}
noDialog2 = noDialog3;
did = did2;
} else {
long did3 = -res.peer.channel_id;
int a2 = 0;
while (true) {
if (a2 >= res.chats.size()) {
break;
}
TLRPC.Chat chat2 = (TLRPC.Chat) res.chats.get(a2);
if (chat2.id != res.peer.channel_id) {
a2++;
} else if (chat2.kicked || chat2.restricted) {
noDialog2 = true;
did = did3;
}
}
noDialog2 = false;
did = did3;
}
this.proxyDialogId = did;
this.proxyDialogAddress = proxyAddress + proxySecret;
getGlobalMainSettings().edit().putLong("proxy_dialog", this.proxyDialogId).putString("proxyDialogAddress", this.proxyDialogAddress).commit();
this.nextProxyInfoCheckTime = res.expires;
if (!noDialog2) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.4kyMlc-2AeufEirzzY1N6lD41ok(this, did, res, checkProxyId));
}
noDialog = noDialog2;
}
if (noDialog) {
this.proxyDialogId = 0L;
getGlobalMainSettings().edit().putLong("proxy_dialog", this.proxyDialogId).remove("proxyDialogAddress").commit();
this.checkingProxyInfoRequestId = 0;
this.checkingProxyInfo = false;
AndroidUtilities.runOnUIThread(new $$Lambda$MessagesController$N7j1Rc052E3HIAQ5oadf29XcLk(this));
}
}
public void lambda$null$111$MessagesController(long did, TLRPC.TL_help_proxyDataPromo res, int checkProxyId) {
if ((14 + 11) % 11 <= 0) {
}
TLRPC.Dialog dialog = this.proxyDialog;
if (dialog != null && did != dialog.id) {
removeProxyDialog();
}
TLRPC.Dialog dialog2 = this.dialogs_dict.get(did);
this.proxyDialog = dialog2;
if (dialog2 != null) {
this.checkingProxyInfo = false;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
return;
}
SparseArray<TLRPC.User> usersDict = new SparseArray<>();
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
for (int a = 0; a < res.users.size(); a++) {
TLRPC.User u = (TLRPC.User) res.users.get(a);
usersDict.put(u.id, u);
}
for (int a2 = 0; a2 < res.chats.size(); a2++) {
TLRPC.Chat c = (TLRPC.Chat) res.chats.get(a2);
chatsDict.put(c.id, c);
}
TLRPC.TL_messages_getPeerDialogs req1 = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer peer = new TLRPC.TL_inputDialogPeer();
if (res.peer.user_id != 0) {
peer.peer = new TLRPC.TL_inputPeerUser();
peer.peer.user_id = res.peer.user_id;
TLRPC.User user = usersDict.get(res.peer.user_id);
if (user != null) {
peer.peer.access_hash = user.access_hash;
}
} else if (res.peer.chat_id != 0) {
peer.peer = new TLRPC.TL_inputPeerChat();
peer.peer.chat_id = res.peer.chat_id;
TLRPC.Chat chat = chatsDict.get(res.peer.chat_id);
if (chat != null) {
peer.peer.access_hash = chat.access_hash;
}
} else {
peer.peer = new TLRPC.TL_inputPeerChannel();
peer.peer.channel_id = res.peer.channel_id;
TLRPC.Chat chat2 = chatsDict.get(res.peer.channel_id);
if (chat2 != null) {
peer.peer.access_hash = chat2.access_hash;
}
}
req1.peers.add(peer);
this.checkingProxyInfoRequestId = getConnectionsManager().sendRequest(req1, new -$.Lambda.MessagesController.a4xqVvcMMnWkxj1iQcYQkrr3K4o(this, checkProxyId, res, did));
}
public void lambda$null$110$MessagesController(int checkProxyId, final TLRPC.TL_help_proxyDataPromo res, final long did, TLObject response1, TLRPC.TL_error error1) {
if ((14 + 24) % 24 <= 0) {
}
if (checkProxyId == this.lastCheckProxyId) {
this.checkingProxyInfoRequestId = 0;
final TLRPC.TL_messages_peerDialogs res2 = (TLRPC.TL_messages_peerDialogs) response1;
if (res2 != null && !res2.dialogs.isEmpty()) {
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
dialogs.chats = res2.chats;
dialogs.users = res2.users;
dialogs.dialogs = res2.dialogs;
dialogs.messages = res2.messages;
getMessagesStorage().putDialogs(dialogs, 2);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((16 + 25) % 25 <= 0) {
}
MessagesController.this.lambda$null$108$MessagesController(res, res2, did);
}
});
} else {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.imoBVhbiMkWwA7ltUhGm3wihPSQ(this));
}
this.checkingProxyInfo = false;
}
}
public void lambda$null$108$MessagesController(TLRPC.TL_help_proxyDataPromo res, TLRPC.TL_messages_peerDialogs res2, long did) {
if ((23 + 6) % 6 <= 0) {
}
putUsers(res.users, false);
putChats(res.chats, false);
putUsers(res2.users, false);
putChats(res2.chats, false);
TLRPC.Dialog dialog = this.proxyDialog;
if (dialog != null) {
int lowerId = (int) dialog.id;
if (lowerId < 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-lowerId));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
removeDialog(this.proxyDialog);
}
} else {
removeDialog(this.proxyDialog);
}
}
TLRPC.Dialog dialog2 = (TLRPC.Dialog) res2.dialogs.get(0);
this.proxyDialog = dialog2;
dialog2.id = did;
this.proxyDialog.folder_id = 0;
if (DialogObject.isChannel(this.proxyDialog)) {
this.channelsPts.put(-((int) this.proxyDialog.id), this.proxyDialog.pts);
}
Integer value = this.dialogs_read_inbox_max.get(Long.valueOf(this.proxyDialog.id));
if (value == null) {
value = 0;
}
this.dialogs_read_inbox_max.put(Long.valueOf(this.proxyDialog.id), Integer.valueOf(Math.max(value.intValue(), this.proxyDialog.read_inbox_max_id)));
Integer value2 = this.dialogs_read_outbox_max.get(Long.valueOf(this.proxyDialog.id));
if (value2 == null) {
value2 = 0;
}
this.dialogs_read_outbox_max.put(Long.valueOf(this.proxyDialog.id), Integer.valueOf(Math.max(value2.intValue(), this.proxyDialog.read_outbox_max_id)));
this.dialogs_dict.put(did, this.proxyDialog);
if (!res2.messages.isEmpty()) {
SparseArray<TLRPC.User> usersDict1 = new SparseArray<>();
SparseArray<TLRPC.Chat> chatsDict1 = new SparseArray<>();
for (int a = 0; a < res2.users.size(); a++) {
TLRPC.User u = (TLRPC.User) res2.users.get(a);
usersDict1.put(u.id, u);
}
for (int a2 = 0; a2 < res2.chats.size(); a2++) {
TLRPC.Chat c = (TLRPC.Chat) res2.chats.get(a2);
chatsDict1.put(c.id, c);
}
MessageObject messageObject = new MessageObject(this.currentAccount, (TLRPC.Message) res2.messages.get(0), usersDict1, chatsDict1, false);
this.dialogMessage.put(did, messageObject);
if (this.proxyDialog.last_message_date == 0) {
this.proxyDialog.last_message_date = messageObject.messageOwner.date;
}
}
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
}
public void lambda$null$109$MessagesController() {
if ((21 + 27) % 27 <= 0) {
}
TLRPC.Dialog dialog = this.proxyDialog;
if (dialog != null) {
int lowerId = (int) dialog.id;
if (lowerId < 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-lowerId));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
removeDialog(this.proxyDialog);
}
} else {
removeDialog(this.proxyDialog);
}
this.proxyDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
public void removeProxyDialog() {
if ((5 + 1) % 1 <= 0) {
}
TLRPC.Dialog dialog = this.proxyDialog;
if (dialog == null) {
return;
}
int lowerId = (int) dialog.id;
if (lowerId < 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-lowerId));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
removeDialog(this.proxyDialog);
}
} else {
removeDialog(this.proxyDialog);
}
this.proxyDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public boolean isProxyDialog(long did, boolean checkLeft) {
if ((18 + 8) % 8 <= 0) {
}
TLRPC.Dialog dialog = this.proxyDialog;
return dialog != null && dialog.id == did && (!checkLeft || this.isLeftProxyChannel);
}
private String getUserNameForTyping(TLRPC.User user) {
if ((14 + 8) % 8 <= 0) {
}
if (user == null) {
return "";
}
if (user.first_name != null && user.first_name.length() > 0) {
return user.first_name;
}
if (user.last_name == null || user.last_name.length() <= 0) {
return "";
}
return user.last_name;
}
private void updatePrintingStrings() {
int i;
char c;
int i2;
int i3;
if ((6 + 5) % 5 <= 0) {
}
LongSparseArray<CharSequence> newPrintingStrings = new LongSparseArray<>();
LongSparseArray<Integer> newPrintingStringsTypes = new LongSparseArray<>();
for (Map.Entry<Long, ArrayList<PrintingUser>> entry : this.printingUsers.entrySet()) {
long key = entry.getKey().longValue();
ArrayList<PrintingUser> arr = entry.getValue();
int lower_id = (int) key;
if (lower_id > 0 || lower_id == 0) {
i = 0;
} else if (arr.size() == 1) {
i = 0;
} else {
int count = 0;
StringBuilder label = new StringBuilder();
Iterator<PrintingUser> it = arr.iterator();
while (it.hasNext()) {
TLRPC.User user = getUser(Integer.valueOf(it.next().userId));
if (user != null) {
if (label.length() != 0) {
label.append(", ");
}
label.append(getUserNameForTyping(user));
count++;
}
if (count == 2) {
break;
}
}
if (label.length() != 0) {
if (count == 1) {
newPrintingStrings.put(key, LocaleController.formatString("IsTypingGroup", 2131691719, new Object[]{label.toString()}));
i3 = 0;
} else if (arr.size() > 2) {
String plural = LocaleController.getPluralString("AndMoreTypingGroup", arr.size() - 2);
try {
newPrintingStrings.put(key, String.format(plural, label.toString(), Integer.valueOf(arr.size() - 2)));
} catch (Exception e) {
newPrintingStrings.put(key, "LOC_ERR: AndMoreTypingGroup");
}
i3 = 0;
} else {
i3 = 0;
newPrintingStrings.put(key, LocaleController.formatString("AreTypingGroup", 2131689883, new Object[]{label.toString()}));
}
newPrintingStringsTypes.put(key, Integer.valueOf(i3));
}
}
PrintingUser pu = arr.get(i);
TLRPC.User user2 = getUser(Integer.valueOf(pu.userId));
if (user2 != null) {
if (pu.action instanceof TLRPC.TL_sendMessageRecordAudioAction) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsRecordingAudio", 2131691711, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("RecordingAudio", 2131693340));
}
newPrintingStringsTypes.put(key, 1);
} else if ((pu.action instanceof TLRPC.TL_sendMessageRecordRoundAction) || (pu.action instanceof TLRPC.TL_sendMessageUploadRoundAction)) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsRecordingRound", 2131691712, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("RecordingRound", 2131693341));
}
newPrintingStringsTypes.put(key, 4);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadAudioAction) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsSendingAudio", 2131691713, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("SendingAudio", 2131693843));
}
newPrintingStringsTypes.put(key, 2);
} else {
if (pu.action instanceof TLRPC.TL_sendMessageUploadVideoAction) {
c = 0;
} else if (pu.action instanceof TLRPC.TL_sendMessageRecordVideoAction) {
c = 0;
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadDocumentAction) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsSendingFile", 2131691714, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("SendingFile", 2131693844));
}
newPrintingStringsTypes.put(key, 2);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadPhotoAction) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsSendingPhoto", 2131691716, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("SendingPhoto", 2131693847));
}
newPrintingStringsTypes.put(key, 2);
} else if (pu.action instanceof TLRPC.TL_sendMessageGamePlayAction) {
if (lower_id < 0) {
newPrintingStrings.put(key, LocaleController.formatString("IsSendingGame", 2131691715, new Object[]{getUserNameForTyping(user2)}));
} else {
newPrintingStrings.put(key, LocaleController.getString("SendingGame", 2131693845));
}
newPrintingStringsTypes.put(key, 3);
} else {
if (lower_id < 0) {
i2 = 0;
newPrintingStrings.put(key, LocaleController.formatString("IsTypingGroup", 2131691719, new Object[]{getUserNameForTyping(user2)}));
} else {
i2 = 0;
newPrintingStrings.put(key, LocaleController.getString("Typing", 2131694452));
}
newPrintingStringsTypes.put(key, Integer.valueOf(i2));
}
if (lower_id < 0) {
Object[] objArr = new Object[1];
objArr[c] = getUserNameForTyping(user2);
newPrintingStrings.put(key, LocaleController.formatString("IsSendingVideo", 2131691717, objArr));
} else {
newPrintingStrings.put(key, LocaleController.getString("SendingVideoStatus", 2131693850));
}
newPrintingStringsTypes.put(key, 2);
}
}
}
this.lastPrintingStringCount = newPrintingStrings.size();
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.kfk5KaWLPNYznAh09i7VAEsLcBU(this, newPrintingStrings, newPrintingStringsTypes));
}
public void lambda$updatePrintingStrings$113$MessagesController(LongSparseArray newPrintingStrings, LongSparseArray newPrintingStringsTypes) {
this.printingStrings = newPrintingStrings;
this.printingStringsTypes = newPrintingStringsTypes;
}
public void cancelTyping(int action, long dialog_id) {
LongSparseArray<Boolean> typings = this.sendingTypings.get(action);
if (typings != null) {
typings.remove(dialog_id);
}
}
public void sendTyping(long dialog_id, int action, int classGuid) {
TLRPC.Chat chat;
if ((13 + 8) % 8 <= 0) {
}
if (dialog_id == 0) {
return;
}
LongSparseArray<Boolean> typings = this.sendingTypings.get(action);
if (typings != null && typings.get(dialog_id) != null) {
return;
}
if (typings == null) {
typings = new LongSparseArray<>();
this.sendingTypings.put(action, typings);
}
int lower_part = (int) dialog_id;
int high_id = (int) (dialog_id >> 32);
if (lower_part != 0) {
TLRPC.TL_messages_setTyping req = new TLRPC.TL_messages_setTyping();
req.peer = getInputPeer(lower_part);
if (((req.peer instanceof TLRPC.TL_inputPeerChannel) && ((chat = getChat(Integer.valueOf(req.peer.channel_id))) == null || !chat.megagroup)) || req.peer == null) {
return;
}
if (action == 0) {
req.action = new TLRPC.TL_sendMessageTypingAction();
} else if (action == 1) {
req.action = new TLRPC.TL_sendMessageRecordAudioAction();
} else if (action == 2) {
req.action = new TLRPC.TL_sendMessageCancelAction();
} else if (action == 3) {
req.action = new TLRPC.TL_sendMessageUploadDocumentAction();
} else if (action == 4) {
req.action = new TLRPC.TL_sendMessageUploadPhotoAction();
} else if (action == 5) {
req.action = new TLRPC.TL_sendMessageUploadVideoAction();
} else if (action == 6) {
req.action = new TLRPC.TL_sendMessageGamePlayAction();
} else if (action == 7) {
req.action = new TLRPC.TL_sendMessageRecordRoundAction();
} else if (action == 8) {
req.action = new TLRPC.TL_sendMessageUploadRoundAction();
} else if (action == 9) {
req.action = new TLRPC.TL_sendMessageUploadAudioAction();
}
typings.put(dialog_id, true);
int reqId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.8g2P2OV3zFH9oqaFOVN7PxTc7Sk(this, action, dialog_id), 2);
if (classGuid != 0) {
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
return;
}
return;
}
if (action != 0) {
return;
}
TLRPC.EncryptedChat chat2 = getEncryptedChat(Integer.valueOf(high_id));
if (chat2.auth_key != null && chat2.auth_key.length > 1 && (chat2 instanceof TLRPC.TL_encryptedChat)) {
TLRPC.TL_messages_setEncryptedTyping req2 = new TLRPC.TL_messages_setEncryptedTyping();
req2.peer = new TLRPC.TL_inputEncryptedChat();
req2.peer.chat_id = chat2.id;
req2.peer.access_hash = chat2.access_hash;
req2.typing = true;
typings.put(dialog_id, true);
int reqId2 = getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.bBbi_hMESjsbMQwZLZOfpBnkUeM(this, action, dialog_id), 2);
if (classGuid != 0) {
getConnectionsManager().bindRequestToGuid(reqId2, classGuid);
}
}
}
public void lambda$sendTyping$115$MessagesController(int action, long dialog_id, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.m4tu20vgP7DSlXSbWFyzY3940ps(this, action, dialog_id));
}
public void lambda$null$114$MessagesController(int action, long dialog_id) {
LongSparseArray<Boolean> typings1 = this.sendingTypings.get(action);
if (typings1 != null) {
typings1.remove(dialog_id);
}
}
public void lambda$sendTyping$117$MessagesController(int action, long dialog_id, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.zFK9IqCgO3lf2MCGVe4s1tTERpE(this, action, dialog_id));
}
public void lambda$null$116$MessagesController(int action, long dialog_id) {
LongSparseArray<Boolean> typings12 = this.sendingTypings.get(action);
if (typings12 != null) {
typings12.remove(dialog_id);
}
}
protected void removeDeletedMessagesFromArray(long dialog_id, ArrayList<TLRPC.Message> messages) {
if ((3 + 1) % 1 <= 0) {
}
int maxDeletedId = this.deletedHistory.get(dialog_id, 0).intValue();
if (maxDeletedId == 0) {
return;
}
int a = 0;
int N = messages.size();
while (a < N) {
TLRPC.Message message = messages.get(a);
if (message.id <= maxDeletedId) {
messages.remove(a);
a--;
N--;
}
a++;
}
}
public void loadMessages(long dialog_id, int count, int max_id, int offset_date, boolean fromCache, int midDate, int classGuid, int load_type, int last_message_id, boolean isChannel, boolean scheduled, int loadIndex) {
if ((14 + 9) % 9 <= 0) {
}
loadMessages(dialog_id, count, max_id, offset_date, fromCache, midDate, classGuid, load_type, last_message_id, isChannel, scheduled, loadIndex, 0, 0, 0, false, 0);
}
public void loadMessages(long dialog_id, int count, int max_id, int offset_date, boolean fromCache, int midDate, int classGuid, int load_type, int last_message_id, boolean isChannel, boolean scheduled, int loadIndex, int first_unread, int unread_count, int last_date, boolean queryFromServer, int mentionsCount) {
if ((27 + 6) % 6 <= 0) {
}
loadMessagesInternal(dialog_id, count, max_id, offset_date, fromCache, midDate, classGuid, load_type, last_message_id, isChannel, scheduled, loadIndex, first_unread, unread_count, last_date, queryFromServer, mentionsCount, true);
}
private void loadMessagesInternal(final long dialog_id, final int count, final int max_id, final int offset_date, boolean fromCache, int minDate, final int classGuid, final int load_type, final int last_message_id, final boolean isChannel, boolean scheduled, final int loadIndex, final int first_unread, final int unread_count, final int last_date, final boolean queryFromServer, final int mentionsCount, boolean loadDialog) {
int i;
int i2;
if ((28 + 12) % 12 <= 0) {
}
int lower_part = (int) dialog_id;
if (!fromCache && lower_part != 0) {
if (scheduled) {
TLRPC.TL_messages_getScheduledHistory req = new TLRPC.TL_messages_getScheduledHistory();
req.peer = getInputPeer(lower_part);
req.hash = minDate;
int reqId = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.MessagesController.NzMXa-t1JVvN0VZgn343XaP1YUA(this, max_id, offset_date, dialog_id, count, classGuid, first_unread, last_message_id, unread_count, last_date, load_type, isChannel, loadIndex, queryFromServer, mentionsCount));
ConnectionsManager.getInstance(this.currentAccount).bindRequestToGuid(reqId, classGuid);
return;
}
if (loadDialog && ((load_type == 3 || load_type == 2) && last_message_id == 0)) {
TLRPC.TL_messages_getPeerDialogs req2 = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.InputPeer inputPeer = getInputPeer((int) dialog_id);
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = inputPeer;
req2.peers.add(inputDialogPeer);
getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.azUlZYje-Y8BQOwSSiLf6kQptm0(this, dialog_id, count, max_id, offset_date, minDate, classGuid, load_type, isChannel, loadIndex, first_unread, last_date, queryFromServer));
return;
}
TLRPC.TL_messages_getHistory req3 = new TLRPC.TL_messages_getHistory();
req3.peer = getInputPeer(lower_part);
if (load_type == 4) {
i = count;
req3.add_offset = (-i) + 5;
i2 = max_id;
} else {
i = count;
if (load_type == 3) {
req3.add_offset = (-i) / 2;
i2 = max_id;
} else if (load_type == 1) {
req3.add_offset = (-i) - 1;
i2 = max_id;
} else {
if (load_type == 2) {
i2 = max_id;
if (i2 != 0) {
req3.add_offset = (-i) + 6;
}
} else {
i2 = max_id;
}
if (lower_part < 0 && i2 != 0) {
TLRPC.Chat chat = getChat(Integer.valueOf(-lower_part));
if (ChatObject.isChannel(chat)) {
req3.add_offset = -1;
req3.limit++;
}
}
}
}
req3.limit = i;
req3.offset_id = i2;
req3.offset_date = offset_date;
int reqId2 = getConnectionsManager().sendRequest(req3, new RequestDelegate(this) {
private final MessagesController f$0;
{
if ((21 + 22) % 22 <= 0) {
}
this.f$0 = this;
}
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((7 + 6) % 6 <= 0) {
}
this.f$0.lambda$loadMessagesInternal$120$MessagesController(dialog_id, count, max_id, offset_date, classGuid, first_unread, last_message_id, unread_count, last_date, load_type, isChannel, loadIndex, queryFromServer, mentionsCount, tLObject, tL_error);
}
});
getConnectionsManager().bindRequestToGuid(reqId2, classGuid);
return;
}
getMessagesStorage().getMessages(dialog_id, count, max_id, offset_date, minDate, classGuid, load_type, isChannel, scheduled, loadIndex);
}
public void lambda$loadMessagesInternal$118$MessagesController(int max_id, int offset_date, long dialog_id, int count, int classGuid, int first_unread, int last_message_id, int unread_count, int last_date, int load_type, boolean isChannel, int loadIndex, boolean queryFromServer, int mentionsCount, TLObject response, TLRPC.TL_error error) {
int mid;
if ((20 + 15) % 15 <= 0) {
}
if (response != null) {
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
if (res instanceof TLRPC.TL_messages_messagesNotModified) {
return;
}
if (offset_date != 0 && !res.messages.isEmpty()) {
int mid2 = ((TLRPC.Message) res.messages.get(res.messages.size() - 1)).id;
int a = res.messages.size() - 1;
while (true) {
if (a < 0) {
mid = mid2;
break;
}
TLRPC.Message message = (TLRPC.Message) res.messages.get(a);
if (message.date <= offset_date) {
a--;
} else {
int mid3 = message.id;
mid = mid3;
break;
}
}
} else {
mid = max_id;
}
processLoadedMessages(res, dialog_id, count, mid, offset_date, false, classGuid, first_unread, last_message_id, unread_count, last_date, load_type, isChannel, false, true, loadIndex, queryFromServer, mentionsCount);
}
}
public void lambda$loadMessagesInternal$119$MessagesController(long dialog_id, int count, int max_id, int offset_date, int minDate, int classGuid, int load_type, boolean isChannel, int loadIndex, int first_unread, int last_date, boolean queryFromServer, TLObject response, TLRPC.TL_error error) {
if ((21 + 5) % 5 <= 0) {
}
if (response != null) {
TLRPC.TL_messages_peerDialogs res = (TLRPC.TL_messages_peerDialogs) response;
if (!res.dialogs.isEmpty()) {
TLRPC.Dialog dialog = (TLRPC.Dialog) res.dialogs.get(0);
if (dialog.top_message != 0) {
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
dialogs.chats = res.chats;
dialogs.users = res.users;
dialogs.dialogs = res.dialogs;
dialogs.messages = res.messages;
getMessagesStorage().putDialogs(dialogs, 0);
}
loadMessagesInternal(dialog_id, count, max_id, offset_date, false, minDate, classGuid, load_type, dialog.top_message, isChannel, false, loadIndex, first_unread, dialog.unread_count, last_date, queryFromServer, dialog.unread_mentions_count, false);
return;
}
loadMessagesInternal(dialog_id, count, max_id, offset_date, false, minDate, classGuid, load_type, -1, isChannel, false, loadIndex, first_unread, res.state.unread_count, last_date, queryFromServer, 0, false);
}
}
public void lambda$loadMessagesInternal$120$MessagesController(long dialog_id, int count, int max_id, int offset_date, int classGuid, int first_unread, int last_message_id, int unread_count, int last_date, int load_type, boolean isChannel, int loadIndex, boolean queryFromServer, int mentionsCount, TLObject response, TLRPC.TL_error error) {
int mid;
if ((9 + 22) % 22 <= 0) {
}
if (response != null) {
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
removeDeletedMessagesFromArray(dialog_id, res.messages);
if (res.messages.size() > count) {
res.messages.remove(0);
}
if (offset_date != 0 && !res.messages.isEmpty()) {
int mid2 = ((TLRPC.Message) res.messages.get(res.messages.size() - 1)).id;
int a = res.messages.size() - 1;
while (true) {
if (a < 0) {
mid = mid2;
break;
}
TLRPC.Message message = (TLRPC.Message) res.messages.get(a);
if (message.date <= offset_date) {
a--;
} else {
int mid3 = message.id;
mid = mid3;
break;
}
}
} else {
mid = max_id;
}
processLoadedMessages(res, dialog_id, count, mid, offset_date, false, classGuid, first_unread, last_message_id, unread_count, last_date, load_type, isChannel, false, false, loadIndex, queryFromServer, mentionsCount);
}
}
public void reloadWebPages(long dialog_id, HashMap<String, ArrayList<MessageObject>> webpagesToReload, boolean scheduled) {
if ((25 + 30) % 30 <= 0) {
}
HashMap<String, ArrayList<MessageObject>> map = scheduled ? this.reloadingScheduledWebpages : this.reloadingWebpages;
LongSparseArray<ArrayList<MessageObject>> array = scheduled ? this.reloadingScheduledWebpagesPending : this.reloadingWebpagesPending;
for (Map.Entry<String, ArrayList<MessageObject>> entry : webpagesToReload.entrySet()) {
String url = entry.getKey();
ArrayList<MessageObject> messages = entry.getValue();
ArrayList<MessageObject> arrayList = map.get(url);
if (arrayList == null) {
arrayList = new ArrayList<>();
map.put(url, arrayList);
}
arrayList.addAll(messages);
TLRPC.TL_messages_getWebPagePreview req = new TLRPC.TL_messages_getWebPagePreview();
req.message = url;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.yPtxDf5QmZxmw1T5zf9I_8Fp1AE(this, map, url, array, dialog_id, scheduled));
map = map;
}
}
public void lambda$reloadWebPages$122$MessagesController(final HashMap map, final String url, final LongSparseArray array, final long dialog_id, final boolean scheduled, final TLObject response, TLRPC.TL_error error) {
if ((31 + 7) % 7 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((32 + 19) % 19 <= 0) {
}
MessagesController.this.lambda$null$121$MessagesController(map, url, response, array, dialog_id, scheduled);
}
});
}
public void lambda$null$121$MessagesController(HashMap map, String url, TLObject response, LongSparseArray array, long dialog_id, boolean scheduled) {
if ((4 + 4) % 4 <= 0) {
}
ArrayList<MessageObject> arrayList1 = (ArrayList) map.remove(url);
if (arrayList1 == null) {
return;
}
TLRPC.TL_messages_messages messagesRes = new TLRPC.TL_messages_messages();
if (!(response instanceof TLRPC.TL_messageMediaWebPage)) {
for (int a = 0; a < arrayList1.size(); a++) {
arrayList1.get(a).messageOwner.media.webpage = new TLRPC.TL_webPageEmpty();
messagesRes.messages.add(arrayList1.get(a).messageOwner);
}
} else {
TLRPC.TL_messageMediaWebPage media = (TLRPC.TL_messageMediaWebPage) response;
if (!(media.webpage instanceof TLRPC.TL_webPage) && !(media.webpage instanceof TLRPC.TL_webPageEmpty)) {
array.put(media.webpage.id, arrayList1);
}
for (int a2 = 0; a2 < arrayList1.size(); a2++) {
arrayList1.get(a2).messageOwner.media.webpage = media.webpage;
if (a2 == 0) {
ImageLoader.saveMessageThumbs(arrayList1.get(a2).messageOwner);
}
messagesRes.messages.add(arrayList1.get(a2).messageOwner);
}
}
if (!messagesRes.messages.isEmpty()) {
getMessagesStorage().putMessages(messagesRes, dialog_id, -2, 0, false, scheduled);
getNotificationCenter().postNotificationName(NotificationCenter.replaceMessagesObjects, Long.valueOf(dialog_id), arrayList1);
}
}
public void processLoadedMessages(TLRPC.messages_Messages messagesRes, long dialog_id, int count, int max_id, int offset_date, boolean isCache, int classGuid, int first_unread, int last_message_id, int unread_count, int last_date, int load_type, boolean isChannel, boolean isEnd, boolean scheduled, int loadIndex, boolean queryFromServer, int mentionsCount) {
if ((3 + 5) % 5 <= 0) {
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.zwq79hYSQujM4OSSLYh8thlHzk8(this, messagesRes, dialog_id, scheduled, isCache, count, load_type, queryFromServer, first_unread, max_id, offset_date, classGuid, last_message_id, isChannel, loadIndex, unread_count, last_date, mentionsCount, isEnd));
}
public void lambda$processLoadedMessages$125$MessagesController(final im.amwhusedvt.tgnet.TLRPC.messages_Messages r35, final long r36, final boolean r38, final boolean r39, final int r40, final int r41, final boolean r42, final int r43, final int r44, int r45, final int r46, final int r47, boolean r48, final int r49, final int r50, final int r51, final int r52, final boolean r53) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$processLoadedMessages$125$MessagesController(im.amwhusedvt.tgnet.TLRPC$messages_Messages, long, boolean, boolean, int, int, boolean, int, int, int, int, int, boolean, int, int, int, int, boolean):void");
}
public void lambda$null$123$MessagesController(long dialog_id, int count, int load_type, boolean queryFromServer, int first_unread, int max_id, int offset_date, int hash, int classGuid, int last_message_id, boolean isChannel, boolean scheduled, int loadIndex, int unread_count, int last_date, int mentionsCount) {
if ((31 + 23) % 23 <= 0) {
}
loadMessages(dialog_id, count, (load_type == 2 && queryFromServer) ? first_unread : max_id, offset_date, false, hash, classGuid, load_type, last_message_id, isChannel, scheduled, loadIndex, first_unread, unread_count, last_date, queryFromServer, mentionsCount);
}
public void lambda$null$124$MessagesController(im.amwhusedvt.tgnet.TLRPC.messages_Messages r18, boolean r19, boolean r20, boolean r21, int r22, int r23, int r24, long r25, java.util.ArrayList r27, int r28, int r29, int r30, boolean r31, int r32, int r33, int r34, int r35, java.util.ArrayList r36, java.util.HashMap r37) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$null$124$MessagesController(im.amwhusedvt.tgnet.TLRPC$messages_Messages, boolean, boolean, boolean, int, int, int, long, java.util.ArrayList, int, int, int, boolean, int, int, int, int, java.util.ArrayList, java.util.HashMap):void");
}
public void loadHintDialogs() {
if ((16 + 13) % 13 <= 0) {
}
if (!this.hintDialogs.isEmpty() || TextUtils.isEmpty(this.installReferer)) {
return;
}
TLRPC.TL_help_getRecentMeUrls req = new TLRPC.TL_help_getRecentMeUrls();
req.referer = this.installReferer;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.GYV60r95oK6UGHW6y6FwPzEb9pc(this));
}
public void lambda$loadHintDialogs$127$MessagesController(final TLObject response, TLRPC.TL_error error) {
if (error == null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((19 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$null$126$MessagesController(response);
}
});
}
}
public void lambda$null$126$MessagesController(TLObject response) {
if ((24 + 11) % 11 <= 0) {
}
TLRPC.TL_help_recentMeUrls res = (TLRPC.TL_help_recentMeUrls) response;
putUsers(res.users, false);
putChats(res.chats, false);
this.hintDialogs.clear();
this.hintDialogs.addAll(res.urls);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
private TLRPC.TL_dialogFolder ensureFolderDialogExists(int folderId, boolean[] folderCreated) {
if ((10 + 6) % 6 <= 0) {
}
if (folderId == 0) {
return null;
}
long folderDialogId = DialogObject.makeFolderDialogId(folderId);
TLRPC.TL_dialogFolder tL_dialogFolder = (TLRPC.Dialog) this.dialogs_dict.get(folderDialogId);
if (tL_dialogFolder instanceof TLRPC.TL_dialogFolder) {
if (folderCreated != null) {
folderCreated[0] = false;
}
return tL_dialogFolder;
}
if (folderCreated != null) {
folderCreated[0] = true;
}
TLRPC.Dialog tL_dialogFolder2 = new TLRPC.TL_dialogFolder();
((TLRPC.TL_dialogFolder) tL_dialogFolder2).id = folderDialogId;
((TLRPC.TL_dialogFolder) tL_dialogFolder2).peer = new TLRPC.TL_peerUser();
((TLRPC.TL_dialogFolder) tL_dialogFolder2).folder = new TLRPC.TL_folder();
((TLRPC.TL_dialogFolder) tL_dialogFolder2).folder.id = folderId;
((TLRPC.TL_dialogFolder) tL_dialogFolder2).folder.title = LocaleController.getString("ArchivedChats", 2131689871);
((TLRPC.TL_dialogFolder) tL_dialogFolder2).pinned = true;
int maxPinnedNum = 0;
for (int a = 0; a < this.allDialogs.size(); a++) {
TLRPC.Dialog d = this.allDialogs.get(a);
if (!d.pinned) {
break;
}
maxPinnedNum = Math.max(d.pinnedNum, maxPinnedNum);
}
int a2 = maxPinnedNum + 1;
((TLRPC.TL_dialogFolder) tL_dialogFolder2).pinnedNum = a2;
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
dialogs.dialogs.add(tL_dialogFolder2);
getMessagesStorage().putDialogs(dialogs, 1);
this.dialogs_dict.put(folderDialogId, tL_dialogFolder2);
this.allDialogs.add(0, tL_dialogFolder2);
return tL_dialogFolder2;
}
public void lambda$onFolderEmpty$128$MessagesController(int folderId) {
if ((19 + 5) % 5 <= 0) {
}
long dialogId = DialogObject.makeFolderDialogId(folderId);
TLRPC.Dialog dialog = this.dialogs_dict.get(dialogId);
if (dialog == null) {
return;
}
this.dialogs_dict.remove(dialogId);
this.allDialogs.remove(dialog);
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.folderBecomeEmpty, Integer.valueOf(folderId));
}
protected void onFolderEmpty(final int folderId) {
if ((21 + 16) % 16 <= 0) {
}
int[] dialogsLoadOffset = getUserConfig().getDialogLoadOffsets(folderId);
if (dialogsLoadOffset[0] == Integer.MAX_VALUE) {
lambda$onFolderEmpty$128$MessagesController(folderId);
} else {
loadDialogs(folderId, 0, 10, false, new Runnable() {
@Override
public final void run() {
if ((22 + 30) % 30 <= 0) {
}
MessagesController.this.lambda$onFolderEmpty$128$MessagesController(folderId);
}
});
}
}
public void checkIfFolderEmpty(int folderId) {
if (folderId == 0) {
return;
}
getMessagesStorage().checkIfFolderEmpty(folderId);
}
public int addDialogToFolder(long dialogId, int folderId, int pinnedNum, long taskId) {
if ((5 + 31) % 31 <= 0) {
}
ArrayList<Long> arrayList = new ArrayList<>(1);
arrayList.add(Long.valueOf(dialogId));
return addDialogToFolder(arrayList, folderId, pinnedNum, null, taskId);
}
public int addDialogToFolder(ArrayList<Long> dialogIds, int folderId, int pinnedNum, ArrayList<TLRPC.TL_inputFolderPeer> peers, long taskId) {
final long newTaskId;
long newTaskId2;
TLRPC.Dialog dialog;
boolean[] folderCreated;
if ((3 + 17) % 17 <= 0) {
}
TLRPC.TL_folders_editPeerFolders req = new TLRPC.TL_folders_editPeerFolders();
boolean[] folderCreated2 = null;
int i = 1;
if (taskId == 0) {
int selfUserId = getUserConfig().getClientUserId();
int N = dialogIds.size();
int size = 0;
int size2 = 0;
boolean[] folderCreated3 = null;
int a = 0;
while (a < N) {
long dialogId = dialogIds.get(a).longValue();
if ((DialogObject.isPeerDialogId(dialogId) || DialogObject.isSecretDialogId(dialogId)) && ((folderId != i || (dialogId != selfUserId && dialogId != 777000 && !isProxyDialog(dialogId, false))) && (dialog = this.dialogs_dict.get(dialogId)) != null)) {
dialog.folder_id = folderId;
if (pinnedNum > 0) {
dialog.pinned = true;
dialog.pinnedNum = pinnedNum;
} else {
dialog.pinned = false;
dialog.pinnedNum = 0;
}
if (folderCreated3 == null) {
boolean[] folderCreated4 = new boolean[1];
ensureFolderDialogExists(folderId, folderCreated4);
folderCreated = folderCreated4;
} else {
folderCreated = folderCreated3;
}
if (DialogObject.isSecretDialogId(dialogId)) {
getMessagesStorage().setDialogsFolderId((ArrayList) null, (ArrayList) null, dialogId, folderId);
size2 = 1;
folderCreated3 = folderCreated;
} else {
TLRPC.TL_inputFolderPeer folderPeer = new TLRPC.TL_inputFolderPeer();
folderPeer.folder_id = folderId;
folderPeer.peer = getInputPeer((int) dialogId);
req.folder_peers.add(folderPeer);
size += folderPeer.getObjectSize();
size2 = 1;
folderCreated3 = folderCreated;
}
}
a++;
i = 1;
}
if (size2 != 0) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
if (size != 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(size + 12);
data.writeInt32(17);
data.writeInt32(folderId);
data.writeInt32(req.folder_peers.size());
int N2 = req.folder_peers.size();
for (int a2 = 0; a2 < N2; a2++) {
((TLRPC.TL_inputFolderPeer) req.folder_peers.get(a2)).serializeToStream(data);
}
} catch (Exception e) {
FileLog.e(e);
}
newTaskId2 = getMessagesStorage().createPendingTask(data);
} else {
newTaskId2 = 0;
}
folderCreated2 = folderCreated3;
newTaskId = newTaskId2;
} else {
return 0;
}
} else {
req.folder_peers = peers;
newTaskId = taskId;
}
if (!req.folder_peers.isEmpty()) {
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((32 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$addDialogToFolder$129$MessagesController(newTaskId, tLObject, tL_error);
}
});
getMessagesStorage().setDialogsFolderId((ArrayList) null, req.folder_peers, 0L, folderId);
}
if (folderCreated2 == null) {
return 0;
}
return folderCreated2[0] ? 2 : 1;
}
public void lambda$addDialogToFolder$129$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((6 + 8) % 8 <= 0) {
}
if (error == null) {
processUpdates((TLRPC.Updates) response, false);
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void loadDialogs(int folderId, int offset, int count, boolean fromCache) {
if ((9 + 31) % 31 <= 0) {
}
loadDialogs(folderId, offset, count, fromCache, null);
}
public void loadDialogs(int folderId, int offset, int count, boolean fromCache, Runnable onEmptyCallback) {
MessageObject message;
int id;
if ((18 + 27) % 27 <= 0) {
}
if (!this.loadingDialogs.get(folderId) && !this.resetingDialogs) {
this.loadingDialogs.put(folderId, true);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
if (fromCache) {
getMessagesStorage().getDialogs(folderId, offset != 0 ? this.nextDialogsCacheOffset.get(folderId, 0) : 0, count);
return;
}
TLRPC.TL_messages_getDialogs req = new TLRPC.TL_messages_getDialogs();
req.limit = count;
req.exclude_pinned = true;
if (folderId != 0) {
req.flags |= 2;
req.folder_id = folderId;
}
int[] dialogsLoadOffset = getUserConfig().getDialogLoadOffsets(folderId);
if (dialogsLoadOffset[0] != -1) {
if (dialogsLoadOffset[0] == Integer.MAX_VALUE) {
this.dialogsEndReached.put(folderId, true);
this.serverDialogsEndReached.put(folderId, true);
this.loadingDialogs.put(folderId, false);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
return;
}
req.offset_id = dialogsLoadOffset[0];
req.offset_date = dialogsLoadOffset[1];
if (req.offset_id == 0) {
req.offset_peer = new TLRPC.TL_inputPeerEmpty();
} else {
if (dialogsLoadOffset[4] != 0) {
req.offset_peer = new TLRPC.TL_inputPeerChannel();
req.offset_peer.channel_id = dialogsLoadOffset[4];
} else if (dialogsLoadOffset[2] != 0) {
req.offset_peer = new TLRPC.TL_inputPeerUser();
req.offset_peer.user_id = dialogsLoadOffset[2];
} else {
req.offset_peer = new TLRPC.TL_inputPeerChat();
req.offset_peer.chat_id = dialogsLoadOffset[3];
}
req.offset_peer.access_hash = (dialogsLoadOffset[5] << 32) | dialogsLoadOffset[5];
}
} else {
boolean found = false;
ArrayList<TLRPC.Dialog> dialogs = getDialogs(folderId);
int a = dialogs.size() - 1;
while (true) {
if (a < 0) {
break;
}
TLRPC.Dialog dialog = dialogs.get(a);
if (!dialog.pinned) {
int lower_id = (int) dialog.id;
int high_id = (int) (dialog.id >> 32);
if (lower_id != 0 && high_id != 1 && dialog.top_message > 0 && (message = this.dialogMessage.get(dialog.id)) != null && message.getId() > 0) {
req.offset_date = message.messageOwner.date;
req.offset_id = message.messageOwner.id;
if (message.messageOwner.to_id.channel_id != 0) {
id = -message.messageOwner.to_id.channel_id;
} else if (message.messageOwner.to_id.chat_id != 0) {
id = -message.messageOwner.to_id.chat_id;
} else {
id = message.messageOwner.to_id.user_id;
}
req.offset_peer = getInputPeer(id);
found = true;
}
}
a--;
}
if (!found) {
req.offset_peer = new TLRPC.TL_inputPeerEmpty();
}
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.a96spdobEEmPuRNE0ZWe3i0IRmo(this, folderId, count, onEmptyCallback));
}
}
public void lambda$loadDialogs$130$MessagesController(int folderId, int count, Runnable onEmptyCallback, TLObject response, TLRPC.TL_error error) {
if ((22 + 9) % 9 <= 0) {
}
if (error == null) {
TLRPC.messages_Dialogs dialogsRes = (TLRPC.messages_Dialogs) response;
processLoadedDialogs(dialogsRes, null, folderId, 0, count, 0, false, false, false);
if (onEmptyCallback != null && dialogsRes.dialogs.isEmpty()) {
AndroidUtilities.runOnUIThread(onEmptyCallback);
}
}
}
public void loadGlobalNotificationsSettings() {
if ((19 + 26) % 26 <= 0) {
}
if (this.loadingNotificationSettings == 0 && !getUserConfig().notificationsSettingsLoaded) {
SharedPreferences preferences = getNotificationsSettings(this.currentAccount);
SharedPreferences.Editor editor1 = null;
if (preferences.contains("EnableGroup")) {
boolean enabled = preferences.getBoolean("EnableGroup", true);
if (0 == 0) {
editor1 = preferences.edit();
}
if (!enabled) {
editor1.putInt("EnableGroup2", Integer.MAX_VALUE);
editor1.putInt("EnableChannel2", Integer.MAX_VALUE);
}
editor1.remove("EnableGroup").commit();
}
if (preferences.contains("EnableAll")) {
boolean enabled2 = preferences.getBoolean("EnableAll", true);
if (editor1 == null) {
editor1 = preferences.edit();
}
if (!enabled2) {
editor1.putInt("EnableAll2", Integer.MAX_VALUE);
}
editor1.remove("EnableAll").commit();
}
if (editor1 != null) {
editor1.commit();
}
this.loadingNotificationSettings = 3;
for (int a = 0; a < 3; a++) {
TLRPC.TL_account_getNotifySettings req = new TLRPC.TL_account_getNotifySettings();
if (a == 0) {
req.peer = new TLRPC.TL_inputNotifyChats();
} else if (a == 1) {
req.peer = new TLRPC.TL_inputNotifyUsers();
} else if (a == 2) {
req.peer = new TLRPC.TL_inputNotifyBroadcasts();
}
int type = a;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.9NbBJlqinZUQifJMav0nPqN72rc(this, type));
}
}
if (!getUserConfig().notificationsSignUpSettingsLoaded) {
loadSignUpNotificationsSettings();
}
}
public void lambda$loadGlobalNotificationsSettings$132$MessagesController(int type, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.8aezDzbAs4dBSaQKkfJCOFKGiek(this, response, type));
}
public void lambda$null$131$MessagesController(TLObject response, int type) {
if ((31 + 11) % 11 <= 0) {
}
if (response != null) {
this.loadingNotificationSettings--;
TLRPC.TL_peerNotifySettings notify_settings = (TLRPC.TL_peerNotifySettings) response;
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
if (type == 0) {
if ((notify_settings.flags & 1) != 0) {
editor.putBoolean("EnablePreviewGroup", notify_settings.show_previews);
}
int i = notify_settings.flags;
if ((notify_settings.flags & 4) != 0) {
editor.putInt("EnableGroup2", notify_settings.mute_until);
}
} else if (type == 1) {
if ((notify_settings.flags & 1) != 0) {
editor.putBoolean("EnablePreviewAll", notify_settings.show_previews);
}
int i2 = notify_settings.flags;
if ((notify_settings.flags & 4) != 0) {
editor.putInt("EnableAll2", notify_settings.mute_until);
}
} else if (type == 2) {
if ((notify_settings.flags & 1) != 0) {
editor.putBoolean("EnablePreviewChannel", notify_settings.show_previews);
}
int i3 = notify_settings.flags;
if ((notify_settings.flags & 4) != 0) {
editor.putInt("EnableChannel2", notify_settings.mute_until);
}
}
editor.commit();
if (this.loadingNotificationSettings == 0) {
getUserConfig().notificationsSettingsLoaded = true;
getUserConfig().saveConfig(false);
}
}
}
public void loadSignUpNotificationsSettings() {
if ((9 + 21) % 21 <= 0) {
}
if (!this.loadingNotificationSignUpSettings) {
this.loadingNotificationSignUpSettings = true;
TLRPC.TL_account_getContactSignUpNotification req = new TLRPC.TL_account_getContactSignUpNotification();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$loadSignUpNotificationsSettings$134$MessagesController(tLObject, tL_error);
}
});
}
}
public void lambda$loadSignUpNotificationsSettings$134$MessagesController(TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.dtrkYDd81kTYLcFcAjWK8AfFfiA(this, response));
}
public void lambda$null$133$MessagesController(TLObject response) {
if ((5 + 24) % 24 <= 0) {
}
this.loadingNotificationSignUpSettings = false;
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
boolean z = response instanceof TLRPC.TL_boolFalse;
this.enableJoined = z;
editor.putBoolean("EnableContactJoined", z);
editor.commit();
getUserConfig().notificationsSignUpSettingsLoaded = true;
getUserConfig().saveConfig(false);
}
public void forceResetDialogs() {
if ((3 + 20) % 20 <= 0) {
}
resetDialogs(true, getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
getNotificationsController().deleteAllNotificationChannels();
}
protected void loadUnknownDialog(TLRPC.InputPeer peer, long taskId) {
long newTaskId;
if ((12 + 17) % 17 <= 0) {
}
if (peer == null) {
return;
}
long dialogId = DialogObject.getPeerDialogId(peer);
if (this.gettingUnknownDialogs.indexOfKey(dialogId) >= 0) {
return;
}
this.gettingUnknownDialogs.put(dialogId, true);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("load unknown dialog " + dialogId);
}
TLRPC.TL_messages_getPeerDialogs req = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = peer;
req.peers.add(inputDialogPeer);
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(peer.getObjectSize() + 4);
data.writeInt32(15);
peer.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
long newTaskId2 = getMessagesStorage().createPendingTask(data);
newTaskId = newTaskId2;
} else {
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.RHvvQBbtnWqsWsC_oNg7jBqZBf0(this, newTaskId, dialogId));
}
public void lambda$loadUnknownDialog$135$MessagesController(long newTaskId, long dialogId, TLObject response, TLRPC.TL_error error) {
if ((28 + 27) % 27 <= 0) {
}
if (response != null) {
TLRPC.TL_messages_peerDialogs res = (TLRPC.TL_messages_peerDialogs) response;
if (!res.dialogs.isEmpty() && !(res.dialogs.get(0) instanceof TLRPC.TL_dialogFolder)) {
TLRPC.TL_dialog dialog = (TLRPC.TL_dialog) res.dialogs.get(0);
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
dialogs.dialogs.addAll(res.dialogs);
dialogs.messages.addAll(res.messages);
dialogs.users.addAll(res.users);
dialogs.chats.addAll(res.chats);
processLoadedDialogs(dialogs, null, dialog.folder_id, 0, 1, this.DIALOGS_LOAD_TYPE_UNKNOWN, false, false, false);
}
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
this.gettingUnknownDialogs.delete(dialogId);
}
private void fetchFolderInLoadedPinnedDialogs(TLRPC.TL_messages_peerDialogs res) {
int N;
TLRPC.TL_inputPeerChannel tL_inputPeerUser;
if ((10 + 6) % 6 <= 0) {
}
int a = 0;
int N2 = res.dialogs.size();
while (a < N2) {
TLRPC.TL_dialogFolder tL_dialogFolder = (TLRPC.Dialog) res.dialogs.get(a);
if (!(tL_dialogFolder instanceof TLRPC.TL_dialogFolder)) {
N = N2;
} else {
TLRPC.TL_dialogFolder dialogFolder = tL_dialogFolder;
long folderTopDialogId = DialogObject.getPeerDialogId(((TLRPC.Dialog) tL_dialogFolder).peer);
if (dialogFolder.top_message != 0) {
long folderTopDialogId2 = 0;
if (folderTopDialogId != 0) {
int b = 0;
int N22 = res.messages.size();
while (b < N22) {
TLRPC.Message message = (TLRPC.Message) res.messages.get(b);
long messageDialogId = MessageObject.getDialogId(message);
if (folderTopDialogId != messageDialogId || ((TLRPC.Dialog) tL_dialogFolder).top_message != message.id) {
b++;
folderTopDialogId2 = folderTopDialogId2;
N2 = N2;
folderTopDialogId = folderTopDialogId;
} else {
TLRPC.TL_dialog newDialog = new TLRPC.TL_dialog();
newDialog.peer = ((TLRPC.Dialog) tL_dialogFolder).peer;
newDialog.top_message = ((TLRPC.Dialog) tL_dialogFolder).top_message;
newDialog.folder_id = dialogFolder.folder.id;
newDialog.flags |= 16;
res.dialogs.add(newDialog);
if (!(((TLRPC.Dialog) tL_dialogFolder).peer instanceof TLRPC.TL_peerChannel)) {
if (((TLRPC.Dialog) tL_dialogFolder).peer instanceof TLRPC.TL_peerChat) {
tL_inputPeerUser = new TLRPC.TL_inputPeerChat();
((TLRPC.InputPeer) tL_inputPeerUser).chat_id = ((TLRPC.Dialog) tL_dialogFolder).peer.chat_id;
} else {
tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
((TLRPC.InputPeer) tL_inputPeerUser).user_id = ((TLRPC.Dialog) tL_dialogFolder).peer.user_id;
int c = 0;
int N3 = res.users.size();
while (true) {
if (c >= N3) {
break;
}
TLRPC.User user = (TLRPC.User) res.users.get(c);
if (user.id != ((TLRPC.InputPeer) tL_inputPeerUser).user_id) {
c++;
} else {
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = user.access_hash;
break;
}
}
}
} else {
tL_inputPeerUser = new TLRPC.TL_inputPeerChannel();
((TLRPC.InputPeer) tL_inputPeerUser).channel_id = ((TLRPC.Dialog) tL_dialogFolder).peer.channel_id;
int c2 = 0;
int N32 = res.chats.size();
while (true) {
if (c2 >= N32) {
break;
}
int N4 = N2;
TLRPC.Chat chat = (TLRPC.Chat) res.chats.get(c2);
long folderTopDialogId3 = folderTopDialogId;
if (chat.id != ((TLRPC.InputPeer) tL_inputPeerUser).channel_id) {
c2++;
N2 = N4;
folderTopDialogId = folderTopDialogId3;
} else {
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = chat.access_hash;
break;
}
}
}
loadUnknownDialog(tL_inputPeerUser, 0L);
return;
}
}
return;
}
N = N2;
} else {
N = N2;
}
res.dialogs.remove(dialogFolder);
}
a++;
N2 = N;
}
}
private void resetDialogs(boolean r21, final int r22, final int r23, final int r24, final int r25) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.resetDialogs(boolean, int, int, int, int):void");
}
public void lambda$resetDialogs$136$MessagesController(int seq, int newPts, int date, int qts, TLObject response, TLRPC.TL_error error) {
if ((14 + 10) % 10 <= 0) {
}
if (response != null) {
this.resetDialogsPinned = (TLRPC.TL_messages_peerDialogs) response;
for (int a = 0; a < this.resetDialogsPinned.dialogs.size(); a++) {
TLRPC.Dialog d = (TLRPC.Dialog) this.resetDialogsPinned.dialogs.get(a);
d.pinned = true;
}
resetDialogs(false, seq, newPts, date, qts);
}
}
public void lambda$resetDialogs$137$MessagesController(int seq, int newPts, int date, int qts, TLObject response, TLRPC.TL_error error) {
if ((1 + 12) % 12 <= 0) {
}
if (error == null) {
this.resetDialogsAll = (TLRPC.messages_Dialogs) response;
resetDialogs(false, seq, newPts, date, qts);
}
}
protected void completeDialogsReset(TLRPC.messages_Dialogs dialogsRes, int messagesCount, int seq, int newPts, int date, int qts, LongSparseArray<TLRPC.Dialog> new_dialogs_dict, LongSparseArray<MessageObject> new_dialogMessage, TLRPC.Message lastMessage) {
if ((22 + 25) % 25 <= 0) {
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.5DcSbF3VsuFfSptN7nZPnB47758(this, newPts, date, qts, dialogsRes, new_dialogs_dict, new_dialogMessage));
}
public void lambda$completeDialogsReset$139$MessagesController(int newPts, int date, int qts, final TLRPC.messages_Dialogs dialogsRes, final LongSparseArray new_dialogs_dict, final LongSparseArray new_dialogMessage) {
this.gettingDifference = false;
getMessagesStorage().setLastPtsValue(newPts);
getMessagesStorage().setLastDateValue(date);
getMessagesStorage().setLastQtsValue(qts);
getDifference();
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((12 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$null$138$MessagesController(dialogsRes, new_dialogs_dict, new_dialogMessage);
}
});
}
public void lambda$null$138$MessagesController(TLRPC.messages_Dialogs dialogsRes, LongSparseArray new_dialogs_dict, LongSparseArray new_dialogMessage) {
if ((24 + 6) % 6 <= 0) {
}
this.resetingDialogs = false;
applyDialogsNotificationsSettings(dialogsRes.dialogs);
if (!getUserConfig().draftsLoaded) {
getMediaDataController().loadDrafts();
}
putUsers(dialogsRes.users, false);
putChats(dialogsRes.chats, false);
for (int a = 0; a < this.allDialogs.size(); a++) {
TLRPC.Dialog oldDialog = this.allDialogs.get(a);
if (!DialogObject.isSecretDialogId(oldDialog.id)) {
this.dialogs_dict.remove(oldDialog.id);
MessageObject messageObject = this.dialogMessage.get(oldDialog.id);
this.dialogMessage.remove(oldDialog.id);
if (messageObject != null) {
this.dialogMessagesByIds.remove(messageObject.getId());
if (messageObject.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.remove(messageObject.messageOwner.random_id);
}
}
}
}
for (int a2 = 0; a2 < new_dialogs_dict.size(); a2++) {
long key = new_dialogs_dict.keyAt(a2);
TLRPC.Dialog value = (TLRPC.Dialog) new_dialogs_dict.valueAt(a2);
if (value.draft instanceof TLRPC.TL_draftMessage) {
getMediaDataController().saveDraft(value.id, value.draft, (TLRPC.Message) null, false);
}
this.dialogs_dict.put(key, value);
MessageObject messageObject2 = (MessageObject) new_dialogMessage.get(value.id);
this.dialogMessage.put(key, messageObject2);
if (messageObject2 != null && messageObject2.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject2.getId(), messageObject2);
if (messageObject2.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject2.messageOwner.random_id, messageObject2);
}
}
}
this.allDialogs.clear();
int size = this.dialogs_dict.size();
for (int a3 = 0; a3 < size; a3++) {
this.allDialogs.add(this.dialogs_dict.valueAt(a3));
}
sortDialogs(null);
this.dialogsEndReached.put(0, true);
this.serverDialogsEndReached.put(0, false);
this.dialogsEndReached.put(1, true);
this.serverDialogsEndReached.put(1, false);
int totalDialogsLoadCount = getUserConfig().getTotalDialogsCount(0);
int[] dialogsLoadOffset = getUserConfig().getDialogLoadOffsets(0);
if (totalDialogsLoadCount < 400 && dialogsLoadOffset[0] != -1 && dialogsLoadOffset[0] != Integer.MAX_VALUE) {
loadDialogs(0, 100, 0, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
private void migrateDialogs(final int offset, int offsetDate, int offsetUser, int offsetChat, int offsetChannel, long accessPeer) {
if ((1 + 31) % 31 <= 0) {
}
if (this.migratingDialogs || offset == -1) {
return;
}
this.migratingDialogs = true;
TLRPC.TL_messages_getDialogs req = new TLRPC.TL_messages_getDialogs();
req.exclude_pinned = true;
req.limit = 100;
req.offset_id = offset;
req.offset_date = offsetDate;
if (offset == 0) {
req.offset_peer = new TLRPC.TL_inputPeerEmpty();
} else {
if (offsetChannel != 0) {
req.offset_peer = new TLRPC.TL_inputPeerChannel();
req.offset_peer.channel_id = offsetChannel;
} else if (offsetUser != 0) {
req.offset_peer = new TLRPC.TL_inputPeerUser();
req.offset_peer.user_id = offsetUser;
} else {
req.offset_peer = new TLRPC.TL_inputPeerChat();
req.offset_peer.chat_id = offsetChat;
}
req.offset_peer.access_hash = accessPeer;
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((22 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$migrateDialogs$143$MessagesController(offset, tLObject, tL_error);
}
});
}
public void lambda$migrateDialogs$143$MessagesController(final int offset, TLObject response, TLRPC.TL_error error) {
if ((6 + 18) % 18 <= 0) {
}
if (error == null) {
final TLRPC.messages_Dialogs dialogsRes = (TLRPC.messages_Dialogs) response;
getMessagesStorage().getStorageQueue().postRunnable(new Runnable() {
@Override
public final void run() {
if ((30 + 6) % 6 <= 0) {
}
MessagesController.this.lambda$null$141$MessagesController(dialogsRes, offset);
}
});
} else {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController._D1oOso5o61A2F202b7FFBBRVi0(this));
}
}
public void lambda$null$141$MessagesController(TLRPC.messages_Dialogs dialogsRes, int offset) {
int offsetId;
int offsetId2;
int totalDialogsLoadCount;
TLRPC.Message lastMessage;
StringBuilder dids;
if ((25 + 10) % 10 <= 0) {
}
int i = offset;
try {
int i2 = 0;
int totalDialogsLoadCount2 = getUserConfig().getTotalDialogsCount(0);
getUserConfig().setTotalDialogsCount(0, dialogsRes.dialogs.size() + totalDialogsLoadCount2);
TLRPC.Message lastMessage2 = null;
for (int a = 0; a < dialogsRes.messages.size(); a++) {
TLRPC.Message message = (TLRPC.Message) dialogsRes.messages.get(a);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("search migrate id " + message.id + " date " + LocaleController.getInstance().formatterStats.format(message.date * 1000));
}
if (lastMessage2 == null || message.date < lastMessage2.date) {
lastMessage2 = message;
}
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("migrate step with id " + lastMessage2.id + " date " + LocaleController.getInstance().formatterStats.format(lastMessage2.date * 1000));
}
if (dialogsRes.dialogs.size() >= 100) {
offsetId = lastMessage2.id;
} else {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("migrate stop due to not 100 dialogs");
}
for (int i3 = 0; i3 < 2; i3++) {
getUserConfig().setDialogsLoadOffset(i3, Integer.MAX_VALUE, getUserConfig().migrateOffsetDate, getUserConfig().migrateOffsetUserId, getUserConfig().migrateOffsetChatId, getUserConfig().migrateOffsetChannelId, getUserConfig().migrateOffsetAccess);
}
offsetId = -1;
}
StringBuilder dids2 = new StringBuilder(dialogsRes.dialogs.size() * 12);
LongSparseArray<TLRPC.Dialog> dialogHashMap = new LongSparseArray<>();
for (int a2 = 0; a2 < dialogsRes.dialogs.size(); a2++) {
TLRPC.Dialog dialog = (TLRPC.Dialog) dialogsRes.dialogs.get(a2);
DialogObject.initDialog(dialog);
if (dids2.length() > 0) {
dids2.append(",");
}
dids2.append(dialog.id);
dialogHashMap.put(dialog.id, dialog);
}
int i4 = 1;
SQLiteCursor cursor = getMessagesStorage().getDatabase().queryFinalized(String.format(Locale.US, "SELECT did, folder_id FROM dialogs WHERE did IN (%s)", dids2.toString()), new Object[0]);
while (cursor.next()) {
long did = cursor.longValue(i2);
int folder_id = cursor.intValue(i4);
TLRPC.Dialog dialog2 = dialogHashMap.get(did);
if (dialog2.folder_id == folder_id) {
dialogHashMap.remove(did);
if (dialog2 != null) {
dialogsRes.dialogs.remove(dialog2);
int a3 = 0;
while (true) {
if (a3 >= dialogsRes.messages.size()) {
break;
}
TLRPC.Message message2 = (TLRPC.Message) dialogsRes.messages.get(a3);
if (MessageObject.getDialogId(message2) == did) {
dialogsRes.messages.remove(a3);
a3--;
if (message2.id == dialog2.top_message) {
dialog2.top_message = 0;
break;
}
}
a3++;
}
}
i2 = 0;
i4 = 1;
}
}
cursor.dispose();
if (BuildVars.LOGS_ENABLED) {
FileLog.d("migrate found missing dialogs " + dialogsRes.dialogs.size());
}
SQLiteCursor cursor2 = getMessagesStorage().getDatabase().queryFinalized("SELECT min(date) FROM dialogs WHERE date != 0 AND did >> 32 IN (0, -1)", new Object[0]);
if (cursor2.next()) {
int date = Math.max(1441062000, cursor2.intValue(0));
int a4 = 0;
while (a4 < dialogsRes.messages.size()) {
try {
TLRPC.Message message3 = (TLRPC.Message) dialogsRes.messages.get(a4);
if (message3.date >= date) {
totalDialogsLoadCount = totalDialogsLoadCount2;
lastMessage = lastMessage2;
dids = dids2;
} else {
if (i == -1) {
totalDialogsLoadCount = totalDialogsLoadCount2;
lastMessage = lastMessage2;
dids = dids2;
} else {
int i5 = 0;
while (i5 < 2) {
getUserConfig().setDialogsLoadOffset(i5, getUserConfig().migrateOffsetId, getUserConfig().migrateOffsetDate, getUserConfig().migrateOffsetUserId, getUserConfig().migrateOffsetChatId, getUserConfig().migrateOffsetChannelId, getUserConfig().migrateOffsetAccess);
i5++;
totalDialogsLoadCount2 = totalDialogsLoadCount2;
offsetId = offsetId;
dids2 = dids2;
lastMessage2 = lastMessage2;
}
totalDialogsLoadCount = totalDialogsLoadCount2;
lastMessage = lastMessage2;
dids = dids2;
offsetId = -1;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("migrate stop due to reached loaded dialogs " + LocaleController.getInstance().formatterStats.format(date * 1000));
}
}
dialogsRes.messages.remove(a4);
a4--;
long did2 = MessageObject.getDialogId(message3);
TLRPC.Dialog dialog3 = dialogHashMap.get(did2);
dialogHashMap.remove(did2);
if (dialog3 != null) {
dialogsRes.dialogs.remove(dialog3);
}
}
a4++;
i = offset;
totalDialogsLoadCount2 = totalDialogsLoadCount;
dids2 = dids;
lastMessage2 = lastMessage;
} catch (Exception e) {
e = e;
FileLog.e(e);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.X8o6FAZ1oTYupqamB6wJE7wGMTI(this));
return;
}
}
offsetId2 = offsetId;
TLRPC.Message lastMessage3 = lastMessage2;
if (lastMessage3 != null) {
lastMessage2 = lastMessage3;
if (lastMessage2.date < date && offset != -1) {
for (int i6 = 0; i6 < 2; i6++) {
getUserConfig().setDialogsLoadOffset(i6, getUserConfig().migrateOffsetId, getUserConfig().migrateOffsetDate, getUserConfig().migrateOffsetUserId, getUserConfig().migrateOffsetChatId, getUserConfig().migrateOffsetChannelId, getUserConfig().migrateOffsetAccess);
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("migrate stop due to reached loaded dialogs " + LocaleController.getInstance().formatterStats.format(date * 1000));
}
offsetId2 = -1;
}
} else {
lastMessage2 = lastMessage3;
}
} else {
offsetId2 = offsetId;
}
cursor2.dispose();
getUserConfig().migrateOffsetDate = lastMessage2.date;
if (lastMessage2.to_id.channel_id != 0) {
getUserConfig().migrateOffsetChannelId = lastMessage2.to_id.channel_id;
getUserConfig().migrateOffsetChatId = 0;
getUserConfig().migrateOffsetUserId = 0;
int a5 = 0;
while (true) {
if (a5 >= dialogsRes.chats.size()) {
break;
}
TLRPC.Chat chat = (TLRPC.Chat) dialogsRes.chats.get(a5);
if (chat.id != getUserConfig().migrateOffsetChannelId) {
a5++;
} else {
getUserConfig().migrateOffsetAccess = chat.access_hash;
break;
}
}
} else if (lastMessage2.to_id.chat_id != 0) {
getUserConfig().migrateOffsetChatId = lastMessage2.to_id.chat_id;
getUserConfig().migrateOffsetChannelId = 0;
getUserConfig().migrateOffsetUserId = 0;
int a6 = 0;
while (true) {
if (a6 >= dialogsRes.chats.size()) {
break;
}
TLRPC.Chat chat2 = (TLRPC.Chat) dialogsRes.chats.get(a6);
if (chat2.id != getUserConfig().migrateOffsetChatId) {
a6++;
} else {
getUserConfig().migrateOffsetAccess = chat2.access_hash;
break;
}
}
} else if (lastMessage2.to_id.user_id != 0) {
getUserConfig().migrateOffsetUserId = lastMessage2.to_id.user_id;
getUserConfig().migrateOffsetChatId = 0;
getUserConfig().migrateOffsetChannelId = 0;
int a7 = 0;
while (true) {
if (a7 >= dialogsRes.users.size()) {
break;
}
TLRPC.User user = (TLRPC.User) dialogsRes.users.get(a7);
if (user.id != getUserConfig().migrateOffsetUserId) {
a7++;
} else {
getUserConfig().migrateOffsetAccess = user.access_hash;
break;
}
}
}
processLoadedDialogs(dialogsRes, null, 0, offsetId2, 0, 0, false, true, false);
} catch (Exception e2) {
e = e2;
}
}
public void lambda$null$140$MessagesController() {
this.migratingDialogs = false;
}
public void lambda$null$142$MessagesController() {
this.migratingDialogs = false;
}
public void processLoadedDialogs(final TLRPC.messages_Dialogs dialogsRes, final ArrayList<TLRPC.EncryptedChat> encChats, final int folderId, final int offset, final int count, final int loadType, final boolean resetEnd, final boolean migrate, final boolean fromCache) {
if ((15 + 31) % 31 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((21 + 4) % 4 <= 0) {
}
MessagesController.this.lambda$processLoadedDialogs$146$MessagesController(folderId, loadType, dialogsRes, resetEnd, count, encChats, offset, fromCache, migrate);
}
});
}
public void lambda$processLoadedDialogs$146$MessagesController(final int r32, int r33, final im.amwhusedvt.tgnet.TLRPC.messages_Dialogs r34, final boolean r35, final int r36, java.util.ArrayList r37, int r38, boolean r39, boolean r40) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$processLoadedDialogs$146$MessagesController(int, int, im.amwhusedvt.tgnet.TLRPC$messages_Dialogs, boolean, int, java.util.ArrayList, int, boolean, boolean):void");
}
public void lambda$null$144$MessagesController(TLRPC.messages_Dialogs dialogsRes, int folderId, boolean resetEnd, int[] dialogsLoadOffset, int count) {
if ((22 + 21) % 21 <= 0) {
}
putUsers(dialogsRes.users, true);
this.loadingDialogs.put(folderId, false);
if (resetEnd) {
this.dialogsEndReached.put(folderId, false);
this.serverDialogsEndReached.put(folderId, false);
} else if (dialogsLoadOffset[0] == Integer.MAX_VALUE) {
this.dialogsEndReached.put(folderId, true);
this.serverDialogsEndReached.put(folderId, true);
} else {
loadDialogs(folderId, 0, count, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$null$145$MessagesController(int r29, im.amwhusedvt.tgnet.TLRPC.messages_Dialogs r30, java.util.ArrayList r31, boolean r32, int r33, android.util.LongSparseArray r34, android.util.LongSparseArray r35, android.util.SparseArray r36, int r37, boolean r38, int r39, java.util.ArrayList r40) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$null$145$MessagesController(int, im.amwhusedvt.tgnet.TLRPC$messages_Dialogs, java.util.ArrayList, boolean, int, android.util.LongSparseArray, android.util.LongSparseArray, android.util.SparseArray, int, boolean, int, java.util.ArrayList):void");
}
private void applyDialogNotificationsSettings(long dialog_id, TLRPC.PeerNotifySettings notify_settings) {
boolean updated;
int i;
if ((7 + 1) % 1 <= 0) {
}
if (notify_settings == null) {
return;
}
int currentValue = this.notificationsPreferences.getInt("notify2_" + dialog_id, -1);
int currentValue2 = this.notificationsPreferences.getInt("notifyuntil_" + dialog_id, 0);
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
TLRPC.Dialog dialog = this.dialogs_dict.get(dialog_id);
if (dialog != null) {
dialog.notify_settings = notify_settings;
}
if ((notify_settings.flags & 2) != 0) {
editor.putBoolean("silent_" + dialog_id, notify_settings.silent);
} else {
editor.remove("silent_" + dialog_id);
}
boolean updated2 = false;
if ((notify_settings.flags & 4) != 0) {
if (notify_settings.mute_until > getConnectionsManager().getCurrentTime()) {
int until = 0;
if (notify_settings.mute_until > getConnectionsManager().getCurrentTime() + 31536000) {
if (currentValue == 2) {
updated = false;
} else {
updated = true;
editor.putInt("notify2_" + dialog_id, 2);
if (dialog != null) {
dialog.notify_settings.mute_until = Integer.MAX_VALUE;
}
}
} else {
if (currentValue == 3 && currentValue2 == notify_settings.mute_until) {
updated = false;
} else {
updated = true;
editor.putInt("notify2_" + dialog_id, 3);
editor.putInt("notifyuntil_" + dialog_id, notify_settings.mute_until);
if (dialog != null) {
dialog.notify_settings.mute_until = 0;
}
}
until = notify_settings.mute_until;
}
getMessagesStorage().setDialogFlags(dialog_id, (until << 32) | 1);
getNotificationsController().removeNotificationsForDialog(dialog_id);
} else {
if (currentValue != 0 && currentValue != 1) {
if (dialog == null) {
i = 0;
} else {
i = 0;
dialog.notify_settings.mute_until = 0;
}
editor.putInt("notify2_" + dialog_id, i);
updated2 = true;
}
getMessagesStorage().setDialogFlags(dialog_id, 0L);
updated = updated2;
}
} else {
if (currentValue != -1) {
if (dialog != null) {
dialog.notify_settings.mute_until = 0;
}
editor.remove("notify2_" + dialog_id);
updated2 = true;
}
getMessagesStorage().setDialogFlags(dialog_id, 0L);
updated = updated2;
}
editor.commit();
if (updated) {
getNotificationCenter().postNotificationName(NotificationCenter.notificationsSettingsUpdated, new Object[0]);
}
}
private void applyDialogsNotificationsSettings(ArrayList<TLRPC.Dialog> dialogs) {
int dialog_id;
if ((6 + 15) % 15 <= 0) {
}
SharedPreferences.Editor editor = null;
for (int a = 0; a < dialogs.size(); a++) {
TLRPC.Dialog dialog = dialogs.get(a);
if (dialog.peer != null && (dialog.notify_settings instanceof TLRPC.TL_peerNotifySettings)) {
if (editor == null) {
editor = this.notificationsPreferences.edit();
}
if (dialog.peer.user_id != 0) {
dialog_id = dialog.peer.user_id;
} else if (dialog.peer.chat_id != 0) {
dialog_id = -dialog.peer.chat_id;
} else {
dialog_id = -dialog.peer.channel_id;
}
if ((dialog.notify_settings.flags & 2) != 0) {
editor.putBoolean("silent_" + dialog_id, dialog.notify_settings.silent);
} else {
editor.remove("silent_" + dialog_id);
}
if ((dialog.notify_settings.flags & 4) == 0) {
editor.remove("notify2_" + dialog_id);
} else if (dialog.notify_settings.mute_until <= getConnectionsManager().getCurrentTime()) {
editor.putInt("notify2_" + dialog_id, 0);
} else if (dialog.notify_settings.mute_until > getConnectionsManager().getCurrentTime() + 31536000) {
editor.putInt("notify2_" + dialog_id, 2);
dialog.notify_settings.mute_until = Integer.MAX_VALUE;
} else {
editor.putInt("notify2_" + dialog_id, 3);
editor.putInt("notifyuntil_" + dialog_id, dialog.notify_settings.mute_until);
}
}
}
if (editor != null) {
editor.commit();
}
}
public void reloadMentionsCountForChannels(ArrayList<Integer> arrayList) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.xgqx0dGNmkYBpKJvp47x-DwHAmY(this, arrayList));
}
public void lambda$reloadMentionsCountForChannels$149$MessagesController(ArrayList arrayList) {
if ((5 + 4) % 4 <= 0) {
}
for (int a = 0; a < arrayList.size(); a++) {
long dialog_id = -((Integer) arrayList.get(a)).intValue();
TLRPC.TL_messages_getUnreadMentions req = new TLRPC.TL_messages_getUnreadMentions();
req.peer = getInputPeer((int) dialog_id);
req.limit = 1;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.-0amwCUq8jSWvJAlBQWGRL5oYAY(this, dialog_id));
}
}
public void lambda$null$148$MessagesController(final long dialog_id, final TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((28 + 29) % 29 <= 0) {
}
MessagesController.this.lambda$null$147$MessagesController(response, dialog_id);
}
});
}
public void lambda$null$147$MessagesController(TLObject response, long dialog_id) {
int newCount;
if ((7 + 22) % 22 <= 0) {
}
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
if (res != null) {
if (res.count != 0) {
newCount = res.count;
} else {
newCount = res.messages.size();
}
getMessagesStorage().resetMentionsCount(dialog_id, newCount);
}
}
public void processDialogsUpdateRead(LongSparseArray<Integer> dialogsToUpdate, LongSparseArray<Integer> dialogsMentionsToUpdate) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.9Bs9BDd72Yqix2KpfqOaUC8jHk0(this, dialogsToUpdate, dialogsMentionsToUpdate));
}
public void lambda$processDialogsUpdateRead$150$MessagesController(LongSparseArray dialogsToUpdate, LongSparseArray dialogsMentionsToUpdate) {
if ((18 + 2) % 2 <= 0) {
}
if (dialogsToUpdate != null) {
for (int a = 0; a < dialogsToUpdate.size(); a++) {
long dialogId = dialogsToUpdate.keyAt(a);
TLRPC.Dialog currentDialog = this.dialogs_dict.get(dialogId);
if (currentDialog != null) {
int prevCount = currentDialog.unread_count;
currentDialog.unread_count = ((Integer) dialogsToUpdate.valueAt(a)).intValue();
if (prevCount != 0 && currentDialog.unread_count == 0 && !isDialogMuted(dialogId)) {
this.unreadUnmutedDialogs--;
} else if (prevCount == 0 && !currentDialog.unread_mark && currentDialog.unread_count != 0) {
this.dialogsUnreadOnly.add(currentDialog);
if (!isDialogMuted(dialogId)) {
this.unreadUnmutedDialogs++;
}
}
}
}
}
if (dialogsMentionsToUpdate != null) {
for (int a2 = 0; a2 < dialogsMentionsToUpdate.size(); a2++) {
TLRPC.Dialog currentDialog2 = this.dialogs_dict.get(dialogsMentionsToUpdate.keyAt(a2));
if (currentDialog2 != null) {
currentDialog2.unread_mentions_count = ((Integer) dialogsMentionsToUpdate.valueAt(a2)).intValue();
if (this.createdDialogMainThreadIds.contains(Long.valueOf(currentDialog2.id))) {
getNotificationCenter().postNotificationName(NotificationCenter.updateMentionsCount, Long.valueOf(currentDialog2.id), Integer.valueOf(currentDialog2.unread_mentions_count));
}
}
}
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE));
if (dialogsToUpdate != null) {
getNotificationsController().processDialogsUpdateRead(dialogsToUpdate);
}
}
protected void checkLastDialogMessage(TLRPC.Dialog dialog, TLRPC.InputPeer peer, long taskId) {
long newTaskId;
if ((22 + 3) % 3 <= 0) {
}
int lower_id = (int) dialog.id;
if (lower_id == 0 || this.checkingLastMessagesDialogs.indexOfKey(lower_id) >= 0) {
return;
}
TLRPC.TL_messages_getHistory req = new TLRPC.TL_messages_getHistory();
req.peer = peer == null ? getInputPeer(lower_id) : peer;
if (req.peer == null) {
return;
}
req.limit = 1;
this.checkingLastMessagesDialogs.put(lower_id, true);
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(req.peer.getObjectSize() + 60);
data.writeInt32(14);
data.writeInt64(dialog.id);
data.writeInt32(dialog.top_message);
data.writeInt32(dialog.read_inbox_max_id);
data.writeInt32(dialog.read_outbox_max_id);
data.writeInt32(dialog.unread_count);
data.writeInt32(dialog.last_message_date);
data.writeInt32(dialog.pts);
data.writeInt32(dialog.flags);
data.writeBool(dialog.pinned);
data.writeInt32(dialog.pinnedNum);
data.writeInt32(dialog.unread_mentions_count);
data.writeBool(dialog.unread_mark);
data.writeInt32(dialog.folder_id);
peer.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
long newTaskId2 = getMessagesStorage().createPendingTask(data);
newTaskId = newTaskId2;
} else {
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.P6nGdHlzaTN_eGSbx2OPVK3wj0A(this, lower_id, dialog, newTaskId));
}
public void lambda$checkLastDialogMessage$153$MessagesController(final int lower_id, final TLRPC.Dialog dialog, long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((4 + 1) % 1 <= 0) {
}
if (response != null) {
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
removeDeletedMessagesFromArray(lower_id, res.messages);
if (res.messages.isEmpty()) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((27 + 24) % 24 <= 0) {
}
MessagesController.this.lambda$null$151$MessagesController(dialog);
}
});
} else {
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
TLRPC.Message newMessage = (TLRPC.Message) res.messages.get(0);
TLRPC.TL_dialog tL_dialog = new TLRPC.TL_dialog();
((TLRPC.Dialog) tL_dialog).flags = dialog.flags;
((TLRPC.Dialog) tL_dialog).top_message = newMessage.id;
((TLRPC.Dialog) tL_dialog).last_message_date = newMessage.date;
((TLRPC.Dialog) tL_dialog).notify_settings = dialog.notify_settings;
((TLRPC.Dialog) tL_dialog).pts = dialog.pts;
((TLRPC.Dialog) tL_dialog).unread_count = dialog.unread_count;
((TLRPC.Dialog) tL_dialog).unread_mark = dialog.unread_mark;
((TLRPC.Dialog) tL_dialog).unread_mentions_count = dialog.unread_mentions_count;
((TLRPC.Dialog) tL_dialog).read_inbox_max_id = dialog.read_inbox_max_id;
((TLRPC.Dialog) tL_dialog).read_outbox_max_id = dialog.read_outbox_max_id;
((TLRPC.Dialog) tL_dialog).pinned = dialog.pinned;
((TLRPC.Dialog) tL_dialog).pinnedNum = dialog.pinnedNum;
((TLRPC.Dialog) tL_dialog).folder_id = dialog.folder_id;
long j = dialog.id;
((TLRPC.Dialog) tL_dialog).id = j;
newMessage.dialog_id = j;
dialogs.users.addAll(res.users);
dialogs.chats.addAll(res.chats);
dialogs.dialogs.add(tL_dialog);
dialogs.messages.addAll(res.messages);
dialogs.count = 1;
processDialogsUpdate(dialogs, null);
getMessagesStorage().putMessages(res.messages, true, true, false, getDownloadController().getAutodownloadMask(), true);
}
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((21 + 31) % 31 <= 0) {
}
MessagesController.this.lambda$null$152$MessagesController(lower_id);
}
});
}
public void lambda$null$151$MessagesController(TLRPC.Dialog dialog) {
if ((16 + 4) % 4 <= 0) {
}
TLRPC.Dialog currentDialog = this.dialogs_dict.get(dialog.id);
if (currentDialog != null && currentDialog.top_message == 0) {
deleteDialog(dialog.id, 3);
}
}
public void lambda$null$152$MessagesController(int lower_id) {
this.checkingLastMessagesDialogs.delete(lower_id);
}
public void processDialogsUpdate(final TLRPC.messages_Dialogs dialogsRes, ArrayList<TLRPC.EncryptedChat> arrayList) {
if ((1 + 24) % 24 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((21 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$processDialogsUpdate$155$MessagesController(dialogsRes);
}
});
}
public void lambda$processDialogsUpdate$155$MessagesController(TLRPC.messages_Dialogs dialogsRes) {
int a;
long j;
TLRPC.Chat chat;
MessageObject mess;
TLRPC.Chat chat2;
if ((15 + 16) % 16 <= 0) {
}
LongSparseArray<TLRPC.Dialog> new_dialogs_dict = new LongSparseArray<>();
LongSparseArray<MessageObject> new_dialogMessage = new LongSparseArray<>();
SparseArray<TLRPC.User> usersDict = new SparseArray<>(dialogsRes.users.size());
SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>(dialogsRes.chats.size());
LongSparseArray<Integer> dialogsToUpdate = new LongSparseArray<>();
for (int a2 = 0; a2 < dialogsRes.users.size(); a2++) {
TLRPC.User u = (TLRPC.User) dialogsRes.users.get(a2);
usersDict.put(u.id, u);
}
for (int a3 = 0; a3 < dialogsRes.chats.size(); a3++) {
TLRPC.Chat c = (TLRPC.Chat) dialogsRes.chats.get(a3);
chatsDict.put(c.id, c);
}
while (true) {
j = 0;
if (a >= dialogsRes.messages.size()) {
break;
}
TLRPC.Message message = (TLRPC.Message) dialogsRes.messages.get(a);
long j2 = this.proxyDialogId;
if (j2 == 0 || j2 != message.dialog_id) {
if (message.to_id.channel_id != 0) {
TLRPC.Chat chat3 = chatsDict.get(message.to_id.channel_id);
a = (chat3 != null && chat3.left) ? a + 1 : 0;
} else if (message.to_id.chat_id != 0 && (chat2 = chatsDict.get(message.to_id.chat_id)) != null && chat2.migrated_to != null) {
}
}
MessageObject messageObject = new MessageObject(this.currentAccount, message, usersDict, chatsDict, false);
new_dialogMessage.put(messageObject.getDialogId(), messageObject);
}
int a4 = 0;
while (a4 < dialogsRes.dialogs.size()) {
TLRPC.Dialog d = (TLRPC.Dialog) dialogsRes.dialogs.get(a4);
DialogObject.initDialog(d);
long j3 = this.proxyDialogId;
if (j3 == j || j3 != d.id) {
if (DialogObject.isChannel(d)) {
TLRPC.Chat chat4 = chatsDict.get(-((int) d.id));
if (chat4 != null && chat4.left) {
a4++;
j = 0;
}
} else if (((int) d.id) < 0 && (chat = chatsDict.get(-((int) d.id))) != null && chat.migrated_to != null) {
a4++;
j = 0;
}
}
if (d.last_message_date == 0 && (mess = new_dialogMessage.get(d.id)) != null) {
d.last_message_date = mess.messageOwner.date;
}
new_dialogs_dict.put(d.id, d);
dialogsToUpdate.put(d.id, Integer.valueOf(d.unread_count));
Integer value = this.dialogs_read_inbox_max.get(Long.valueOf(d.id));
if (value == null) {
value = 0;
}
this.dialogs_read_inbox_max.put(Long.valueOf(d.id), Integer.valueOf(Math.max(value.intValue(), d.read_inbox_max_id)));
Integer value2 = this.dialogs_read_outbox_max.get(Long.valueOf(d.id));
if (value2 == null) {
value2 = 0;
}
this.dialogs_read_outbox_max.put(Long.valueOf(d.id), Integer.valueOf(Math.max(value2.intValue(), d.read_outbox_max_id)));
a4++;
j = 0;
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.UdXg5vX0fO7dKRfTprV8-yqwItM(this, dialogsRes, new_dialogs_dict, new_dialogMessage, dialogsToUpdate));
}
public void lambda$null$154$MessagesController(TLRPC.messages_Dialogs dialogsRes, LongSparseArray new_dialogs_dict, LongSparseArray new_dialogMessage, LongSparseArray dialogsToUpdate) {
TLRPC.Dialog value;
TLRPC.Dialog value2;
if ((3 + 2) % 2 <= 0) {
}
int i = 1;
putUsers(dialogsRes.users, true);
putChats(dialogsRes.chats, true);
int a = 0;
while (a < new_dialogs_dict.size()) {
long key = new_dialogs_dict.keyAt(a);
TLRPC.Dialog value3 = (TLRPC.Dialog) new_dialogs_dict.valueAt(a);
TLRPC.Dialog currentDialog = this.dialogs_dict.get(key);
if (currentDialog == null) {
int offset = this.nextDialogsCacheOffset.get(value3.folder_id, 0) + i;
this.nextDialogsCacheOffset.put(value3.folder_id, offset);
this.dialogs_dict.put(key, value3);
MessageObject messageObject = (MessageObject) new_dialogMessage.get(value3.id);
this.dialogMessage.put(key, messageObject);
if (messageObject != null && messageObject.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
if (messageObject.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject.messageOwner.random_id, messageObject);
}
}
} else {
currentDialog.unread_count = value3.unread_count;
if (currentDialog.unread_mentions_count == value3.unread_mentions_count) {
value = value3;
} else {
currentDialog.unread_mentions_count = value3.unread_mentions_count;
if (!this.createdDialogMainThreadIds.contains(Long.valueOf(currentDialog.id))) {
value = value3;
} else {
value = value3;
getNotificationCenter().postNotificationName(NotificationCenter.updateMentionsCount, Long.valueOf(currentDialog.id), Integer.valueOf(currentDialog.unread_mentions_count));
}
}
MessageObject oldMsg = this.dialogMessage.get(key);
if (oldMsg == null) {
value2 = value;
} else if (currentDialog.top_message > 0) {
value2 = value;
} else {
TLRPC.Dialog value4 = value;
MessageObject newMsg = (MessageObject) new_dialogMessage.get(value4.id);
if (oldMsg.deleted || newMsg == null || newMsg.messageOwner.date > oldMsg.messageOwner.date) {
this.dialogs_dict.put(key, value4);
this.dialogMessage.put(key, newMsg);
if (newMsg != null && newMsg.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(newMsg.getId(), newMsg);
if (newMsg.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(newMsg.messageOwner.random_id, newMsg);
}
}
this.dialogMessagesByIds.remove(oldMsg.getId());
if (oldMsg.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.remove(oldMsg.messageOwner.random_id);
}
}
}
if ((oldMsg != null && oldMsg.deleted) || value2.top_message > currentDialog.top_message) {
this.dialogs_dict.put(key, value2);
MessageObject messageObject2 = (MessageObject) new_dialogMessage.get(value2.id);
this.dialogMessage.put(key, messageObject2);
if (messageObject2 != null && messageObject2.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject2.getId(), messageObject2);
if (messageObject2.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject2.messageOwner.random_id, messageObject2);
}
}
if (oldMsg != null) {
this.dialogMessagesByIds.remove(oldMsg.getId());
if (oldMsg.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.remove(oldMsg.messageOwner.random_id);
}
}
if (messageObject2 == null) {
checkLastDialogMessage(value2, null, 0L);
}
}
}
a++;
i = 1;
}
this.allDialogs.clear();
int size = this.dialogs_dict.size();
for (int a2 = 0; a2 < size; a2++) {
this.allDialogs.add(this.dialogs_dict.valueAt(a2));
}
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
getNotificationsController().processDialogsUpdateRead(dialogsToUpdate);
}
public void addToViewsQueue(MessageObject messageObject) {
if ((6 + 22) % 22 <= 0) {
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.Svkw0ZET_GJj6Ww8BisCdUzYWyQ(this, messageObject));
}
public void lambda$addToViewsQueue$156$MessagesController(MessageObject messageObject) {
if ((16 + 25) % 25 <= 0) {
}
int peer = (int) messageObject.getDialogId();
int id = messageObject.getId();
ArrayList<Integer> ids = this.channelViewsToSend.get(peer);
if (ids == null) {
ids = new ArrayList<>();
this.channelViewsToSend.put(peer, ids);
}
if (!ids.contains(Integer.valueOf(id))) {
ids.add(Integer.valueOf(id));
}
}
public void addToPollsQueue(long dialogId, ArrayList<MessageObject> visibleObjects) {
if ((9 + 31) % 31 <= 0) {
}
SparseArray<MessageObject> array = this.pollsToCheck.get(dialogId);
if (array == null) {
array = new SparseArray<>();
this.pollsToCheck.put(dialogId, array);
this.pollsToCheckSize++;
}
int N = array.size();
for (int a = 0; a < N; a++) {
array.valueAt(a).pollVisibleOnScreen = false;
}
int N2 = visibleObjects.size();
for (int a2 = 0; a2 < N2; a2++) {
MessageObject messageObject = visibleObjects.get(a2);
if (messageObject.type == 17) {
int id = messageObject.getId();
MessageObject object = array.get(id);
if (object != null) {
object.pollVisibleOnScreen = true;
} else {
array.put(id, messageObject);
}
}
}
}
public void markMessageContentAsRead(MessageObject messageObject) {
if ((6 + 22) % 22 <= 0) {
}
if (messageObject.scheduled) {
return;
}
ArrayList<Long> arrayList = new ArrayList<>();
long messageId = messageObject.getId();
if (messageObject.messageOwner.to_id.channel_id != 0) {
messageId |= messageObject.messageOwner.to_id.channel_id << 32;
}
if (messageObject.messageOwner.mentioned) {
getMessagesStorage().markMentionMessageAsRead(messageObject.getId(), messageObject.messageOwner.to_id.channel_id, messageObject.getDialogId());
}
arrayList.add(Long.valueOf(messageId));
getMessagesStorage().markMessagesContentAsRead(arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.messagesReadContent, arrayList);
if (messageObject.getId() < 0) {
markMessageAsRead(messageObject.getDialogId(), messageObject.messageOwner.random_id, Integer.MIN_VALUE);
return;
}
if (messageObject.messageOwner.to_id.channel_id != 0) {
TLRPC.TL_channels_readMessageContents req = new TLRPC.TL_channels_readMessageContents();
req.channel = getInputChannel(messageObject.messageOwner.to_id.channel_id);
if (req.channel == null) {
return;
}
req.id.add(Integer.valueOf(messageObject.getId()));
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$markMessageContentAsRead$157(tLObject, tL_error);
}
});
return;
}
TLRPC.TL_messages_readMessageContents req2 = new TLRPC.TL_messages_readMessageContents();
req2.id.add(Integer.valueOf(messageObject.getId()));
getConnectionsManager().sendRequest(req2, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$markMessageContentAsRead$158$MessagesController(tLObject, tL_error);
}
});
}
static void lambda$markMessageContentAsRead$157(TLObject response, TLRPC.TL_error error) {
}
public void lambda$markMessageContentAsRead$158$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((10 + 2) % 2 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
}
}
public void markMentionMessageAsRead(int mid, int channelId, long did) {
if ((1 + 20) % 20 <= 0) {
}
getMessagesStorage().markMentionMessageAsRead(mid, channelId, did);
if (channelId != 0) {
TLRPC.TL_channels_readMessageContents req = new TLRPC.TL_channels_readMessageContents();
req.channel = getInputChannel(channelId);
if (req.channel == null) {
return;
}
req.id.add(Integer.valueOf(mid));
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$markMentionMessageAsRead$159(tLObject, tL_error);
}
});
return;
}
TLRPC.TL_messages_readMessageContents req2 = new TLRPC.TL_messages_readMessageContents();
req2.id.add(Integer.valueOf(mid));
getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.Wtb5O85M-nqc8TNPmJQEPrUDbvA(this));
}
static void lambda$markMentionMessageAsRead$159(TLObject response, TLRPC.TL_error error) {
}
public void lambda$markMentionMessageAsRead$160$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((11 + 25) % 25 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
}
}
public void markMessageAsRead(int mid, int channelId, TLRPC.InputChannel inputChannel, int ttl, long taskId) {
TLRPC.InputChannel inputChannel2;
long newTaskId;
if ((15 + 24) % 24 <= 0) {
}
if (mid == 0 || ttl <= 0) {
return;
}
if (channelId != 0 && inputChannel == null) {
TLRPC.InputChannel inputChannel3 = getInputChannel(channelId);
if (inputChannel3 != null) {
inputChannel2 = inputChannel3;
} else {
return;
}
} else {
inputChannel2 = inputChannel;
}
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(16 + (inputChannel2 != null ? inputChannel2.getObjectSize() : 0));
data.writeInt32(11);
data.writeInt32(mid);
data.writeInt32(channelId);
data.writeInt32(ttl);
if (channelId != 0) {
inputChannel2.serializeToStream(data);
}
} catch (Exception e) {
FileLog.e(e);
}
long newTaskId2 = getMessagesStorage().createPendingTask(data);
newTaskId = newTaskId2;
} else {
newTaskId = taskId;
}
int time = getConnectionsManager().getCurrentTime();
getMessagesStorage().createTaskForMid(mid, channelId, time, time, ttl, false);
if (channelId != 0) {
TLRPC.TL_channels_readMessageContents req = new TLRPC.TL_channels_readMessageContents();
req.channel = inputChannel2;
req.id.add(Integer.valueOf(mid));
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.4NPLM_8zOLHqYJ9WammrxQc9lV8(this, newTaskId));
return;
}
TLRPC.TL_messages_readMessageContents req2 = new TLRPC.TL_messages_readMessageContents();
req2.id.add(Integer.valueOf(mid));
getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.TgxwV0BwE8DrVpTOfY9nn-zubnk(this, newTaskId));
}
public void lambda$markMessageAsRead$161$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((9 + 11) % 11 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void lambda$markMessageAsRead$162$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((29 + 25) % 25 <= 0) {
}
if (error == null) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void markMessageAsRead(long dialog_id, long random_id, int ttl) {
TLRPC.EncryptedChat chat;
if ((4 + 17) % 17 <= 0) {
}
if (random_id == 0 || dialog_id == 0) {
return;
}
if (ttl <= 0 && ttl != Integer.MIN_VALUE) {
return;
}
int lower_part = (int) dialog_id;
int high_id = (int) (dialog_id >> 32);
if (lower_part != 0 || (chat = getEncryptedChat(Integer.valueOf(high_id))) == null) {
return;
}
ArrayList<Long> random_ids = new ArrayList<>();
random_ids.add(Long.valueOf(random_id));
getSecretChatHelper().sendMessagesReadMessage(chat, random_ids, (TLRPC.Message) null);
if (ttl > 0) {
int time = getConnectionsManager().getCurrentTime();
getMessagesStorage().createTaskForSecretChat(chat.id, time, time, 0, random_ids);
}
}
private void completeReadTask(ReadTask task) {
TLRPC.TL_channels_readHistory request;
if ((19 + 4) % 4 <= 0) {
}
int lower_part = (int) task.dialogId;
int high_id = (int) (task.dialogId >> 32);
if (lower_part != 0) {
TLRPC.InputPeer inputPeer = getInputPeer(lower_part);
if (inputPeer instanceof TLRPC.TL_inputPeerChannel) {
request = new TLRPC.TL_channels_readHistory();
request.channel = getInputChannel(-lower_part);
request.max_id = task.maxId;
} else {
request = new TLRPC.TL_messages_readHistory();
((TLRPC.TL_messages_readHistory) request).peer = inputPeer;
((TLRPC.TL_messages_readHistory) request).max_id = task.maxId;
}
getConnectionsManager().sendRequest(request, new -$.Lambda.MessagesController.VBXoqr8qUo9U_nrxh-ROkq9bPgQ(this));
return;
}
TLRPC.EncryptedChat chat = getEncryptedChat(Integer.valueOf(high_id));
if (chat.auth_key != null && chat.auth_key.length > 1 && (chat instanceof TLRPC.TL_encryptedChat)) {
TLRPC.TL_messages_readEncryptedHistory req = new TLRPC.TL_messages_readEncryptedHistory();
req.peer = new TLRPC.TL_inputEncryptedChat();
req.peer.chat_id = chat.id;
req.peer.access_hash = chat.access_hash;
req.max_date = task.maxDate;
getConnectionsManager().sendRequest(req, -$.Lambda.MessagesController.UmO9_bieTJAZQhX7ab5quqW0oCU.INSTANCE);
}
}
public void lambda$completeReadTask$163$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((10 + 4) % 4 <= 0) {
}
if (error == null && (response instanceof TLRPC.TL_messages_affectedMessages)) {
TLRPC.TL_messages_affectedMessages res = (TLRPC.TL_messages_affectedMessages) response;
processNewDifferenceParams(-1, res.pts, -1, res.pts_count);
}
}
static void lambda$completeReadTask$164(TLObject response, TLRPC.TL_error error) {
}
private void checkReadTasks() {
if ((11 + 3) % 3 <= 0) {
}
long time = SystemClock.elapsedRealtime();
int a = 0;
int size = this.readTasks.size();
while (a < size) {
ReadTask task = this.readTasks.get(a);
if (task.sendRequestTime <= time) {
completeReadTask(task);
this.readTasks.remove(a);
this.readTasksMap.remove(task.dialogId);
a--;
size--;
}
a++;
}
}
public void markDialogAsReadNow(final long dialogId) {
if ((6 + 11) % 11 <= 0) {
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((15 + 2) % 2 <= 0) {
}
MessagesController.this.lambda$markDialogAsReadNow$165$MessagesController(dialogId);
}
});
}
public void lambda$markDialogAsReadNow$165$MessagesController(long dialogId) {
if ((20 + 4) % 4 <= 0) {
}
ReadTask currentReadTask = this.readTasksMap.get(dialogId);
if (currentReadTask == null) {
return;
}
completeReadTask(currentReadTask);
this.readTasks.remove(currentReadTask);
this.readTasksMap.remove(dialogId);
}
public void markMentionsAsRead(long dialogId) {
if ((18 + 13) % 13 <= 0) {
}
if (((int) dialogId) == 0) {
return;
}
getMessagesStorage().resetMentionsCount(dialogId, 0);
TLRPC.TL_messages_readMentions req = new TLRPC.TL_messages_readMentions();
req.peer = getInputPeer((int) dialogId);
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.lambda$markMentionsAsRead$166(tLObject, tL_error);
}
});
}
static void lambda$markMentionsAsRead$166(TLObject response, TLRPC.TL_error error) {
}
public void markDialogAsRead(final long r26, final int r28, final int r29, final int r30, final boolean r31, final int r32, final boolean r33, int r34) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.markDialogAsRead(long, int, int, int, boolean, int, boolean, int):void");
}
public void lambda$markDialogAsRead$168$MessagesController(final long dialogId, final int countDiff, final int maxPositiveId, final boolean countMessages, final boolean popup) {
if ((22 + 14) % 14 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((17 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$null$167$MessagesController(dialogId, countDiff, maxPositiveId, countMessages, popup);
}
});
}
public void lambda$null$167$MessagesController(long dialogId, int countDiff, int maxPositiveId, boolean countMessages, boolean popup) {
TLRPC.Dialog folder;
if ((12 + 11) % 11 <= 0) {
}
TLRPC.Dialog dialog = this.dialogs_dict.get(dialogId);
if (dialog != null) {
int prevCount = dialog.unread_count;
if (countDiff != 0 && maxPositiveId < dialog.top_message) {
dialog.unread_count = Math.max(dialog.unread_count - countDiff, 0);
if (maxPositiveId != Integer.MIN_VALUE && dialog.unread_count > dialog.top_message - maxPositiveId) {
dialog.unread_count = dialog.top_message - maxPositiveId;
}
} else {
dialog.unread_count = 0;
}
if (dialog.folder_id != 0 && (folder = this.dialogs_dict.get(DialogObject.makeFolderDialogId(dialog.folder_id))) != null) {
if (countMessages) {
if (isDialogMuted(dialog.id)) {
folder.unread_count -= prevCount - dialog.unread_count;
} else {
folder.unread_mentions_count -= prevCount - dialog.unread_count;
}
} else if (dialog.unread_count == 0) {
if (isDialogMuted(dialog.id)) {
folder.unread_count--;
} else {
folder.unread_mentions_count--;
}
}
}
if ((prevCount != 0 || dialog.unread_mark) && dialog.unread_count == 0 && !isDialogMuted(dialogId)) {
this.unreadUnmutedDialogs--;
}
if (dialog.unread_mark) {
dialog.unread_mark = false;
getMessagesStorage().setDialogUnread(dialog.id, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE));
}
if (!popup) {
getNotificationsController().processReadMessages(null, dialogId, 0, maxPositiveId, false);
LongSparseArray<Integer> dialogsToUpdate = new LongSparseArray<>(1);
dialogsToUpdate.put(dialogId, 0);
getNotificationsController().processDialogsUpdateRead(dialogsToUpdate);
return;
}
getNotificationsController().processReadMessages(null, dialogId, 0, maxPositiveId, true);
LongSparseArray<Integer> dialogsToUpdate2 = new LongSparseArray<>(1);
dialogsToUpdate2.put(dialogId, -1);
getNotificationsController().processDialogsUpdateRead(dialogsToUpdate2);
}
public void lambda$markDialogAsRead$170$MessagesController(final long dialogId, final int maxDate, final boolean popup, final int countDiff, final int maxNegativeId, final boolean countMessages) {
if ((4 + 2) % 2 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((29 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$null$169$MessagesController(dialogId, maxDate, popup, countDiff, maxNegativeId, countMessages);
}
});
}
public void lambda$null$169$MessagesController(long dialogId, int maxDate, boolean popup, int countDiff, int maxNegativeId, boolean countMessages) {
TLRPC.Dialog folder;
if ((21 + 7) % 7 <= 0) {
}
getNotificationsController().processReadMessages(null, dialogId, maxDate, 0, popup);
TLRPC.Dialog dialog = this.dialogs_dict.get(dialogId);
if (dialog != null) {
int prevCount = dialog.unread_count;
if (countDiff == 0 || maxNegativeId <= dialog.top_message) {
dialog.unread_count = 0;
} else {
dialog.unread_count = Math.max(dialog.unread_count - countDiff, 0);
if (maxNegativeId != Integer.MAX_VALUE && dialog.unread_count > maxNegativeId - dialog.top_message) {
dialog.unread_count = maxNegativeId - dialog.top_message;
}
}
if (dialog.folder_id != 0 && (folder = this.dialogs_dict.get(DialogObject.makeFolderDialogId(dialog.folder_id))) != null) {
if (countMessages) {
if (isDialogMuted(dialog.id)) {
folder.unread_count -= prevCount - dialog.unread_count;
} else {
folder.unread_mentions_count -= prevCount - dialog.unread_count;
}
} else if (dialog.unread_count == 0) {
if (isDialogMuted(dialog.id)) {
folder.unread_count--;
} else {
folder.unread_mentions_count--;
}
}
}
if ((prevCount != 0 || dialog.unread_mark) && dialog.unread_count == 0 && !isDialogMuted(dialogId)) {
this.unreadUnmutedDialogs--;
}
if (dialog.unread_mark) {
dialog.unread_mark = false;
getMessagesStorage().setDialogUnread(dialog.id, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE));
}
LongSparseArray<Integer> dialogsToUpdate = new LongSparseArray<>(1);
dialogsToUpdate.put(dialogId, 0);
getNotificationsController().processDialogsUpdateRead(dialogsToUpdate);
}
public void lambda$markDialogAsRead$171$MessagesController(long dialogId, boolean readNow, int maxDate, int maxPositiveId) {
if ((2 + 1) % 1 <= 0) {
}
ReadTask currentReadTask = this.readTasksMap.get(dialogId);
if (currentReadTask == null) {
currentReadTask = new ReadTask();
currentReadTask.dialogId = dialogId;
currentReadTask.sendRequestTime = SystemClock.elapsedRealtime() + 5000;
if (!readNow) {
this.readTasksMap.put(dialogId, currentReadTask);
this.readTasks.add(currentReadTask);
}
}
currentReadTask.maxDate = maxDate;
currentReadTask.maxId = maxPositiveId;
if (readNow) {
completeReadTask(currentReadTask);
}
}
public int createChat(String title, ArrayList<Integer> selectedContacts, String about, int type, BDLocation location, String locationAddress, final BaseFragment fragment) {
if ((19 + 23) % 23 <= 0) {
}
if (type != 0) {
if (type == 2 || type == 4) {
final TLRPC.TL_channels_createChannel req = new TLRPC.TL_channels_createChannel();
req.title = title;
req.about = about != null ? about : "";
if (type == 4) {
req.megagroup = true;
} else {
req.broadcast = true;
}
if (location != null) {
req.geo_point = new TLRPC.TL_inputGeoPoint();
req.geo_point.lat = location.getLatitude();
req.geo_point._long = location.getLongitude();
req.address = locationAddress;
req.flags = 4 | req.flags;
}
return getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((8 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$createChat$177$MessagesController(fragment, req, tLObject, tL_error);
}
}, 2);
}
return 0;
}
TLRPC.TL_messages_createChat req2 = new TLRPC.TL_messages_createChat();
req2.title = title;
for (int a = 0; a < selectedContacts.size(); a++) {
TLRPC.User user = getUser(selectedContacts.get(a));
if (user != null) {
req2.users.add(getInputUser(user));
}
}
return getConnectionsManager().sendRequest(req2, new -$.Lambda.MessagesController.CxKZSm0MNBLi0gbwZr6157NjXYs(this, fragment, req2), 2);
}
public void lambda$createChat$174$MessagesController(final BaseFragment fragment, final TLRPC.TL_messages_createChat req, TLObject response, final TLRPC.TL_error error) {
if ((16 + 11) % 11 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((23 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$null$172$MessagesController(error, fragment, req);
}
});
return;
}
final TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((13 + 16) % 16 <= 0) {
}
MessagesController.this.lambda$null$173$MessagesController(updates);
}
});
}
public void lambda$null$172$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLRPC.TL_messages_createChat req) {
if ((26 + 21) % 21 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
public void lambda$null$173$MessagesController(TLRPC.Updates updates) {
if ((27 + 24) % 24 <= 0) {
}
putUsers(updates.users, false);
putChats(updates.chats, false);
if (updates.chats != null && !updates.chats.isEmpty()) {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidCreated, Integer.valueOf(((TLRPC.Chat) updates.chats.get(0)).id));
} else {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
}
public void lambda$createChat$177$MessagesController(final BaseFragment fragment, final TLRPC.TL_channels_createChannel req, TLObject response, final TLRPC.TL_error error) {
if ((23 + 9) % 9 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((22 + 30) % 30 <= 0) {
}
MessagesController.this.lambda$null$175$MessagesController(error, fragment, req);
}
});
return;
}
final TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((6 + 22) % 22 <= 0) {
}
MessagesController.this.lambda$null$176$MessagesController(updates);
}
});
}
public void lambda$null$175$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLRPC.TL_channels_createChannel req) {
if ((12 + 5) % 5 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
public void lambda$null$176$MessagesController(TLRPC.Updates updates) {
if ((19 + 2) % 2 <= 0) {
}
putUsers(updates.users, false);
putChats(updates.chats, false);
if (updates.chats != null && !updates.chats.isEmpty()) {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidCreated, Integer.valueOf(((TLRPC.Chat) updates.chats.get(0)).id));
} else {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
}
public int createMegaGroup(String title, final ArrayList<Integer> selectedContacts, String about, int type, BDLocation location, String locationAddress, final BaseFragment fragment, boolean forbidContact) {
if ((28 + 16) % 16 <= 0) {
}
if (type == 2 || type == 4) {
final TLRPCChats.TL_channels_createChannel_v1 req = new TLRPCChats.TL_channels_createChannel_v1();
req.title = title;
req.about = about != null ? about : "";
req.ban_add_contact = forbidContact;
if (type == 4) {
req.megagroup = true;
} else {
req.broadcast = true;
}
if (location != null) {
req.geo_point = new TLRPC.TL_inputGeoPoint();
req.geo_point.lat = location.getLatitude();
req.geo_point._long = location.getLongitude();
req.address = locationAddress;
req.flags = 4 | req.flags;
}
return getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((12 + 5) % 5 <= 0) {
}
MessagesController.this.lambda$createMegaGroup$180$MessagesController(fragment, req, selectedContacts, tLObject, tL_error);
}
}, 2);
}
return 0;
}
public void lambda$createMegaGroup$180$MessagesController(BaseFragment fragment, TLRPCChats.TL_channels_createChannel_v1 req, ArrayList selectedContacts, TLObject response, TLRPC.TL_error error) {
if ((24 + 4) % 4 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.1VPx6olLp_fmbBzY6DBXOvtp8WQ(this, error, fragment, req));
return;
}
TLRPC.Updates updates = (TLRPC.Updates) response;
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.2rqG2_hxyEaArbdbKZsVoMzdpfk(this, updates));
ArrayList<TLRPC.InputUser> result = new ArrayList<>();
for (int a = 0; a < selectedContacts.size(); a++) {
TLRPC.InputUser user = getInstance(this.currentAccount).getInputUser(getInstance(this.currentAccount).getUser((Integer) selectedContacts.get(a)));
if (user != null) {
result.add(user);
}
}
int a2 = this.currentAccount;
getInstance(a2).addUsersToChannelWithCreate((TLRPC.Chat) updates.chats.get(0), result, null);
processUpdates(updates, false);
}
public void lambda$null$178$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLRPCChats.TL_channels_createChannel_v1 req) {
if ((4 + 20) % 20 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
public void lambda$null$179$MessagesController(TLRPC.Updates updates) {
if ((20 + 13) % 13 <= 0) {
}
putUsers(updates.users, false);
putChats(updates.chats, false);
if (updates.chats != null && !updates.chats.isEmpty()) {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidCreated, Integer.valueOf(((TLRPC.Chat) updates.chats.get(0)).id));
} else {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
}
public void addUsersToChannelWithCreate(TLRPC.Chat chat, ArrayList<TLRPC.InputUser> users, BaseFragment fragment) {
if ((17 + 16) % 16 <= 0) {
}
if (users == null || users.isEmpty()) {
return;
}
TLRPC.TL_channels_inviteToChannel req = new TLRPC.TL_channels_inviteToChannel();
req.channel = getInputChannel(chat);
req.users = users;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.GD7gA9WKUiozMpBPvYgrqxNRtt8(this, fragment, req));
}
public void lambda$addUsersToChannelWithCreate$182$MessagesController(final BaseFragment fragment, final TLRPC.TL_channels_inviteToChannel req, TLObject response, final TLRPC.TL_error error) {
if ((13 + 17) % 17 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((16 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$null$181$MessagesController(error, fragment, req);
}
});
} else {
processUpdates((TLRPC.Updates) response, false);
}
}
public void lambda$null$181$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLRPC.TL_channels_inviteToChannel req) {
if ((20 + 20) % 20 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[]{true});
}
public void convertToMegaGroup(final Context context, int chat_id, final BaseFragment fragment, final MessagesStorage.IntCallback convertRunnable) {
if ((1 + 28) % 28 <= 0) {
}
final TLRPC.TL_messages_migrateChat req = new TLRPC.TL_messages_migrateChat();
req.chat_id = chat_id;
final AlertDialog progressDialog = new AlertDialog(context, 3);
int reqId = getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((30 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$convertToMegaGroup$186$MessagesController(context, progressDialog, convertRunnable, fragment, req, tLObject, tL_error);
}
});
progressDialog.setOnCancelListener(new -$.Lambda.MessagesController.jrv9CX56eI7ARFR_KYgoHXWIEQI(this, reqId));
try {
progressDialog.show();
} catch (Exception e) {
}
}
public void lambda$convertToMegaGroup$186$MessagesController(final Context context, final AlertDialog progressDialog, final MessagesStorage.IntCallback convertRunnable, final BaseFragment fragment, final TLRPC.TL_messages_migrateChat req, TLObject response, final TLRPC.TL_error error) {
if ((15 + 8) % 8 <= 0) {
}
if (error == null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.oWJa6jxASQEse6cPIy-CIq4BLsg(context, progressDialog));
TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.gETTPhYPWc-98syJJuQLAVwpYaE(convertRunnable, updates));
return;
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((13 + 24) % 24 <= 0) {
}
MessagesController.this.lambda$null$185$MessagesController(convertRunnable, context, progressDialog, error, fragment, req);
}
});
}
static void lambda$null$183(Context context, AlertDialog progressDialog) {
if (!((Activity) context).isFinishing()) {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
}
}
static void lambda$null$184(MessagesStorage.IntCallback convertRunnable, TLRPC.Updates updates) {
if ((16 + 30) % 30 <= 0) {
}
if (convertRunnable != null) {
for (int a = 0; a < updates.chats.size(); a++) {
TLRPC.Chat chat = (TLRPC.Chat) updates.chats.get(a);
if (ChatObject.isChannel(chat)) {
convertRunnable.run(chat.id);
return;
}
}
}
}
public void lambda$null$185$MessagesController(MessagesStorage.IntCallback convertRunnable, Context context, AlertDialog progressDialog, TLRPC.TL_error error, BaseFragment fragment, TLRPC.TL_messages_migrateChat req) {
if ((20 + 32) % 32 <= 0) {
}
if (convertRunnable != null) {
convertRunnable.run(0);
}
if (!((Activity) context).isFinishing()) {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[]{false});
}
}
public void lambda$convertToMegaGroup$187$MessagesController(int reqId, DialogInterface dialog) {
if ((29 + 16) % 16 <= 0) {
}
getConnectionsManager().cancelRequest(reqId, true);
}
public void addUsersToChannel(int chat_id, ArrayList<TLRPC.InputUser> users, BaseFragment fragment) {
if ((7 + 3) % 3 <= 0) {
}
if (users == null || users.isEmpty()) {
return;
}
TLRPC.TL_channels_inviteToChannel req = new TLRPC.TL_channels_inviteToChannel();
req.channel = getInputChannel(chat_id);
req.users = users;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.l3JZM3mFQ75jPuneoeq22WHtbIE(this, fragment, req));
}
public void lambda$addUsersToChannel$189$MessagesController(BaseFragment fragment, TLRPC.TL_channels_inviteToChannel req, TLObject response, TLRPC.TL_error error) {
if ((13 + 8) % 8 <= 0) {
}
if (error != null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.aD2LZTBW5L6qPhd8hXzlqowDW5U(this, error, fragment, req));
} else {
processUpdates((TLRPC.Updates) response, false);
}
}
public void lambda$null$188$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLRPC.TL_channels_inviteToChannel req) {
if ((18 + 5) % 5 <= 0) {
}
AlertsCreator.processError(this.currentAccount, error, fragment, req, new Object[]{true});
}
public void toogleChannelSignatures(int chat_id, boolean enabled) {
if ((12 + 32) % 32 <= 0) {
}
TLRPC.TL_channels_toggleSignatures req = new TLRPC.TL_channels_toggleSignatures();
req.channel = getInputChannel(chat_id);
req.enabled = enabled;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$toogleChannelSignatures$191$MessagesController(tLObject, tL_error);
}
}, 64);
}
public void lambda$toogleChannelSignatures$191$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((22 + 28) % 28 <= 0) {
}
if (response != null) {
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$null$190$MessagesController();
}
});
}
}
public void lambda$null$190$MessagesController() {
if ((20 + 9) % 9 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_CHAT));
}
public void toogleChannelInvitesHistory(int chat_id, boolean enabled) {
if ((15 + 1) % 1 <= 0) {
}
TLRPC.TL_channels_togglePreHistoryHidden req = new TLRPC.TL_channels_togglePreHistoryHidden();
req.channel = getInputChannel(chat_id);
req.enabled = enabled;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$toogleChannelInvitesHistory$193$MessagesController(tLObject, tL_error);
}
}, 64);
}
public void lambda$toogleChannelInvitesHistory$193$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((27 + 31) % 31 <= 0) {
}
if (response != null) {
processUpdates((TLRPC.Updates) response, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.oatrnbcVQWLeB4ltsKFMg4Q-ytg(this));
}
}
public void lambda$null$192$MessagesController() {
if ((29 + 10) % 10 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_CHAT));
}
public void updateChatAbout(int chat_id, String about, TLRPC.ChatFull info) {
if ((24 + 24) % 24 <= 0) {
}
if (info == null) {
return;
}
TLRPC.TL_messages_editChatAbout req = new TLRPC.TL_messages_editChatAbout();
req.peer = getInputPeer(-chat_id);
req.about = about;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.zB6EkJtr1Jt-RRhXaoX7T8Tnj4w(this, info, about), 64);
}
public void lambda$updateChatAbout$195$MessagesController(final TLRPC.ChatFull info, final String about, TLObject response, TLRPC.TL_error error) {
if (response instanceof TLRPC.TL_boolTrue) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((2 + 23) % 23 <= 0) {
}
MessagesController.this.lambda$null$194$MessagesController(info, about);
}
});
}
}
public void lambda$null$194$MessagesController(TLRPC.ChatFull info, String about) {
if ((30 + 17) % 17 <= 0) {
}
info.about = about;
getMessagesStorage().updateChatInfo(info, false);
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, info, 0, false, null);
}
public void updateChannelUserName(int chat_id, String userName) {
if ((32 + 1) % 1 <= 0) {
}
TLRPC.TL_channels_updateUsername req = new TLRPC.TL_channels_updateUsername();
req.channel = getInputChannel(chat_id);
req.username = userName;
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.u3AGkgXzj22LKxPACx4X5FNRIaQ(this, chat_id, userName), 64);
}
public void lambda$updateChannelUserName$197$MessagesController(final int chat_id, final String userName, TLObject response, TLRPC.TL_error error) {
if (response instanceof TLRPC.TL_boolTrue) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((30 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$null$196$MessagesController(chat_id, userName);
}
});
}
}
public void lambda$null$196$MessagesController(int chat_id, String userName) {
if ((30 + 14) % 14 <= 0) {
}
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
if (userName.length() != 0) {
chat.flags |= 64;
} else {
chat.flags &= -65;
}
chat.username = userName;
ArrayList<TLRPC.Chat> arrayList = new ArrayList<>();
arrayList.add(chat);
getMessagesStorage().putUsersAndChats((ArrayList) null, arrayList, true, true);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_CHAT));
}
public void sendBotStart(TLRPC.User user, String botHash) {
if ((8 + 15) % 15 <= 0) {
}
if (user == null) {
return;
}
TLRPC.TL_messages_startBot req = new TLRPC.TL_messages_startBot();
req.bot = getInputUser(user);
req.peer = getInputPeer(user.id);
req.start_param = botHash;
req.random_id = Utilities.random.nextLong();
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.geth7_n3d7e1Dg-MyUwxH1EZeXM(this));
}
public void lambda$sendBotStart$198$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((14 + 6) % 6 <= 0) {
}
if (error != null) {
return;
}
processUpdates((TLRPC.Updates) response, false);
}
public boolean isJoiningChannel(int chat_id) {
if ((28 + 8) % 8 <= 0) {
}
return this.joiningToChannels.contains(Integer.valueOf(chat_id));
}
public void addUserToChat(int chat_id, TLRPC.User user, TLRPC.ChatFull info, int count_fwd, String botHash, BaseFragment fragment, Runnable onFinishRunnable) {
TLObject request;
if ((10 + 2) % 2 <= 0) {
}
if (user == null) {
return;
}
boolean z = false;
if (chat_id > 0) {
boolean isChannel = ChatObject.isChannel(chat_id, this.currentAccount);
if (isChannel && getChat(Integer.valueOf(chat_id)).megagroup) {
z = true;
}
boolean isMegagroup = z;
TLRPC.InputUser inputUser = getInputUser(user);
if (botHash == null || (isChannel && !isMegagroup)) {
if (isChannel) {
if (inputUser instanceof TLRPC.TL_inputUserSelf) {
if (this.joiningToChannels.contains(Integer.valueOf(chat_id))) {
return;
}
TLObject tL_channels_joinChannel = new TLRPC.TL_channels_joinChannel();
((TLRPC.TL_channels_joinChannel) tL_channels_joinChannel).channel = getInputChannel(chat_id);
this.joiningToChannels.add(Integer.valueOf(chat_id));
request = tL_channels_joinChannel;
} else {
TLObject tL_channels_inviteToChannel = new TLRPC.TL_channels_inviteToChannel();
((TLRPC.TL_channels_inviteToChannel) tL_channels_inviteToChannel).channel = getInputChannel(chat_id);
((TLRPC.TL_channels_inviteToChannel) tL_channels_inviteToChannel).users.add(inputUser);
request = tL_channels_inviteToChannel;
}
} else {
TLObject tL_messages_addChatUser = new TLRPC.TL_messages_addChatUser();
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).chat_id = chat_id;
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).fwd_limit = count_fwd;
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).user_id = inputUser;
request = tL_messages_addChatUser;
}
} else {
TLObject tL_messages_startBot = new TLRPC.TL_messages_startBot();
((TLRPC.TL_messages_startBot) tL_messages_startBot).bot = inputUser;
if (isChannel) {
((TLRPC.TL_messages_startBot) tL_messages_startBot).peer = getInputPeer(-chat_id);
} else {
((TLRPC.TL_messages_startBot) tL_messages_startBot).peer = new TLRPC.TL_inputPeerChat();
((TLRPC.TL_messages_startBot) tL_messages_startBot).peer.chat_id = chat_id;
}
((TLRPC.TL_messages_startBot) tL_messages_startBot).start_param = botHash;
((TLRPC.TL_messages_startBot) tL_messages_startBot).random_id = Utilities.random.nextLong();
request = tL_messages_startBot;
}
getConnectionsManager().sendRequest(request, new -$.Lambda.MessagesController.V_kK4y3-SNq5xTSC5gPmsloMrwo(this, isChannel, inputUser, chat_id, fragment, request, isMegagroup, onFinishRunnable));
return;
}
if (info instanceof TLRPC.TL_chatFull) {
for (int a = 0; a < info.participants.participants.size(); a++) {
if (((TLRPC.ChatParticipant) info.participants.participants.get(a)).user_id == user.id) {
return;
}
}
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
chat.participants_count++;
ArrayList<TLRPC.Chat> chatArrayList = new ArrayList<>();
chatArrayList.add(chat);
getMessagesStorage().putUsersAndChats((ArrayList) null, chatArrayList, true, true);
TLRPC.TL_chatParticipant newPart = new TLRPC.TL_chatParticipant();
newPart.user_id = user.id;
newPart.inviter_id = getUserConfig().getClientUserId();
newPart.date = getConnectionsManager().getCurrentTime();
info.participants.participants.add(0, newPart);
getMessagesStorage().updateChatInfo(info, true);
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, info, 0, false, null);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 32);
}
}
public void lambda$addUserToChat$202$MessagesController(boolean isChannel, TLRPC.InputUser inputUser, final int chat_id, BaseFragment fragment, TLObject request, boolean isMegagroup, Runnable onFinishRunnable, TLObject response, TLRPC.TL_error error) {
if ((32 + 15) % 15 <= 0) {
}
if (isChannel && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((3 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$null$199$MessagesController(chat_id);
}
});
}
if (error != null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.iKTivCcTnBK5kt9X3rV8gZPMEfg(this, error, fragment, request, isChannel, isMegagroup, inputUser));
return;
}
boolean hasJoinMessage = false;
TLRPC.Updates updates = (TLRPC.Updates) response;
int a = 0;
while (true) {
if (a >= updates.updates.size()) {
break;
}
TLRPC.TL_updateNewChannelMessage tL_updateNewChannelMessage = (TLRPC.Update) updates.updates.get(a);
if (!(tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewChannelMessage) || !(tL_updateNewChannelMessage.message.action instanceof TLRPC.TL_messageActionChatAddUser)) {
a++;
} else {
hasJoinMessage = true;
break;
}
}
processUpdates(updates, false);
if (isChannel) {
if (!hasJoinMessage && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
generateJoinMessage(chat_id, true);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((1 + 27) % 27 <= 0) {
}
MessagesController.this.lambda$null$201$MessagesController(chat_id);
}
}, 1000L);
}
if (isChannel && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
getMessagesStorage().updateDialogsWithDeletedMessages(new ArrayList(), (ArrayList) null, true, chat_id);
}
if (onFinishRunnable != null) {
AndroidUtilities.runOnUIThread(onFinishRunnable);
}
}
public void lambda$null$199$MessagesController(int chat_id) {
if ((21 + 9) % 9 <= 0) {
}
this.joiningToChannels.remove(Integer.valueOf(chat_id));
}
public void lambda$null$200$MessagesController(TLRPC.TL_error error, BaseFragment fragment, TLObject request, boolean isChannel, boolean isMegagroup, TLRPC.InputUser inputUser) {
if ((13 + 21) % 21 <= 0) {
}
int i = this.currentAccount;
Object[] objArr = new Object[1];
objArr[0] = Boolean.valueOf(isChannel && !isMegagroup);
AlertsCreator.processError(i, error, fragment, request, objArr);
if (isChannel && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_CHAT));
}
}
public void lambda$null$201$MessagesController(int chat_id) {
if ((5 + 12) % 12 <= 0) {
}
loadFullChat(chat_id, 0, true);
}
public void deleteUserFromChat(int chat_id, TLRPC.User user, TLRPC.ChatFull info) {
if ((12 + 21) % 21 <= 0) {
}
deleteUserFromChat(chat_id, user, info, false, false);
}
public void deleteUserFromChat(final int chat_id, TLRPC.User user, TLRPC.ChatFull info, boolean forceDelete, boolean revoke) {
TLRPC.TL_channels_deleteChannel req;
if ((1 + 21) % 21 <= 0) {
}
if (user == null) {
return;
}
if (chat_id <= 0) {
if (info instanceof TLRPC.TL_chatFull) {
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
chat.participants_count--;
ArrayList<TLRPC.Chat> chatArrayList = new ArrayList<>();
chatArrayList.add(chat);
getMessagesStorage().putUsersAndChats((ArrayList) null, chatArrayList, true, true);
boolean changed = false;
int a = 0;
while (true) {
if (a >= info.participants.participants.size()) {
break;
}
TLRPC.ChatParticipant p = (TLRPC.ChatParticipant) info.participants.participants.get(a);
if (p.user_id != user.id) {
a++;
} else {
info.participants.participants.remove(a);
changed = true;
break;
}
}
if (changed) {
getMessagesStorage().updateChatInfo(info, true);
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, info, 0, false, null);
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 32);
return;
}
return;
}
final TLRPC.InputUser inputUser = getInputUser(user);
TLRPC.Chat chat2 = getChat(Integer.valueOf(chat_id));
final boolean isChannel = ChatObject.isChannel(chat2);
if (isChannel) {
if (inputUser instanceof TLRPC.TL_inputUserSelf) {
if (chat2.creator && forceDelete) {
req = new TLRPC.TL_channels_deleteChannel();
req.channel = getInputChannel(chat2);
} else {
req = new TLRPC.TL_channels_leaveChannel();
((TLRPC.TL_channels_leaveChannel) req).channel = getInputChannel(chat2);
}
} else {
TLRPC.TL_channels_deleteChannel tL_channels_editBanned = new TLRPC.TL_channels_editBanned();
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).channel = getInputChannel(chat2);
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).user_id = inputUser;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights = new TLRPC.TL_chatBannedRights();
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.view_messages = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_media = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_messages = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_stickers = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_gifs = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_games = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_inline = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.embed_links = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.pin_messages = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.send_polls = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.invite_users = true;
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights.change_info = true;
req = tL_channels_editBanned;
}
} else {
req = new TLRPC.TL_messages_deleteChatUser();
((TLRPC.TL_messages_deleteChatUser) req).chat_id = chat_id;
((TLRPC.TL_messages_deleteChatUser) req).user_id = getInputUser(user);
}
if (user.id == getUserConfig().getClientUserId()) {
deleteDialog(-chat_id, 0, revoke);
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((23 + 6) % 6 <= 0) {
}
MessagesController.this.lambda$deleteUserFromChat$204$MessagesController(isChannel, inputUser, chat_id, tLObject, tL_error);
}
}, 64);
}
public void lambda$deleteUserFromChat$204$MessagesController(boolean isChannel, TLRPC.InputUser inputUser, int chat_id, TLObject response, TLRPC.TL_error error) {
if ((18 + 29) % 29 <= 0) {
}
if (error != null) {
return;
}
TLRPC.Updates updates = (TLRPC.Updates) response;
processUpdates(updates, false);
if (isChannel && !(inputUser instanceof TLRPC.TL_inputUserSelf)) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.42uy4NTTfHInBCG8ycuIGVn6rBY(this, chat_id), 1000L);
}
}
public void lambda$null$203$MessagesController(int chat_id) {
if ((32 + 18) % 18 <= 0) {
}
loadFullChat(chat_id, 0, true);
}
public void changeChatTitle(int chat_id, String title) {
TLRPC.TL_channels_editTitle req;
if ((24 + 14) % 14 <= 0) {
}
if (chat_id > 0) {
if (ChatObject.isChannel(chat_id, this.currentAccount)) {
req = new TLRPC.TL_channels_editTitle();
req.channel = getInputChannel(chat_id);
req.title = title;
} else {
req = new TLRPC.TL_messages_editChatTitle();
((TLRPC.TL_messages_editChatTitle) req).chat_id = chat_id;
((TLRPC.TL_messages_editChatTitle) req).title = title;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.m1iIQEX99GzjmITSZ6ZEmEIkdU8(this), 64);
return;
}
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
chat.title = title;
ArrayList<TLRPC.Chat> chatArrayList = new ArrayList<>();
chatArrayList.add(chat);
getMessagesStorage().putUsersAndChats((ArrayList) null, chatArrayList, true, true);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 16);
}
public void lambda$changeChatTitle$205$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((16 + 11) % 11 <= 0) {
}
if (error != null) {
return;
}
processUpdates((TLRPC.Updates) response, false);
}
public void changeChatAvatar(int chat_id, TLRPC.InputFile uploadedAvatar, final TLRPC.FileLocation smallSize, final TLRPC.FileLocation bigSize) {
TLRPC.TL_channels_editPhoto req;
if ((19 + 18) % 18 <= 0) {
}
if (ChatObject.isChannel(chat_id, this.currentAccount)) {
req = new TLRPC.TL_channels_editPhoto();
req.channel = getInputChannel(chat_id);
if (uploadedAvatar != null) {
req.photo = new TLRPC.TL_inputChatUploadedPhoto();
req.photo.file = uploadedAvatar;
} else {
req.photo = new TLRPC.TL_inputChatPhotoEmpty();
}
} else {
req = new TLRPC.TL_messages_editChatPhoto();
((TLRPC.TL_messages_editChatPhoto) req).chat_id = chat_id;
if (uploadedAvatar != null) {
((TLRPC.TL_messages_editChatPhoto) req).photo = new TLRPC.TL_inputChatUploadedPhoto();
((TLRPC.TL_messages_editChatPhoto) req).photo.file = uploadedAvatar;
} else {
((TLRPC.TL_messages_editChatPhoto) req).photo = new TLRPC.TL_inputChatPhotoEmpty();
}
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((20 + 24) % 24 <= 0) {
}
MessagesController.this.lambda$changeChatAvatar$206$MessagesController(smallSize, bigSize, tLObject, tL_error);
}
}, 64);
}
public void lambda$changeChatAvatar$206$MessagesController(TLRPC.FileLocation smallSize, TLRPC.FileLocation bigSize, TLObject response, TLRPC.TL_error error) {
if ((21 + 3) % 3 <= 0) {
}
if (error != null) {
return;
}
TLRPC.Updates updates = (TLRPC.Updates) response;
TLRPC.Photo photo = null;
int a = 0;
int N = updates.updates.size();
while (true) {
if (a >= N) {
break;
}
TLRPC.TL_updateNewChannelMessage tL_updateNewChannelMessage = (TLRPC.Update) updates.updates.get(a);
if (tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewChannelMessage) {
TLRPC.Message message = tL_updateNewChannelMessage.message;
if ((message.action instanceof TLRPC.TL_messageActionChatEditPhoto) && (message.action.photo instanceof TLRPC.TL_photo)) {
photo = message.action.photo;
break;
}
a++;
} else {
if (tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewMessage) {
TLRPC.Message message2 = ((TLRPC.TL_updateNewMessage) tL_updateNewChannelMessage).message;
if ((message2.action instanceof TLRPC.TL_messageActionChatEditPhoto) && (message2.action.photo instanceof TLRPC.TL_photo)) {
photo = message2.action.photo;
break;
}
} else {
continue;
}
a++;
}
}
if (photo != null) {
TLRPC.PhotoSize small = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 150);
if (small != null && smallSize != null) {
File destFile = FileLoader.getPathToAttach(small, true);
File src = FileLoader.getPathToAttach(smallSize, true);
src.renameTo(destFile);
String oldKey = smallSize.volume_id + "_" + smallSize.local_id + "@50_50";
String newKey = small.location.volume_id + "_" + small.location.local_id + "@50_50";
ImageLoader.getInstance().replaceImageInCache(oldKey, newKey, ImageLocation.getForPhoto(small, photo), true);
}
TLRPC.PhotoSize big = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 800);
if (big != null && bigSize != null) {
File destFile2 = FileLoader.getPathToAttach(big, true);
File src2 = FileLoader.getPathToAttach(bigSize, true);
src2.renameTo(destFile2);
}
}
processUpdates(updates, false);
}
public void unregistedPush() {
if ((20 + 17) % 17 <= 0) {
}
if (getUserConfig().registeredForPush && SharedConfig.pushString.length() == 0) {
TLRPC.TL_account_unregisterDevice req = new TLRPC.TL_account_unregisterDevice();
req.token = SharedConfig.pushString;
req.token_type = 2;
for (int a = 0; a < 3; a++) {
UserConfig userConfig = UserConfig.getInstance(a);
if (a != this.currentAccount && userConfig.isClientActivated()) {
req.other_uids.add(Integer.valueOf(userConfig.getClientUserId()));
}
}
getConnectionsManager().sendRequest(req, -$.Lambda.MessagesController.ROLOq4tuhSlpQ_oMp91lgQsEzCA.INSTANCE);
}
}
static void lambda$unregistedPush$207(TLObject response, TLRPC.TL_error error) {
}
public void generateUpdateMessage() {
if ((7 + 30) % 30 <= 0) {
}
if (BuildVars.DEBUG_VERSION || SharedConfig.lastUpdateVersion == null || SharedConfig.lastUpdateVersion.equals(BuildVars.BUILD_VERSION_STRING)) {
return;
}
TLRPC.TL_help_getAppChangelog req = new TLRPC.TL_help_getAppChangelog();
req.prev_app_version = SharedConfig.lastUpdateVersion;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$generateUpdateMessage$208$MessagesController(tLObject, tL_error);
}
});
}
public void lambda$generateUpdateMessage$208$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((1 + 6) % 6 <= 0) {
}
if (error == null) {
SharedConfig.lastUpdateVersion = BuildVars.BUILD_VERSION_STRING;
SharedConfig.saveConfig();
}
if (response instanceof TLRPC.Updates) {
processUpdates((TLRPC.Updates) response, false);
}
}
public void performLogout(int type) {
if ((6 + 12) % 12 <= 0) {
}
if (type == 1) {
unregistedPush();
TLRPC.TL_auth_logOut req = new TLRPC.TL_auth_logOut();
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.x-WMO7oVEnyqEl1r_OYlaGA_YJw(this));
} else {
getConnectionsManager().cleanup(type == 2);
}
getUserConfig().clearConfig();
getNotificationCenter().postNotificationName(NotificationCenter.appDidLogout, new Object[0]);
getMessagesStorage().cleanup(false);
cleanup();
getContactsController().deleteUnknownAppAccounts();
AndroidUtilities.runOnUIThread(-$.Lambda.MessagesController.9OqyQUjDBVKYCDOWnXlEQWvDBtw.INSTANCE);
}
public void lambda$performLogout$209$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((5 + 1) % 1 <= 0) {
}
getConnectionsManager().cleanup(false);
}
public void registerForPush(String regid) {
if ((3 + 9) % 9 <= 0) {
}
if (TextUtils.isEmpty(regid) || this.registeringForPush || getUserConfig().getClientUserId() == 0) {
return;
}
if (getUserConfig().registeredForPush && regid.equals(SharedConfig.pushString)) {
return;
}
this.registeringForPush = true;
this.lastPushRegisterSendTime = SystemClock.elapsedRealtime();
if (SharedConfig.pushAuthKey == null) {
SharedConfig.pushAuthKey = new byte[UPDATE_MASK_READ_DIALOG_MESSAGE];
Utilities.random.nextBytes(SharedConfig.pushAuthKey);
SharedConfig.saveConfig();
}
TLRPC.TL_account_registerDevice req = new TLRPC.TL_account_registerDevice();
req.token_type = 2;
req.token = regid;
req.no_muted = false;
req.secret = SharedConfig.pushAuthKey;
for (int a = 0; a < 3; a++) {
UserConfig userConfig = UserConfig.getInstance(a);
if (a != this.currentAccount && userConfig.isClientActivated()) {
int uid = userConfig.getClientUserId();
req.other_uids.add(Integer.valueOf(uid));
}
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.iDHrfbe00nY672_gmhLhqVrfY08(this, regid));
}
public void lambda$registerForPush$212$MessagesController(String regid, TLObject response, TLRPC.TL_error error) {
if ((13 + 7) % 7 <= 0) {
}
if (response instanceof TLRPC.TL_boolTrue) {
getUserConfig().registeredForPush = true;
SharedConfig.pushString = regid;
getUserConfig().saveConfig(false);
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$null$211$MessagesController();
}
});
}
public void lambda$null$211$MessagesController() {
this.registeringForPush = false;
}
public void registerForUPush(final String regid) {
if ((18 + 6) % 6 <= 0) {
}
if (TextUtils.isEmpty(regid) || this.registeringForPush || getUserConfig().getClientUserId() == 0) {
return;
}
if (getUserConfig().registeredForPush && regid.equals(SharedConfig.pushString)) {
return;
}
this.registeringForPush = true;
this.lastPushRegisterSendTime = SystemClock.elapsedRealtime();
if (SharedConfig.pushAuthKey == null) {
SharedConfig.pushAuthKey = new byte[UPDATE_MASK_READ_DIALOG_MESSAGE];
Utilities.random.nextBytes(SharedConfig.pushAuthKey);
SharedConfig.saveConfig();
}
TLRPC.TL_account_registerDevice req = new TLRPC.TL_account_registerDevice();
req.token_type = getPushDeviceType();
req.token = regid;
req.no_muted = false;
req.secret = SharedConfig.pushAuthKey;
for (int a = 0; a < 3; a++) {
UserConfig userConfig = UserConfig.getInstance(a);
if (a != this.currentAccount && userConfig.isClientActivated()) {
int uid = userConfig.getClientUserId();
req.other_uids.add(Integer.valueOf(uid));
if (BuildVars.LOGS_ENABLED) {
FileLog.d("add other uid = " + uid + " for account " + this.currentAccount);
}
}
}
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((21 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$registerForUPush$214$MessagesController(regid, tLObject, tL_error);
}
});
}
public void lambda$registerForUPush$214$MessagesController(String regid, TLObject response, TLRPC.TL_error error) {
if ((5 + 27) % 27 <= 0) {
}
if (response instanceof TLRPC.TL_boolTrue) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("account " + this.currentAccount + " registered for push");
}
getUserConfig().registeredForPush = true;
SharedConfig.pushString = regid;
getUserConfig().saveConfig(false);
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.CXjejYCjUVthPP5mHpHHyUkyIlk(this));
}
public void lambda$null$213$MessagesController() {
this.registeringForPush = false;
}
private int getPushDeviceType() {
if (MryDeviceHelper.isHuawei()) {
return 5;
}
if (MryDeviceHelper.isXiaomi()) {
return 6;
}
if (MryDeviceHelper.isOppo()) {
return 7;
}
return 8;
}
public void loadCurrentState() {
if ((7 + 2) % 2 <= 0) {
}
if (this.updatingState) {
return;
}
this.updatingState = true;
TLRPC.TL_updates_getState req = new TLRPC.TL_updates_getState();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$loadCurrentState$215$MessagesController(tLObject, tL_error);
}
});
}
public void lambda$loadCurrentState$215$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((17 + 15) % 15 <= 0) {
}
this.updatingState = false;
if (error == null) {
TLRPC.TL_updates_state res = (TLRPC.TL_updates_state) response;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("loadCurrentState ===> response = " + res.toString());
}
getMessagesStorage().setLastDateValue(res.date);
getMessagesStorage().setLastPtsValue(res.pts);
getMessagesStorage().setLastSeqValue(res.seq);
getMessagesStorage().setLastQtsValue(res.qts);
for (int a = 0; a < 3; a++) {
processUpdatesQueue(a, 2);
}
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
return;
}
if (error.code != 401) {
loadCurrentState();
}
}
private int getUpdateSeq(TLRPC.Updates updates) {
if (updates instanceof TLRPC.TL_updatesCombined) {
return updates.seq_start;
}
return updates.seq;
}
private void setUpdatesStartTime(int type, long time) {
if (type == 0) {
this.updatesStartWaitTimeSeq = time;
} else if (type == 1) {
this.updatesStartWaitTimePts = time;
} else if (type == 2) {
this.updatesStartWaitTimeQts = time;
}
}
public long getUpdatesStartTime(int type) {
if ((15 + 27) % 27 <= 0) {
}
if (type == 0) {
return this.updatesStartWaitTimeSeq;
}
if (type == 1) {
return this.updatesStartWaitTimePts;
}
if (type == 2) {
return this.updatesStartWaitTimeQts;
}
return 0L;
}
private int isValidUpdate(TLRPC.Updates updates, int type) {
if ((25 + 1) % 1 <= 0) {
}
if (type == 0) {
int seq = getUpdateSeq(updates);
if (getMessagesStorage().getLastSeqValue() + 1 == seq || getMessagesStorage().getLastSeqValue() == seq) {
return 0;
}
return getMessagesStorage().getLastSeqValue() < seq ? 1 : 2;
}
if (type == 1) {
if (updates.pts <= getMessagesStorage().getLastPtsValue()) {
return 2;
}
return getMessagesStorage().getLastPtsValue() + updates.pts_count == updates.pts ? 0 : 1;
}
if (type != 2) {
return 0;
}
if (updates.pts <= getMessagesStorage().getLastQtsValue()) {
return 2;
}
return getMessagesStorage().getLastQtsValue() + updates.updates.size() == updates.pts ? 0 : 1;
}
private void processChannelsUpdatesQueue(int channelId, int state) {
int updateState;
if ((22 + 9) % 9 <= 0) {
}
ArrayList<TLRPC.Updates> updatesQueue = this.updatesQueueChannels.get(channelId);
if (updatesQueue == null) {
return;
}
int channelPts = this.channelsPts.get(channelId);
if (!updatesQueue.isEmpty() && channelPts != 0) {
Collections.sort(updatesQueue, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
return MessagesController.lambda$processChannelsUpdatesQueue$216((TLRPC.Updates) obj, (TLRPC.Updates) obj2);
}
});
boolean anyProceed = false;
if (state == 2) {
this.channelsPts.put(channelId, updatesQueue.get(0).pts);
}
for (int a = 0; a < updatesQueue.size(); a = (a - 1) + 1) {
TLRPC.Updates updates = updatesQueue.get(a);
if (updates.pts <= channelPts) {
updateState = 2;
} else {
int updateState2 = updates.pts_count;
if (updateState2 + channelPts == updates.pts) {
updateState = 0;
} else {
updateState = 1;
}
}
if (updateState == 0) {
processUpdates(updates, true);
anyProceed = true;
updatesQueue.remove(a);
} else {
if (updateState == 1) {
long updatesStartWaitTime = this.updatesStartWaitTimeChannels.get(channelId);
if (updatesStartWaitTime != 0 && (anyProceed || Math.abs(System.currentTimeMillis() - updatesStartWaitTime) <= 1500)) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN CHANNEL " + channelId + " UPDATES QUEUE - will wait more time");
}
if (anyProceed) {
this.updatesStartWaitTimeChannels.put(channelId, System.currentTimeMillis());
return;
}
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN CHANNEL " + channelId + " UPDATES QUEUE - getChannelDifference ");
}
this.updatesStartWaitTimeChannels.delete(channelId);
this.updatesQueueChannels.remove(channelId);
getChannelDifference(channelId);
return;
}
updatesQueue.remove(a);
}
}
this.updatesQueueChannels.remove(channelId);
this.updatesStartWaitTimeChannels.delete(channelId);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("UPDATES CHANNEL " + channelId + " QUEUE PROCEED - OK");
return;
}
return;
}
this.updatesQueueChannels.remove(channelId);
}
static int lambda$processChannelsUpdatesQueue$216(TLRPC.Updates updates, TLRPC.Updates updates2) {
if ((3 + 19) % 19 <= 0) {
}
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
private void processUpdatesQueue(int type, int state) {
if ((11 + 15) % 15 <= 0) {
}
ArrayList<TLRPC.Updates> updatesQueue = null;
if (type == 0) {
updatesQueue = this.updatesQueueSeq;
Collections.sort(updatesQueue, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
return MessagesController.this.lambda$processUpdatesQueue$217$MessagesController((TLRPC.Updates) obj, (TLRPC.Updates) obj2);
}
});
} else if (type == 1) {
updatesQueue = this.updatesQueuePts;
Collections.sort(updatesQueue, -$.Lambda.MessagesController.OGBMeTvZ2xB5FV2awOi-LnMbkeg.INSTANCE);
} else if (type == 2) {
updatesQueue = this.updatesQueueQts;
Collections.sort(updatesQueue, new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
return MessagesController.lambda$processUpdatesQueue$219((TLRPC.Updates) obj, (TLRPC.Updates) obj2);
}
});
}
if (updatesQueue != null && !updatesQueue.isEmpty()) {
boolean anyProceed = false;
if (state == 2) {
TLRPC.Updates updates = updatesQueue.get(0);
if (type == 0) {
getMessagesStorage().setLastSeqValue(getUpdateSeq(updates));
} else if (type == 1) {
getMessagesStorage().setLastPtsValue(updates.pts);
} else {
getMessagesStorage().setLastQtsValue(updates.pts);
}
}
for (int a = 0; a < updatesQueue.size(); a = (a - 1) + 1) {
TLRPC.Updates updates2 = updatesQueue.get(a);
int updateState = isValidUpdate(updates2, type);
if (updateState == 0) {
processUpdates(updates2, true);
anyProceed = true;
updatesQueue.remove(a);
} else {
if (updateState == 1) {
if (getUpdatesStartTime(type) != 0 && (anyProceed || Math.abs(System.currentTimeMillis() - getUpdatesStartTime(type)) <= 1500)) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN UPDATES QUEUE - will wait more time");
}
if (anyProceed) {
setUpdatesStartTime(type, System.currentTimeMillis());
return;
}
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN UPDATES QUEUE - getDifference");
}
setUpdatesStartTime(type, 0L);
updatesQueue.clear();
getDifference();
return;
}
updatesQueue.remove(a);
}
}
updatesQueue.clear();
if (BuildVars.LOGS_ENABLED) {
FileLog.d("UPDATES QUEUE PROCEED - OK");
}
}
setUpdatesStartTime(type, 0L);
}
public int lambda$processUpdatesQueue$217$MessagesController(TLRPC.Updates updates, TLRPC.Updates updates2) {
if ((8 + 31) % 31 <= 0) {
}
return AndroidUtilities.compare(getUpdateSeq(updates), getUpdateSeq(updates2));
}
static int lambda$processUpdatesQueue$218(TLRPC.Updates updates, TLRPC.Updates updates2) {
if ((2 + 15) % 15 <= 0) {
}
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
static int lambda$processUpdatesQueue$219(TLRPC.Updates updates, TLRPC.Updates updates2) {
if ((8 + 28) % 28 <= 0) {
}
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
protected void loadUnknownChannel(TLRPC.Chat channel, long taskId) {
long newTaskId;
if ((1 + 24) % 24 <= 0) {
}
if (!(channel instanceof TLRPC.TL_channel) || this.gettingUnknownChannels.indexOfKey(channel.id) >= 0) {
return;
}
if (channel.access_hash == 0) {
if (taskId != 0) {
getMessagesStorage().removePendingTask(taskId);
return;
}
return;
}
TLRPC.TL_inputPeerChannel inputPeer = new TLRPC.TL_inputPeerChannel();
inputPeer.channel_id = channel.id;
inputPeer.access_hash = channel.access_hash;
this.gettingUnknownChannels.put(channel.id, true);
TLRPC.TL_messages_getPeerDialogs req = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = inputPeer;
req.peers.add(inputDialogPeer);
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(channel.getObjectSize() + 4);
data.writeInt32(0);
channel.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
newTaskId = getMessagesStorage().createPendingTask(data);
} else {
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.y2rSElZRFETym_hJ8n1g5UWJT4Q(this, newTaskId, channel));
}
public void lambda$loadUnknownChannel$220$MessagesController(long newTaskId, TLRPC.Chat channel, TLObject response, TLRPC.TL_error error) {
if ((25 + 25) % 25 <= 0) {
}
if (response != null) {
TLRPC.TL_messages_peerDialogs res = (TLRPC.TL_messages_peerDialogs) response;
if (!res.dialogs.isEmpty() && !res.chats.isEmpty() && !(res.dialogs.get(0) instanceof TLRPC.TL_dialogFolder)) {
TLRPC.TL_dialog dialog = (TLRPC.TL_dialog) res.dialogs.get(0);
TLRPC.TL_messages_dialogs dialogs = new TLRPC.TL_messages_dialogs();
dialogs.dialogs.addAll(res.dialogs);
dialogs.messages.addAll(res.messages);
dialogs.users.addAll(res.users);
dialogs.chats.addAll(res.chats);
processLoadedDialogs(dialogs, null, dialog.folder_id, 0, 1, this.DIALOGS_LOAD_TYPE_CHANNEL, false, false, false);
}
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
this.gettingUnknownChannels.delete(channel.id);
}
public void startShortPoll(TLRPC.Chat chat, boolean stop) {
if ((4 + 11) % 11 <= 0) {
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.mmaXcRGm9qKd54pG2Gec5CXuJNs(this, stop, chat));
}
public void lambda$startShortPoll$221$MessagesController(boolean stop, TLRPC.Chat chat) {
if ((29 + 23) % 23 <= 0) {
}
if (stop) {
this.needShortPollChannels.delete(chat.id);
if (chat.megagroup) {
this.needShortPollOnlines.delete(chat.id);
return;
}
return;
}
this.needShortPollChannels.put(chat.id, 0);
if (this.shortPollChannels.indexOfKey(chat.id) < 0) {
getChannelDifference(chat.id, 3, 0L, null);
}
if (chat.megagroup) {
this.needShortPollOnlines.put(chat.id, 0);
if (this.shortPollOnlines.indexOfKey(chat.id) < 0) {
this.shortPollOnlines.put(chat.id, 0);
}
}
}
private void getChannelDifference(int channelId) {
if ((20 + 3) % 3 <= 0) {
}
getChannelDifference(channelId, 0, 0L, null);
}
public static boolean isSupportUser(TLRPC.User user) {
if ((25 + 4) % 4 <= 0) {
}
return user != null && (user.support || user.id == 777000 || user.id == 333000 || user.id == 4240000 || user.id == 4244000 || user.id == 4245000 || user.id == 4246000 || user.id == 410000 || user.id == 420000 || user.id == 431000 || user.id == 431415000 || user.id == 434000 || user.id == 4243000 || user.id == 439000 || user.id == 449000 || user.id == 450000 || user.id == 452000 || user.id == 454000 || user.id == 4254000 || user.id == 455000 || user.id == 460000 || user.id == 470000 || user.id == 479000 || user.id == 796000 || user.id == 482000 || user.id == 490000 || user.id == 496000 || user.id == 497000 || user.id == 498000 || user.id == 4298000);
}
protected void getChannelDifference(final int channelId, final int newDialogType, long taskId, TLRPC.InputChannel inputChannel) {
int limit;
int channelPts;
TLRPC.InputChannel inputChannel2;
long newTaskId;
if ((19 + 27) % 27 <= 0) {
}
boolean gettingDifferenceChannel = this.gettingDifferenceChannels.get(channelId);
if (gettingDifferenceChannel) {
return;
}
if (newDialogType == 1) {
if (this.channelsPts.get(channelId) != 0) {
return;
}
limit = 1;
channelPts = 1;
} else {
int channelPts2 = this.channelsPts.get(channelId);
if (channelPts2 == 0) {
channelPts2 = getMessagesStorage().getChannelPtsSync(channelId);
if (channelPts2 != 0) {
this.channelsPts.put(channelId, channelPts2);
}
if (channelPts2 == 0 && (newDialogType == 2 || newDialogType == 3)) {
return;
}
}
if (channelPts2 != 0) {
limit = 100;
channelPts = channelPts2;
} else {
return;
}
}
if (inputChannel == null) {
TLRPC.Chat chat = getChat(Integer.valueOf(channelId));
if (chat == null && (chat = getMessagesStorage().getChatSync(channelId)) != null) {
putChat(chat, true);
}
inputChannel2 = getInputChannel(chat);
} else {
inputChannel2 = inputChannel;
}
if (inputChannel2 == null || inputChannel2.access_hash == 0) {
if (taskId != 0) {
getMessagesStorage().removePendingTask(taskId);
return;
}
return;
}
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(inputChannel2.getObjectSize() + 12);
data.writeInt32(6);
data.writeInt32(channelId);
data.writeInt32(newDialogType);
inputChannel2.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
long newTaskId2 = getMessagesStorage().createPendingTask(data);
newTaskId = newTaskId2;
} else {
newTaskId = taskId;
}
this.gettingDifferenceChannels.put(channelId, true);
TLRPC.TL_updates_getChannelDifference req = new TLRPC.TL_updates_getChannelDifference();
req.channel = inputChannel2;
req.filter = new TLRPC.TL_channelMessagesFilterEmpty();
req.pts = channelPts;
req.limit = limit;
req.force = newDialogType != 3;
final long j = newTaskId;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((15 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$getChannelDifference$230$MessagesController(channelId, newDialogType, j, tLObject, tL_error);
}
});
}
public void lambda$getChannelDifference$230$MessagesController(final int channelId, int newDialogType, long newTaskId, TLObject response, final TLRPC.TL_error error) {
TLRPC.Chat channel;
if ((11 + 17) % 17 <= 0) {
}
if (response == null) {
if (error != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((17 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$null$229$MessagesController(error, channelId);
}
});
this.gettingDifferenceChannels.delete(channelId);
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
return;
}
return;
}
return;
}
TLRPC.updates_ChannelDifference res = (TLRPC.updates_ChannelDifference) response;
SparseArray<TLRPC.User> usersDict = new SparseArray<>();
for (int a = 0; a < res.users.size(); a++) {
TLRPC.User user = (TLRPC.User) res.users.get(a);
usersDict.put(user.id, user);
}
int a2 = 0;
while (true) {
if (a2 >= res.chats.size()) {
channel = null;
break;
}
TLRPC.Chat chat = (TLRPC.Chat) res.chats.get(a2);
if (chat.id != channelId) {
a2++;
} else {
channel = chat;
break;
}
}
TLRPC.Chat channelFinal = channel;
ArrayList<TLRPC.TL_updateMessageID> msgUpdates = new ArrayList<>();
if (!res.other_updates.isEmpty()) {
int a3 = 0;
while (a3 < res.other_updates.size()) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC.Update) res.other_updates.get(a3);
if (tL_updateMessageID instanceof TLRPC.TL_updateMessageID) {
msgUpdates.add(tL_updateMessageID);
res.other_updates.remove(a3);
a3--;
}
a3++;
}
}
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.X-b5i6qTXn9uwcz6f12Nhy785Oc(this, res));
getMessagesStorage().getStorageQueue().postRunnable(new -$.Lambda.MessagesController.cLsO2pGCHIommLj_Tx3gdLetL68(this, msgUpdates, channelId, res, channelFinal, usersDict, newDialogType, newTaskId));
}
public void lambda$null$222$MessagesController(TLRPC.updates_ChannelDifference res) {
if ((10 + 22) % 22 <= 0) {
}
putUsers(res.users, false);
putChats(res.chats, false);
}
public void lambda$null$228$MessagesController(ArrayList msgUpdates, final int channelId, final TLRPC.updates_ChannelDifference res, final TLRPC.Chat channelFinal, final SparseArray usersDict, final int newDialogType, final long newTaskId) {
if ((28 + 14) % 14 <= 0) {
}
if (!msgUpdates.isEmpty()) {
final SparseArray<long[]> corrected = new SparseArray<>();
Iterator it = msgUpdates.iterator();
while (it.hasNext()) {
TLRPC.TL_updateMessageID update = (TLRPC.TL_updateMessageID) it.next();
long[] ids = getMessagesStorage().updateMessageStateAndId(update.random_id, (Integer) null, update.id, 0, false, channelId, -1);
if (ids != null) {
corrected.put(update.id, ids);
}
}
if (corrected.size() != 0) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((20 + 23) % 23 <= 0) {
}
MessagesController.this.lambda$null$223$MessagesController(corrected);
}
});
}
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public final void run() {
if ((20 + 9) % 9 <= 0) {
}
MessagesController.this.lambda$null$227$MessagesController(res, channelId, channelFinal, usersDict, newDialogType, newTaskId);
}
});
}
public void lambda$null$223$MessagesController(SparseArray corrected) {
if ((1 + 16) % 16 <= 0) {
}
for (int a = 0; a < corrected.size(); a++) {
int newId = corrected.keyAt(a);
long[] ids = (long[]) corrected.valueAt(a);
int oldId = (int) ids[1];
getSendMessagesHelper().processSentMessage(oldId);
getNotificationCenter().postNotificationName(NotificationCenter.messageReceivedByServer, Integer.valueOf(oldId), Integer.valueOf(newId), null, Long.valueOf(ids[0]), 0L, -1, false);
}
}
public void lambda$null$227$MessagesController(final im.amwhusedvt.tgnet.TLRPC.updates_ChannelDifference r22, int r23, im.amwhusedvt.tgnet.TLRPC.Chat r24, android.util.SparseArray r25, int r26, long r27) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$null$227$MessagesController(im.amwhusedvt.tgnet.TLRPC$updates_ChannelDifference, int, im.amwhusedvt.tgnet.TLRPC$Chat, android.util.SparseArray, int, long):void");
}
public void lambda$null$224$MessagesController(LongSparseArray messages) {
if ((15 + 7) % 7 <= 0) {
}
for (int a = 0; a < messages.size(); a++) {
long key = messages.keyAt(a);
ArrayList<MessageObject> value = (ArrayList) messages.valueAt(a);
updateInterfaceWithMessages(key, value, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$null$226$MessagesController(final ArrayList pushMessages, TLRPC.updates_ChannelDifference res) {
if ((9 + 16) % 16 <= 0) {
}
if (!pushMessages.isEmpty()) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((15 + 23) % 23 <= 0) {
}
MessagesController.this.lambda$null$225$MessagesController(pushMessages);
}
});
}
getMessagesStorage().putMessages(res.new_messages, true, true, false, getDownloadController().getAutodownloadMask(), false);
}
public void lambda$null$225$MessagesController(ArrayList pushMessages) {
if ((20 + 12) % 12 <= 0) {
}
getNotificationsController().processNewMessages(pushMessages, true, false, null);
}
public void lambda$null$229$MessagesController(TLRPC.TL_error error, int channelId) {
checkChannelError(error.text, channelId);
}
private void checkChannelError(String text, int channelId) {
char c;
if ((11 + 8) % 8 <= 0) {
}
int hashCode = text.hashCode();
if (hashCode == -1809401834) {
if (text.equals("USER_BANNED_IN_CHANNEL")) {
c = 2;
}
c = 65535;
} else if (hashCode != -795226617) {
if (hashCode == -471086771 && text.equals("CHANNEL_PUBLIC_GROUP_NA")) {
c = 1;
}
c = 65535;
} else {
if (text.equals("CHANNEL_PRIVATE")) {
c = 0;
}
c = 65535;
}
if (c == 0) {
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, Integer.valueOf(channelId), 0);
} else if (c == 1) {
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, Integer.valueOf(channelId), 1);
} else if (c == 2) {
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, Integer.valueOf(channelId), 2);
}
}
public void getDifference() {
if ((5 + 14) % 14 <= 0) {
}
getDifference(getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue(), false);
}
public void getDifference(int pts, int date, int qts, boolean slice) {
if ((3 + 23) % 23 <= 0) {
}
registerForPush(SharedConfig.pushString);
if (getMessagesStorage().getLastPtsValue() == 0) {
loadCurrentState();
return;
}
if (!slice && this.gettingDifference) {
return;
}
this.gettingDifference = true;
TLRPC.TL_updates_getDifference req = new TLRPC.TL_updates_getDifference();
req.pts = pts;
req.date = date;
req.qts = qts;
if (this.getDifferenceFirstSync) {
req.flags |= 1;
if (ApplicationLoader.isConnectedOrConnectingToWiFi()) {
req.pts_total_limit = 5000;
} else {
req.pts_total_limit = 1000;
}
this.getDifferenceFirstSync = false;
}
if (req.date == 0) {
req.date = getConnectionsManager().getCurrentTime();
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("getDiff start ===> act=" + this.currentAccount + " ,date=" + date + " ,pts=" + pts + " ,qts=" + qts);
}
getConnectionsManager().setIsUpdating(true);
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.1ZZ_SeUBfutVU2p8aasdFctqA0o(this, date, qts));
}
public void lambda$getDifference$239$MessagesController(int date, int qts, TLObject response, TLRPC.TL_error error) {
if ((28 + 14) % 14 <= 0) {
}
if (error != null) {
this.gettingDifference = false;
getConnectionsManager().setIsUpdating(false);
return;
}
final TLRPC.updates_Difference res = (TLRPC.updates_Difference) response;
if (BuildVars.DEBUG_VERSION) {
FileLog.d("getDiff success ===> act=" + this.currentAccount + " ,date=" + date + " ,res=" + res.toString());
}
if (res instanceof TLRPC.TL_updates_differenceTooLong) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.n1lw0M9T94xpwAUI9iiC4eOjies(this, res, date, qts));
return;
}
if (res instanceof TLRPC.TL_updates_differenceSlice) {
getDifference(res.intermediate_state.pts, res.intermediate_state.date, res.intermediate_state.qts, true);
}
final SparseArray<TLRPC.User> usersDict = new SparseArray<>();
final SparseArray<TLRPC.Chat> chatsDict = new SparseArray<>();
for (int a = 0; a < res.users.size(); a++) {
TLRPC.User user = (TLRPC.User) res.users.get(a);
usersDict.put(user.id, user);
}
for (int a2 = 0; a2 < res.chats.size(); a2++) {
TLRPC.Chat chat = (TLRPC.Chat) res.chats.get(a2);
chatsDict.put(chat.id, chat);
}
final ArrayList<TLRPC.TL_updateMessageID> msgUpdates = new ArrayList<>();
if (!res.other_updates.isEmpty()) {
int a3 = 0;
while (a3 < res.other_updates.size()) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC.Update) res.other_updates.get(a3);
if (tL_updateMessageID instanceof TLRPC.TL_updateMessageID) {
msgUpdates.add(tL_updateMessageID);
res.other_updates.remove(a3);
a3--;
} else if (getUpdateType(tL_updateMessageID) == 2) {
int channelId = getUpdateChannelId(tL_updateMessageID);
int channelPts = this.channelsPts.get(channelId);
if (channelPts == 0 && (channelPts = getMessagesStorage().getChannelPtsSync(channelId)) != 0) {
this.channelsPts.put(channelId, channelPts);
}
if (channelPts != 0 && getUpdatePts(tL_updateMessageID) <= channelPts) {
res.other_updates.remove(a3);
a3--;
}
}
a3++;
}
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.sATWtAQ9f1gzYh4NiACq9xzXEws(this, res));
getMessagesStorage().getStorageQueue().postRunnable(new Runnable() {
@Override
public final void run() {
if ((17 + 31) % 31 <= 0) {
}
MessagesController.this.lambda$null$238$MessagesController(res, msgUpdates, usersDict, chatsDict);
}
});
}
public void lambda$null$231$MessagesController(TLRPC.updates_Difference res, int date, int qts) {
if ((26 + 20) % 20 <= 0) {
}
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
resetDialogs(true, getMessagesStorage().getLastSeqValue(), res.pts, date, qts);
}
public void lambda$null$232$MessagesController(TLRPC.updates_Difference res) {
if ((18 + 9) % 9 <= 0) {
}
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
putUsers(res.users, false);
putChats(res.chats, false);
}
public void lambda$null$238$MessagesController(TLRPC.updates_Difference res, ArrayList msgUpdates, SparseArray usersDict, SparseArray chatsDict) {
if ((16 + 9) % 9 <= 0) {
}
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, false);
if (!msgUpdates.isEmpty()) {
final SparseArray<long[]> corrected = new SparseArray<>();
for (int a = 0; a < msgUpdates.size(); a++) {
TLRPC.TL_updateMessageID update = (TLRPC.TL_updateMessageID) msgUpdates.get(a);
long[] ids = getMessagesStorage().updateMessageStateAndId(update.random_id, (Integer) null, update.id, 0, false, 0, -1);
if (ids != null) {
corrected.put(update.id, ids);
}
}
int a2 = corrected.size();
if (a2 != 0) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((8 + 18) % 18 <= 0) {
}
MessagesController.this.lambda$null$233$MessagesController(corrected);
}
});
}
}
Utilities.stageQueue.postRunnable(new -$.Lambda.MessagesController.Muy6qbS42Ubt8Dyu18QSg1ZmkXs(this, res, usersDict, chatsDict));
}
public void lambda$null$233$MessagesController(SparseArray corrected) {
if ((13 + 20) % 20 <= 0) {
}
for (int a = 0; a < corrected.size(); a++) {
int newId = corrected.keyAt(a);
long[] ids = (long[]) corrected.valueAt(a);
int oldId = (int) ids[1];
getSendMessagesHelper().processSentMessage(oldId);
getNotificationCenter().postNotificationName(NotificationCenter.messageReceivedByServer, Integer.valueOf(oldId), Integer.valueOf(newId), null, Long.valueOf(ids[0]), 0L, -1, false);
}
}
public void lambda$null$237$MessagesController(final TLRPC.updates_Difference res, SparseArray usersDict, SparseArray chatsDict) {
TLRPC.User user;
if ((13 + 28) % 28 <= 0) {
}
if (!res.new_messages.isEmpty() || !res.new_encrypted_messages.isEmpty()) {
LongSparseArray<ArrayList<MessageObject>> messages = new LongSparseArray<>();
for (int b = 0; b < res.new_encrypted_messages.size(); b++) {
TLRPC.EncryptedMessage encryptedMessage = (TLRPC.EncryptedMessage) res.new_encrypted_messages.get(b);
ArrayList<TLRPC.Message> decryptedMessages = getSecretChatHelper().decryptMessage(encryptedMessage);
if (decryptedMessages != null && !decryptedMessages.isEmpty()) {
res.new_messages.addAll(decryptedMessages);
}
}
ImageLoader.saveMessagesThumbs(res.new_messages);
final ArrayList<MessageObject> pushMessages = new ArrayList<>();
int clientUserId = getUserConfig().getClientUserId();
for (int a = 0; a < res.new_messages.size(); a++) {
TLRPC.Message message = (TLRPC.Message) res.new_messages.get(a);
if (message.dialog_id == 0) {
if (message.to_id.chat_id != 0) {
message.dialog_id = -message.to_id.chat_id;
} else {
if (message.to_id.user_id == getUserConfig().getClientUserId()) {
message.to_id.user_id = message.from_id;
}
message.dialog_id = message.to_id.user_id;
}
}
if (((int) message.dialog_id) != 0) {
if ((message.action instanceof TLRPC.TL_messageActionChatDeleteUser) && (user = (TLRPC.User) usersDict.get(message.action.user_id)) != null && user.bot) {
message.reply_markup = new TLRPC.TL_replyKeyboardHide();
message.flags |= 64;
}
if ((message.action instanceof TLRPC.TL_messageActionChatMigrateTo) || (message.action instanceof TLRPC.TL_messageActionChannelCreate)) {
message.unread = false;
message.media_unread = false;
} else {
ConcurrentHashMap<Long, Integer> read_max = message.out ? this.dialogs_read_outbox_max : this.dialogs_read_inbox_max;
Integer value = read_max.get(Long.valueOf(message.dialog_id));
if (value == null) {
value = Integer.valueOf(getMessagesStorage().getDialogReadMax(message.out, message.dialog_id));
read_max.put(Long.valueOf(message.dialog_id), value);
}
message.unread = value.intValue() < message.id;
}
}
if (message.dialog_id == clientUserId) {
message.unread = false;
message.media_unread = false;
message.out = true;
}
MessageObject obj = new MessageObject(this.currentAccount, message, (SparseArray<TLRPC.User>) usersDict, (SparseArray<TLRPC.Chat>) chatsDict, this.createdDialogIds.contains(Long.valueOf(message.dialog_id)));
if ((!obj.isOut() || obj.messageOwner.from_scheduled) && obj.isUnread()) {
pushMessages.add(obj);
}
ArrayList<MessageObject> arr = messages.get(message.dialog_id);
if (arr == null) {
arr = new ArrayList<>();
messages.put(message.dialog_id, arr);
}
arr.add(obj);
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.P8TLtpLaC0Cg0Dm2PYCgpg-A_ME(this, messages));
getMessagesStorage().getStorageQueue().postRunnable(new Runnable() {
@Override
public final void run() {
if ((11 + 14) % 14 <= 0) {
}
MessagesController.this.lambda$null$236$MessagesController(pushMessages, res);
}
});
getSecretChatHelper().processPendingEncMessages();
}
if (!res.other_updates.isEmpty()) {
processUpdateArray(res.other_updates, res.users, res.chats, true, 0);
}
if (res instanceof TLRPC.TL_updates_difference) {
this.gettingDifference = false;
getMessagesStorage().setLastSeqValue(res.state.seq);
getMessagesStorage().setLastDateValue(res.state.date);
getMessagesStorage().setLastPtsValue(res.state.pts);
getMessagesStorage().setLastQtsValue(res.state.qts);
getConnectionsManager().setIsUpdating(false);
for (int a2 = 0; a2 < 3; a2++) {
processUpdatesQueue(a2, 1);
}
} else if (res instanceof TLRPC.TL_updates_differenceSlice) {
getMessagesStorage().setLastDateValue(res.intermediate_state.date);
getMessagesStorage().setLastPtsValue(res.intermediate_state.pts);
getMessagesStorage().setLastQtsValue(res.intermediate_state.qts);
} else if (res instanceof TLRPC.TL_updates_differenceEmpty) {
this.gettingDifference = false;
getMessagesStorage().setLastSeqValue(res.seq);
getMessagesStorage().setLastDateValue(res.date);
getConnectionsManager().setIsUpdating(false);
for (int a3 = 0; a3 < 3; a3++) {
processUpdatesQueue(a3, 1);
}
}
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
if (BuildVars.LOGS_ENABLED) {
FileLog.d("getDiff save last diff value ===> act=" + this.currentAccount + " ,date=" + getMessagesStorage().getLastDateValue() + " ,pts=" + getMessagesStorage().getLastPtsValue() + " ,seq=" + getMessagesStorage().getLastSeqValue() + " ,qts=" + getMessagesStorage().getLastQtsValue());
}
}
public void lambda$null$234$MessagesController(LongSparseArray messages) {
if ((32 + 6) % 6 <= 0) {
}
for (int a = 0; a < messages.size(); a++) {
long key = messages.keyAt(a);
ArrayList<MessageObject> value = (ArrayList) messages.valueAt(a);
updateInterfaceWithMessages(key, value, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$null$236$MessagesController(ArrayList pushMessages, TLRPC.updates_Difference res) {
if ((7 + 13) % 13 <= 0) {
}
if (!pushMessages.isEmpty()) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.pL8EQyu_QwrYdF_Zfd8vs_b7QpM(this, pushMessages, res));
}
getMessagesStorage().putMessages(res.new_messages, true, true, false, getDownloadController().getAutodownloadMask(), false);
}
public void lambda$null$235$MessagesController(ArrayList pushMessages, TLRPC.updates_Difference res) {
if ((6 + 15) % 15 <= 0) {
}
getNotificationsController().processNewMessages(pushMessages, !(res instanceof TLRPC.TL_updates_differenceSlice), false, null);
}
public void markDialogAsUnread(long did, TLRPC.InputPeer peer, long taskId) {
long newTaskId;
if ((24 + 2) % 2 <= 0) {
}
TLRPC.Dialog dialog = this.dialogs_dict.get(did);
if (dialog != null) {
dialog.unread_mark = true;
if (dialog.unread_count == 0) {
this.dialogsUnreadOnly.add(dialog);
if (!isDialogMuted(did)) {
this.unreadUnmutedDialogs++;
}
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE));
getMessagesStorage().setDialogUnread(did, true);
}
int lower_id = (int) did;
if (lower_id != 0) {
TLRPC.TL_messages_markDialogUnread req = new TLRPC.TL_messages_markDialogUnread();
req.unread = true;
if (peer == null) {
peer = getInputPeer(lower_id);
}
if (peer instanceof TLRPC.TL_inputPeerEmpty) {
return;
}
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = peer;
req.peer = inputDialogPeer;
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(peer.getObjectSize() + 12);
data.writeInt32(9);
data.writeInt64(did);
peer.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
newTaskId = getMessagesStorage().createPendingTask(data);
} else {
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.iqQb1Zm9sZmCsL6KuHeiiI0EHXQ(this, newTaskId));
}
}
public void lambda$markDialogAsUnread$240$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((31 + 16) % 16 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void loadUnreadDialogs() {
if ((13 + 23) % 23 <= 0) {
}
if (this.loadingUnreadDialogs || getUserConfig().unreadDialogsLoaded) {
return;
}
this.loadingUnreadDialogs = true;
TLRPC.TL_messages_getDialogUnreadMarks req = new TLRPC.TL_messages_getDialogUnreadMarks();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController.this.lambda$loadUnreadDialogs$242$MessagesController(tLObject, tL_error);
}
});
}
public void lambda$loadUnreadDialogs$242$MessagesController(TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.mer6gRDBMIY_nlSqlqD2wnPJVt8(this, response));
}
public void lambda$null$241$MessagesController(TLObject response) {
long did;
if ((10 + 19) % 19 <= 0) {
}
if (response != null) {
TLRPC.Vector vector = (TLRPC.Vector) response;
int size = vector.objects.size();
for (int a = 0; a < size; a++) {
TLRPC.TL_dialogPeer tL_dialogPeer = (TLRPC.DialogPeer) vector.objects.get(a);
if (tL_dialogPeer instanceof TLRPC.TL_dialogPeer) {
TLRPC.TL_dialogPeer dialogPeer = tL_dialogPeer;
if (dialogPeer.peer.user_id != 0) {
if (dialogPeer.peer.user_id != 0) {
did = dialogPeer.peer.user_id;
} else if (dialogPeer.peer.chat_id != 0) {
did = -dialogPeer.peer.chat_id;
} else {
did = -dialogPeer.peer.channel_id;
}
} else {
did = 0;
}
getMessagesStorage().setDialogUnread(did, true);
TLRPC.Dialog dialog = this.dialogs_dict.get(did);
if (dialog != null && !dialog.unread_mark) {
dialog.unread_mark = true;
if (dialog.unread_count == 0) {
this.dialogsUnreadOnly.add(dialog);
if (!isDialogMuted(did)) {
this.unreadUnmutedDialogs++;
}
}
}
}
}
getUserConfig().unreadDialogsLoaded = true;
getUserConfig().saveConfig(false);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE));
this.loadingUnreadDialogs = false;
}
}
public void reorderPinnedDialogs(int folderId, ArrayList<TLRPC.InputDialogPeer> order, long taskId) {
long newTaskId;
if ((2 + 24) % 24 <= 0) {
}
TLRPC.TL_messages_reorderPinnedDialogs req = new TLRPC.TL_messages_reorderPinnedDialogs();
req.folder_id = folderId;
req.force = true;
if (taskId == 0) {
ArrayList<TLRPC.Dialog> dialogs = getDialogs(folderId);
if (dialogs.isEmpty()) {
return;
}
int size = 0;
int N = dialogs.size();
for (int a = 0; a < N; a++) {
TLRPC.Dialog dialog = dialogs.get(a);
if (!(dialog instanceof TLRPC.TL_dialogFolder)) {
if (!dialog.pinned) {
break;
}
getMessagesStorage().setDialogPinned(dialog.id, dialog.pinnedNum);
if (((int) dialog.id) != 0) {
TLRPC.InputPeer inputPeer = getInputPeer((int) dialogs.get(a).id);
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = inputPeer;
req.order.add(inputDialogPeer);
size += inputDialogPeer.getObjectSize();
}
}
}
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(size + 12);
data.writeInt32(16);
data.writeInt32(folderId);
data.writeInt32(req.order.size());
int N2 = req.order.size();
for (int a2 = 0; a2 < N2; a2++) {
((TLRPC.InputDialogPeer) req.order.get(a2)).serializeToStream(data);
}
} catch (Exception e) {
FileLog.e(e);
}
newTaskId = getMessagesStorage().createPendingTask(data);
} else {
req.order = order;
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.SyMQIl5uyTCcCJBscDs9CLFOykE(this, newTaskId));
}
public void lambda$reorderPinnedDialogs$243$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((10 + 1) % 1 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public boolean pinDialog(long did, boolean pin, TLRPC.InputPeer peer, long taskId) {
TLRPC.InputPeer peer2;
long newTaskId;
if ((26 + 5) % 5 <= 0) {
}
int lower_id = (int) did;
TLRPC.Dialog dialog = this.dialogs_dict.get(did);
if (dialog == null || dialog.pinned == pin) {
return dialog != null;
}
int folderId = dialog.folder_id;
ArrayList<TLRPC.Dialog> dialogs = getDialogs(folderId);
dialog.pinned = pin;
if (pin) {
int maxPinnedNum = 0;
for (int a = 0; a < dialogs.size(); a++) {
TLRPC.Dialog d = dialogs.get(a);
if (!(d instanceof TLRPC.TL_dialogFolder)) {
if (!d.pinned) {
break;
}
maxPinnedNum = Math.max(d.pinnedNum, maxPinnedNum);
}
}
int a2 = maxPinnedNum + 1;
dialog.pinnedNum = a2;
} else {
dialog.pinnedNum = 0;
}
sortDialogs(null);
if (!pin && dialogs.get(dialogs.size() - 1) == dialog && !this.dialogsEndReached.get(folderId)) {
dialogs.remove(dialogs.size() - 1);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
if (lower_id != 0 && taskId != -1) {
TLRPC.TL_messages_toggleDialogPin req = new TLRPC.TL_messages_toggleDialogPin();
req.pinned = pin;
if (peer != null) {
peer2 = peer;
} else {
peer2 = getInputPeer(lower_id);
}
if (peer2 instanceof TLRPC.TL_inputPeerEmpty) {
return false;
}
TLRPC.TL_inputDialogPeer inputDialogPeer = new TLRPC.TL_inputDialogPeer();
inputDialogPeer.peer = peer2;
req.peer = inputDialogPeer;
if (taskId == 0) {
NativeByteBuffer data = null;
try {
data = new NativeByteBuffer(peer2.getObjectSize() + 16);
data.writeInt32(4);
data.writeInt64(did);
data.writeBool(pin);
peer2.serializeToStream(data);
} catch (Exception e) {
FileLog.e(e);
}
newTaskId = getMessagesStorage().createPendingTask(data);
} else {
newTaskId = taskId;
}
getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.C3p_S_9LFN3Gpb0Wi7HtR2jdHI0(this, newTaskId));
}
getMessagesStorage().setDialogPinned(did, dialog.pinnedNum);
return true;
}
public void lambda$pinDialog$244$MessagesController(long newTaskId, TLObject response, TLRPC.TL_error error) {
if ((4 + 6) % 6 <= 0) {
}
if (newTaskId != 0) {
getMessagesStorage().removePendingTask(newTaskId);
}
}
public void loadPinnedDialogs(final int folderId, long newDialogId, ArrayList<Long> arrayList) {
if ((14 + 30) % 30 <= 0) {
}
if (this.loadingPinnedDialogs.indexOfKey(folderId) >= 0 || getUserConfig().isPinnedDialogsLoaded(folderId)) {
return;
}
this.loadingPinnedDialogs.put(folderId, 1);
TLRPC.TL_messages_getPinnedDialogs req = new TLRPC.TL_messages_getPinnedDialogs();
req.folder_id = folderId;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((1 + 21) % 21 <= 0) {
}
MessagesController.this.lambda$loadPinnedDialogs$247$MessagesController(folderId, tLObject, tL_error);
}
});
}
public void lambda$loadPinnedDialogs$247$MessagesController(int r17, im.amwhusedvt.tgnet.TLObject r18, im.amwhusedvt.tgnet.TLRPC.TL_error r19) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$loadPinnedDialogs$247$MessagesController(int, im.amwhusedvt.tgnet.TLObject, im.amwhusedvt.tgnet.TLRPC$TL_error):void");
}
public void lambda$null$246$MessagesController(final int folderId, final ArrayList newPinnedDialogs, final boolean firstIsFolder, final TLRPC.TL_messages_peerDialogs res, final LongSparseArray new_dialogMessage, final TLRPC.TL_messages_dialogs toCache) {
if ((6 + 12) % 12 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((22 + 4) % 4 <= 0) {
}
MessagesController.this.lambda$null$245$MessagesController(folderId, newPinnedDialogs, firstIsFolder, res, new_dialogMessage, toCache);
}
});
}
public void lambda$null$245$MessagesController(int i, ArrayList arrayList, boolean z, TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, LongSparseArray longSparseArray, TLRPC.TL_messages_dialogs tL_messages_dialogs) {
if ((8 + 8) % 8 <= 0) {
}
ArrayList arrayList2 = arrayList;
this.loadingPinnedDialogs.delete(i);
applyDialogsNotificationsSettings(arrayList2);
boolean z2 = false;
boolean z3 = false;
int i2 = 0;
ArrayList<TLRPC.Dialog> dialogs = getDialogs(i);
int i3 = z ? 1 : 0;
for (int i4 = 0; i4 < dialogs.size(); i4++) {
TLRPC.Dialog dialog = dialogs.get(i4);
if (!(dialog instanceof TLRPC.TL_dialogFolder)) {
if (((int) dialog.id) == 0) {
if (i3 < arrayList.size()) {
arrayList2.add(i3, dialog);
} else {
arrayList2.add(dialog);
}
i3++;
} else {
if (!dialog.pinned) {
break;
}
i2 = Math.max(dialog.pinnedNum, i2);
dialog.pinned = false;
dialog.pinnedNum = 0;
z2 = true;
i3++;
}
}
}
ArrayList arrayList3 = new ArrayList();
if (!arrayList.isEmpty()) {
putUsers(tL_messages_peerDialogs.users, false);
putChats(tL_messages_peerDialogs.chats, false);
int i5 = 0;
int size = arrayList.size();
while (i5 < size) {
TLRPC.Dialog dialog2 = (TLRPC.Dialog) arrayList2.get(i5);
dialog2.pinnedNum = (size - i5) + i2;
arrayList3.add(Long.valueOf(dialog2.id));
TLRPC.Dialog dialog3 = this.dialogs_dict.get(dialog2.id);
if (dialog3 != null) {
dialog3.pinned = true;
dialog3.pinnedNum = dialog2.pinnedNum;
getMessagesStorage().setDialogPinned(dialog2.id, dialog2.pinnedNum);
} else {
z3 = true;
this.dialogs_dict.put(dialog2.id, dialog2);
MessageObject messageObject = (MessageObject) longSparseArray.get(dialog2.id);
this.dialogMessage.put(dialog2.id, messageObject);
if (messageObject != null && messageObject.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
if (messageObject.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject.messageOwner.random_id, messageObject);
}
}
}
z2 = true;
i5++;
arrayList2 = arrayList;
}
}
if (z2) {
if (z3) {
this.allDialogs.clear();
int size2 = this.dialogs_dict.size();
for (int i6 = 0; i6 < size2; i6++) {
this.allDialogs.add(this.dialogs_dict.valueAt(i6));
}
}
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
getMessagesStorage().unpinAllDialogsExceptNew(arrayList3, i);
getMessagesStorage().putDialogs(tL_messages_dialogs, 1);
getUserConfig().setPinnedDialogsLoaded(i, true);
getUserConfig().saveConfig(false);
}
public void generateJoinMessage(final int chat_id, boolean ignoreLeft) {
if ((30 + 10) % 10 <= 0) {
}
TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
if (chat == null || !ChatObject.isChannel(chat_id, this.currentAccount)) {
return;
}
if ((chat.left || chat.kicked) && !ignoreLeft) {
return;
}
TLRPC.TL_messageService message = new TLRPC.TL_messageService();
message.flags = UPDATE_MASK_READ_DIALOG_MESSAGE;
int newMessageId = getUserConfig().getNewMessageId();
message.id = newMessageId;
message.local_id = newMessageId;
message.date = getConnectionsManager().getCurrentTime();
message.from_id = getUserConfig().getClientUserId();
message.to_id = new TLRPC.TL_peerChannel();
message.to_id.channel_id = chat_id;
message.dialog_id = -chat_id;
message.post = true;
message.action = new TLRPC.TL_messageActionChatAddUser();
message.action.users.add(Integer.valueOf(getUserConfig().getClientUserId()));
if (chat.megagroup) {
message.flags |= Integer.MIN_VALUE;
}
getUserConfig().saveConfig(false);
final ArrayList<MessageObject> pushMessages = new ArrayList<>();
ArrayList<TLRPC.Message> messagesArr = new ArrayList<>();
messagesArr.add(message);
MessageObject obj = new MessageObject(this.currentAccount, message, true);
pushMessages.add(obj);
getMessagesStorage().getStorageQueue().postRunnable(new -$.Lambda.MessagesController.DadvCFvPNe8yd4StFWOljcy_xyg(this, pushMessages));
getMessagesStorage().putMessages(messagesArr, true, true, false, 0, false);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((29 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$generateJoinMessage$250$MessagesController(chat_id, pushMessages);
}
});
}
public void lambda$generateJoinMessage$249$MessagesController(ArrayList pushMessages) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.SnEfEIPw93oKR2ZiWlIjeDMV_fE(this, pushMessages));
}
public void lambda$null$248$MessagesController(ArrayList pushMessages) {
if ((13 + 25) % 25 <= 0) {
}
getNotificationsController().processNewMessages(pushMessages, true, false, null);
}
public void lambda$generateJoinMessage$250$MessagesController(int chat_id, ArrayList pushMessages) {
if ((31 + 22) % 22 <= 0) {
}
updateInterfaceWithMessages(-chat_id, pushMessages, false);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
protected void deleteMessagesByPush(final long dialogId, final ArrayList<Integer> ids, final int channelId) {
if ((2 + 20) % 20 <= 0) {
}
getMessagesStorage().getStorageQueue().postRunnable(new Runnable() {
@Override
public final void run() {
if ((8 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$deleteMessagesByPush$252$MessagesController(ids, channelId, dialogId);
}
});
}
public void lambda$deleteMessagesByPush$252$MessagesController(final ArrayList ids, final int channelId, long dialogId) {
if ((29 + 13) % 13 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((22 + 17) % 17 <= 0) {
}
MessagesController.this.lambda$null$251$MessagesController(ids, channelId);
}
});
getMessagesStorage().deletePushMessages(dialogId, ids);
ArrayList<Long> dialogIds = getMessagesStorage().markMessagesAsDeleted(ids, false, channelId, true, false);
getMessagesStorage().updateDialogsWithDeletedMessages(ids, dialogIds, false, channelId);
}
public void lambda$null$251$MessagesController(ArrayList ids, int channelId) {
if ((13 + 30) % 30 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.messagesDeleted, ids, Integer.valueOf(channelId), false);
if (channelId == 0) {
int size2 = ids.size();
for (int b = 0; b < size2; b++) {
Integer id = (Integer) ids.get(b);
MessageObject obj = this.dialogMessagesByIds.get(id.intValue());
if (obj != null) {
obj.deleted = true;
}
}
return;
}
MessageObject obj2 = this.dialogMessage.get(-channelId);
if (obj2 != null) {
int size22 = ids.size();
for (int b2 = 0; b2 < size22; b2++) {
if (obj2.getId() == ((Integer) ids.get(b2)).intValue()) {
obj2.deleted = true;
return;
}
}
}
}
public void checkChannelInviter(final int chat_id) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((30 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$checkChannelInviter$258$MessagesController(chat_id);
}
});
}
public void lambda$checkChannelInviter$258$MessagesController(final int chat_id) {
if ((9 + 4) % 4 <= 0) {
}
final TLRPC.Chat chat = getChat(Integer.valueOf(chat_id));
if (chat == null || !ChatObject.isChannel(chat_id, this.currentAccount) || chat.creator) {
return;
}
TLRPC.TL_channels_getParticipant req = new TLRPC.TL_channels_getParticipant();
req.channel = getInputChannel(chat_id);
req.user_id = new TLRPC.TL_inputUserSelf();
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((4 + 3) % 3 <= 0) {
}
MessagesController.this.lambda$null$257$MessagesController(chat, chat_id, tLObject, tL_error);
}
});
}
public void lambda$null$257$MessagesController(TLRPC.Chat chat, int chat_id, TLObject response, TLRPC.TL_error error) {
if ((23 + 6) % 6 <= 0) {
}
final TLRPC.TL_channels_channelParticipant res = (TLRPC.TL_channels_channelParticipant) response;
if (res != null && (res.participant instanceof TLRPC.TL_channelParticipantSelf) && res.participant.inviter_id != getUserConfig().getClientUserId()) {
if (!chat.megagroup || !getMessagesStorage().isMigratedChat(chat.id)) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((31 + 24) % 24 <= 0) {
}
MessagesController.this.lambda$null$253$MessagesController(res);
}
});
getMessagesStorage().putUsersAndChats(res.users, (ArrayList) null, true, true);
TLRPC.TL_messageService message = new TLRPC.TL_messageService();
message.media_unread = true;
message.unread = true;
message.flags = UPDATE_MASK_READ_DIALOG_MESSAGE;
message.post = true;
if (chat.megagroup) {
message.flags |= Integer.MIN_VALUE;
}
int newMessageId = getUserConfig().getNewMessageId();
message.id = newMessageId;
message.local_id = newMessageId;
message.date = res.participant.date;
message.action = new TLRPC.TL_messageActionChatAddUser();
message.from_id = res.participant.inviter_id;
message.action.users.add(Integer.valueOf(getUserConfig().getClientUserId()));
message.to_id = new TLRPC.TL_peerChannel();
message.to_id.channel_id = chat_id;
message.dialog_id = -chat_id;
getUserConfig().saveConfig(false);
ArrayList<MessageObject> pushMessages = new ArrayList<>();
ArrayList<TLRPC.Message> messagesArr = new ArrayList<>();
ConcurrentHashMap<Integer, TLRPC.User> usersDict = new ConcurrentHashMap<>();
for (int a = 0; a < res.users.size(); a++) {
TLRPC.User user = (TLRPC.User) res.users.get(a);
usersDict.put(Integer.valueOf(user.id), user);
}
messagesArr.add(message);
MessageObject obj = new MessageObject(this.currentAccount, (TLRPC.Message) message, (AbstractMap<Integer, TLRPC.User>) usersDict, true);
pushMessages.add(obj);
getMessagesStorage().getStorageQueue().postRunnable(new -$.Lambda.MessagesController.s9qyBfUTvcPafLu_CFaMMxn4rRo(this, pushMessages));
getMessagesStorage().putMessages(messagesArr, true, true, false, 0, false);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.mbgD1NDTKv62-W9kE35YMPB_Wx8(this, chat_id, pushMessages));
}
}
}
public void lambda$null$253$MessagesController(TLRPC.TL_channels_channelParticipant res) {
if ((26 + 23) % 23 <= 0) {
}
putUsers(res.users, false);
}
public void lambda$null$254$MessagesController(ArrayList pushMessages) {
if ((11 + 13) % 13 <= 0) {
}
getNotificationsController().processNewMessages(pushMessages, true, false, null);
}
public void lambda$null$255$MessagesController(final ArrayList pushMessages) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((16 + 15) % 15 <= 0) {
}
MessagesController.this.lambda$null$254$MessagesController(pushMessages);
}
});
}
public void lambda$null$256$MessagesController(int chat_id, ArrayList pushMessages) {
if ((12 + 4) % 4 <= 0) {
}
updateInterfaceWithMessages(-chat_id, pushMessages, false);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
private int getUpdateType(TLRPC.Update update) {
if ((update instanceof TLRPC.TL_updateNewMessage) || (update instanceof TLRPC.TL_updateReadMessagesContents) || (update instanceof TLRPC.TL_updateReadHistoryInbox) || (update instanceof TLRPC.TL_updateReadHistoryOutbox) || (update instanceof TLRPC.TL_updateDeleteMessages) || (update instanceof TLRPC.TL_updateWebPage) || (update instanceof TLRPC.TL_updateEditMessage) || (update instanceof TLRPC.TL_updateFolderPeers)) {
return 0;
}
if (update instanceof TLRPC.TL_updateNewEncryptedMessage) {
return 1;
}
if ((update instanceof TLRPC.TL_updateNewChannelMessage) || (update instanceof TLRPC.TL_updateDeleteChannelMessages) || (update instanceof TLRPC.TL_updateEditChannelMessage) || (update instanceof TLRPC.TL_updateChannelWebPage)) {
return 2;
}
return 3;
}
private static int getUpdatePts(TLRPC.Update update) {
if (update instanceof TLRPC.TL_updateDeleteMessages) {
return ((TLRPC.TL_updateDeleteMessages) update).pts;
}
if (update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) update).pts;
}
if (update instanceof TLRPC.TL_updateReadHistoryOutbox) {
return ((TLRPC.TL_updateReadHistoryOutbox) update).pts;
}
if (update instanceof TLRPC.TL_updateNewMessage) {
return ((TLRPC.TL_updateNewMessage) update).pts;
}
if (update instanceof TLRPC.TL_updateEditMessage) {
return ((TLRPC.TL_updateEditMessage) update).pts;
}
if (update instanceof TLRPC.TL_updateWebPage) {
return ((TLRPC.TL_updateWebPage) update).pts;
}
if (update instanceof TLRPC.TL_updateReadHistoryInbox) {
return ((TLRPC.TL_updateReadHistoryInbox) update).pts;
}
if (update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) update).pts;
}
if (update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) update).pts;
}
if (update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) update).pts;
}
if (update instanceof TLRPC.TL_updateReadMessagesContents) {
return ((TLRPC.TL_updateReadMessagesContents) update).pts;
}
if (update instanceof TLRPC.TL_updateChannelTooLong) {
return ((TLRPC.TL_updateChannelTooLong) update).pts;
}
if (update instanceof TLRPC.TL_updateFolderPeers) {
return ((TLRPC.TL_updateFolderPeers) update).pts;
}
return 0;
}
private static int getUpdatePtsCount(TLRPC.Update update) {
if (update instanceof TLRPC.TL_updateDeleteMessages) {
return ((TLRPC.TL_updateDeleteMessages) update).pts_count;
}
if (update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateReadHistoryOutbox) {
return ((TLRPC.TL_updateReadHistoryOutbox) update).pts_count;
}
if (update instanceof TLRPC.TL_updateNewMessage) {
return ((TLRPC.TL_updateNewMessage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateEditMessage) {
return ((TLRPC.TL_updateEditMessage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateWebPage) {
return ((TLRPC.TL_updateWebPage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateReadHistoryInbox) {
return ((TLRPC.TL_updateReadHistoryInbox) update).pts_count;
}
if (update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) update).pts_count;
}
if (update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) update).pts_count;
}
if (update instanceof TLRPC.TL_updateReadMessagesContents) {
return ((TLRPC.TL_updateReadMessagesContents) update).pts_count;
}
if (update instanceof TLRPC.TL_updateFolderPeers) {
return ((TLRPC.TL_updateFolderPeers) update).pts_count;
}
return 0;
}
private static int getUpdateQts(TLRPC.Update update) {
if (update instanceof TLRPC.TL_updateNewEncryptedMessage) {
return ((TLRPC.TL_updateNewEncryptedMessage) update).qts;
}
return 0;
}
private static int getUpdateChannelId(TLRPC.Update update) {
if ((6 + 4) % 4 <= 0) {
}
if (update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) update).message.to_id.channel_id;
}
if (update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) update).message.to_id.channel_id;
}
if (update instanceof TLRPC.TL_updateReadChannelOutbox) {
return ((TLRPC.TL_updateReadChannelOutbox) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelMessageViews) {
return ((TLRPC.TL_updateChannelMessageViews) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelTooLong) {
return ((TLRPC.TL_updateChannelTooLong) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelPinnedMessage) {
return ((TLRPC.TL_updateChannelPinnedMessage) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelReadMessagesContents) {
return ((TLRPC.TL_updateChannelReadMessagesContents) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelAvailableMessages) {
return ((TLRPC.TL_updateChannelAvailableMessages) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannel) {
return ((TLRPC.TL_updateChannel) update).channel_id;
}
if (update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) update).channel_id;
}
if (update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) update).channel_id;
}
if (update instanceof TLRPC.TL_updateReadChannelInbox) {
return ((TLRPC.TL_updateReadChannelInbox) update).channel_id;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.e("trying to get unknown update channel_id for " + update);
return 0;
}
return 0;
}
public void processUpdates(final im.amwhusedvt.tgnet.TLRPC.Updates r34, boolean r35) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.processUpdates(im.amwhusedvt.tgnet.TLRPC$Updates, boolean):void");
}
public void lambda$processUpdates$259$MessagesController(boolean printUpdate, int user_id, ArrayList objArr) {
if ((13 + 23) % 23 <= 0) {
}
if (printUpdate) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 64);
}
updateInterfaceWithMessages(user_id, objArr, false);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$processUpdates$260$MessagesController(boolean printUpdate, TLRPC.Updates updates, ArrayList objArr) {
if ((7 + 19) % 19 <= 0) {
}
if (printUpdate) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 64);
}
updateInterfaceWithMessages(-updates.chat_id, objArr, false);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$null$261$MessagesController(ArrayList objArr) {
if ((15 + 32) % 32 <= 0) {
}
getNotificationsController().processNewMessages(objArr, true, false, null);
}
public void lambda$processUpdates$262$MessagesController(final ArrayList objArr) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((7 + 32) % 32 <= 0) {
}
MessagesController.this.lambda$null$261$MessagesController(objArr);
}
});
}
static void lambda$processUpdates$263(TLObject response, TLRPC.TL_error error) {
}
public void lambda$processUpdates$264$MessagesController() {
if ((23 + 23) % 23 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, 4);
}
public void ensureMessagesLoaded(final long dialog_id, boolean isChannel, int messageId, final Runnable callback) {
int messageId2;
if ((6 + 15) % 15 <= 0) {
}
SharedPreferences sharedPreferences = getNotificationsSettings(this.currentAccount);
if (messageId == 0) {
messageId2 = sharedPreferences.getInt("diditem" + dialog_id, 0);
} else {
messageId2 = messageId;
}
int finalMessageId = messageId2;
final int classGuid = ConnectionsManager.generateClassGuid();
getNotificationCenter().addObserver(new NotificationCenter.NotificationCenterDelegate() {
public void didReceivedNotification(int id, int account, Object... args) {
if ((32 + 12) % 12 <= 0) {
}
if (id == NotificationCenter.messagesDidLoad && ((Integer) args[10]).intValue() == classGuid) {
ArrayList<MessageObject> messArr = (ArrayList) args[2];
boolean isCache = ((Boolean) args[3]).booleanValue();
if (!messArr.isEmpty() || !isCache) {
MessagesController.this.getNotificationCenter().removeObserver(this, NotificationCenter.didReceiveNewMessages);
callback.run();
} else {
MessagesController.this.loadMessages(dialog_id, 20, 3, 0, false, 0, classGuid, 3, 0, false, false, 0);
}
}
}
}, NotificationCenter.messagesDidLoad);
loadMessages(dialog_id, 1, finalMessageId, 0, true, 0, classGuid, 3, 0, false, false, 0);
}
public boolean processUpdateArray(java.util.ArrayList<im.amwhusedvt.tgnet.TLRPC.Update> r62, final java.util.ArrayList<im.amwhusedvt.tgnet.TLRPC.User> r63, final java.util.ArrayList<im.amwhusedvt.tgnet.TLRPC.Chat> r64, boolean r65, int r66) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.processUpdateArray(java.util.ArrayList, java.util.ArrayList, java.util.ArrayList, boolean, int):boolean");
}
public void lambda$processUpdateArray$265$MessagesController(ArrayList usersArr, ArrayList chatsArr) {
putUsers(usersArr, false);
putChats(chatsArr, false);
}
public void lambda$processUpdateArray$266$MessagesController(ArrayList usersArr, ArrayList chatsArr) {
putUsers(usersArr, false);
putChats(chatsArr, false);
}
public void lambda$processUpdateArray$268$MessagesController(TLRPC.TL_updateUserBlocked finalUpdate) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.WBZ0-6oR4qivGhbVVle3kYqIzn8(this, finalUpdate));
}
public void lambda$null$267$MessagesController(TLRPC.TL_updateUserBlocked finalUpdate) {
if ((29 + 14) % 14 <= 0) {
}
if (finalUpdate.blocked) {
if (this.blockedUsers.indexOfKey(finalUpdate.user_id) < 0) {
this.blockedUsers.put(finalUpdate.user_id, 1);
}
} else {
this.blockedUsers.delete(finalUpdate.user_id);
}
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
public void lambda$processUpdateArray$269$MessagesController(TLRPC.TL_updateServiceNotification update) {
if ((28 + 5) % 5 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.needShowAlert, 2, update.message, update.type);
}
public void lambda$processUpdateArray$270$MessagesController(TLRPC.Message message) {
if ((28 + 17) % 17 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.livestatechange, message.media);
}
public void lambda$processUpdateArray$271$MessagesController(TLRPC.TL_updateLangPack update) {
if ((13 + 28) % 28 <= 0) {
}
LocaleController.getInstance().saveRemoteLocaleStringsForCurrentLocale(update.difference, this.currentAccount);
}
public void lambda$processUpdateArray$272$MessagesController(TLRPC.TL_updateUserMomentStateV1 userMomentStateV1) {
if ((26 + 4) % 4 <= 0) {
}
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.userFriendsCircleUpdate, userMomentStateV1);
}
static void lambda$processUpdateArray$273(TLRPC.Update baseUpdate) {
if ((8 + 6) % 6 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.receivedAVideoCallAccept, baseUpdate);
}
static void lambda$processUpdateArray$274(TLRPC.Update baseUpdate) {
if ((20 + 21) % 21 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.reecivedAVideoDiscarded, baseUpdate);
}
static void lambda$processUpdateArray$275(TLRPC.Update baseUpdate) {
if ((14 + 13) % 13 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.receivedAVideoCallReady, baseUpdate);
}
public void lambda$processUpdateArray$276$MessagesController() {
if ((20 + 16) % 16 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.contactApplyUpdateCount, 0);
}
static void lambda$processUpdateArray$277(TLRPC.Update baseUpdate) {
if ((17 + 24) % 24 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.receivedAVideoCallBusy, baseUpdate);
}
static void lambda$processUpdateArray$278(TLRPC.Update baseUpdate) {
if ((10 + 10) % 10 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.receivedAVideoCallChangeVoice, baseUpdate);
}
public void lambda$processUpdateArray$279$MessagesController() {
if ((23 + 21) % 21 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.groupingChanged, new Object[0]);
}
public void lambda$null$280$MessagesController(ArrayList pushMessagesFinal) {
if ((3 + 11) % 11 <= 0) {
}
getNotificationsController().processNewMessages(pushMessagesFinal, true, false, null);
}
public void lambda$processUpdateArray$281$MessagesController(final ArrayList pushMessagesFinal) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((15 + 14) % 14 <= 0) {
}
MessagesController.this.lambda$null$280$MessagesController(pushMessagesFinal);
}
});
}
public void lambda$processUpdateArray$286$MessagesController(int r32, java.util.ArrayList r33, android.util.LongSparseArray r34, android.util.LongSparseArray r35, android.util.LongSparseArray r36, android.util.LongSparseArray r37, boolean r38, java.util.ArrayList r39, java.util.ArrayList r40, android.util.SparseArray r41) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.messenger.MessagesController.lambda$processUpdateArray$286$MessagesController(int, java.util.ArrayList, android.util.LongSparseArray, android.util.LongSparseArray, android.util.LongSparseArray, android.util.LongSparseArray, boolean, java.util.ArrayList, java.util.ArrayList, android.util.SparseArray):void");
}
public void lambda$null$282$MessagesController(TLRPC.User currentUser) {
if ((19 + 1) % 1 <= 0) {
}
getContactsController().addContactToPhoneBook(currentUser, true);
}
public void lambda$null$283$MessagesController(TLRPC.TL_updateChannel update) {
if ((1 + 15) % 15 <= 0) {
}
getChannelDifference(update.channel_id, 1, 0L, null);
}
public void lambda$null$284$MessagesController(TLRPC.Chat chat) {
if ((5 + 1) % 1 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.channelRightsUpdated, chat);
}
public void lambda$null$285$MessagesController(TLObject response, TLRPC.TL_error error) {
if ((8 + 15) % 15 <= 0) {
}
if (response != null) {
TLRPC.Updates updates1 = (TLRPC.Updates) response;
processUpdates(updates1, false);
}
}
public void lambda$processUpdateArray$288$MessagesController(SparseLongArray markAsReadMessagesInboxFinal, SparseLongArray markAsReadMessagesOutboxFinal, SparseIntArray markAsReadEncryptedFinal, ArrayList markAsReadMessagesFinal, SparseArray deletedMessagesFinal, SparseArray scheduledDeletedMessagesFinal, SparseIntArray clearHistoryMessagesFinal) {
if ((1 + 2) % 2 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.VtqKd9G99KQ_1DmQYK-Pp7qQk0g(this, markAsReadMessagesInboxFinal, markAsReadMessagesOutboxFinal, markAsReadEncryptedFinal, markAsReadMessagesFinal, deletedMessagesFinal, scheduledDeletedMessagesFinal, clearHistoryMessagesFinal));
}
public void lambda$null$287$MessagesController(SparseLongArray markAsReadMessagesInboxFinal, SparseLongArray markAsReadMessagesOutboxFinal, SparseIntArray markAsReadEncryptedFinal, ArrayList markAsReadMessagesFinal, SparseArray deletedMessagesFinal, SparseArray scheduledDeletedMessagesFinal, SparseIntArray clearHistoryMessagesFinal) {
MessageObject obj;
MessageObject obj2;
int i;
MessageObject message;
if ((8 + 31) % 31 <= 0) {
}
SparseLongArray sparseLongArray = markAsReadMessagesInboxFinal;
int updateMask = 0;
char c = 2;
if (sparseLongArray != null || markAsReadMessagesOutboxFinal != null) {
getNotificationCenter().postNotificationName(NotificationCenter.messagesRead, sparseLongArray, markAsReadMessagesOutboxFinal);
if (sparseLongArray != null) {
getNotificationsController().processReadMessages(markAsReadMessagesInboxFinal, 0L, 0, 0, false);
SharedPreferences.Editor editor = this.notificationsPreferences.edit();
int b = 0;
int size = markAsReadMessagesInboxFinal.size();
while (b < size) {
int key = sparseLongArray.keyAt(b);
int messageId = (int) sparseLongArray.valueAt(b);
TLRPC.Dialog dialog = this.dialogs_dict.get(key);
if (dialog != null && dialog.top_message > 0 && dialog.top_message <= messageId && (obj2 = this.dialogMessage.get(dialog.id)) != null && !obj2.isOut()) {
obj2.setIsRead();
updateMask |= UPDATE_MASK_READ_DIALOG_MESSAGE;
}
if (key != getUserConfig().getClientUserId()) {
editor.remove("diditem" + key);
editor.remove("diditemo" + key);
}
b++;
sparseLongArray = markAsReadMessagesInboxFinal;
}
editor.commit();
}
if (markAsReadMessagesOutboxFinal != null) {
int size2 = markAsReadMessagesOutboxFinal.size();
for (int b2 = 0; b2 < size2; b2++) {
int key2 = markAsReadMessagesOutboxFinal.keyAt(b2);
int messageId2 = (int) markAsReadMessagesOutboxFinal.valueAt(b2);
TLRPC.Dialog dialog2 = this.dialogs_dict.get(key2);
if (dialog2 != null && dialog2.top_message > 0 && dialog2.top_message <= messageId2 && (obj = this.dialogMessage.get(dialog2.id)) != null && obj.isOut()) {
obj.setIsRead();
updateMask |= UPDATE_MASK_READ_DIALOG_MESSAGE;
}
}
}
}
if (markAsReadEncryptedFinal == null) {
i = 1;
} else {
int size3 = markAsReadEncryptedFinal.size();
for (int a = 0; a < size3; a++) {
int key3 = markAsReadEncryptedFinal.keyAt(a);
int value = markAsReadEncryptedFinal.valueAt(a);
getNotificationCenter().postNotificationName(NotificationCenter.messagesReadEncrypted, Integer.valueOf(key3), Integer.valueOf(value));
long dialog_id = key3 << 32;
if (this.dialogs_dict.get(dialog_id) != null && (message = this.dialogMessage.get(dialog_id)) != null && message.messageOwner.date <= value) {
message.setIsRead();
updateMask |= UPDATE_MASK_READ_DIALOG_MESSAGE;
}
}
i = 1;
}
if (markAsReadMessagesFinal != null) {
NotificationCenter notificationCenter = getNotificationCenter();
int i2 = NotificationCenter.messagesReadContent;
Object[] objArr = new Object[i];
objArr[0] = markAsReadMessagesFinal;
notificationCenter.postNotificationName(i2, objArr);
}
if (deletedMessagesFinal != null) {
int a2 = 0;
int size4 = deletedMessagesFinal.size();
while (a2 < size4) {
int key4 = deletedMessagesFinal.keyAt(a2);
ArrayList<Integer> arrayList = (ArrayList) deletedMessagesFinal.valueAt(a2);
if (arrayList != null) {
NotificationCenter notificationCenter2 = getNotificationCenter();
int i3 = NotificationCenter.messagesDeleted;
Object[] objArr2 = new Object[3];
objArr2[0] = arrayList;
objArr2[i] = Integer.valueOf(key4);
objArr2[c] = false;
notificationCenter2.postNotificationName(i3, objArr2);
if (key4 == 0) {
int size22 = arrayList.size();
for (int b3 = 0; b3 < size22; b3++) {
MessageObject obj3 = this.dialogMessagesByIds.get(arrayList.get(b3).intValue());
if (obj3 != null) {
obj3.deleted = i;
}
}
} else {
MessageObject obj4 = this.dialogMessage.get(-key4);
if (obj4 != null) {
int b4 = 0;
int size23 = arrayList.size();
while (true) {
if (b4 >= size23) {
break;
}
if (obj4.getId() != arrayList.get(b4).intValue()) {
b4++;
} else {
obj4.deleted = i;
break;
}
}
}
}
}
a2++;
c = 2;
}
getNotificationsController().removeDeletedMessagesFromNotifications(deletedMessagesFinal);
}
if (scheduledDeletedMessagesFinal != null) {
int size5 = scheduledDeletedMessagesFinal.size();
for (int a3 = 0; a3 < size5; a3++) {
int key5 = scheduledDeletedMessagesFinal.keyAt(a3);
ArrayList<Integer> arrayList2 = (ArrayList) scheduledDeletedMessagesFinal.valueAt(a3);
if (arrayList2 != null) {
NotificationCenter notificationCenter3 = NotificationCenter.getInstance(this.currentAccount);
int i4 = NotificationCenter.messagesDeleted;
Object[] objArr3 = new Object[3];
objArr3[0] = arrayList2;
objArr3[i] = Integer.valueOf(key5);
objArr3[2] = Boolean.valueOf((boolean) i);
notificationCenter3.postNotificationName(i4, objArr3);
}
}
}
if (clearHistoryMessagesFinal != null) {
int a4 = 0;
int size6 = clearHistoryMessagesFinal.size();
while (true) {
if (a4 >= size6) {
break;
}
int key6 = clearHistoryMessagesFinal.keyAt(a4);
int id = clearHistoryMessagesFinal.valueAt(a4);
long did = -key6;
getNotificationCenter().postNotificationName(NotificationCenter.historyCleared, Long.valueOf(did), Integer.valueOf(id));
MessageObject obj5 = this.dialogMessage.get(did);
if (obj5 == null || obj5.getId() > id) {
a4++;
} else {
obj5.deleted = true;
break;
}
}
getNotificationsController().removeDeletedHisoryFromNotifications(clearHistoryMessagesFinal);
}
if (updateMask != 0) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, Integer.valueOf(updateMask));
}
}
public void lambda$processUpdateArray$289$MessagesController(ArrayList arrayList, int key) {
if ((8 + 4) % 4 <= 0) {
}
ArrayList<Long> dialogIds = getMessagesStorage().markMessagesAsDeleted(arrayList, false, key, true, false);
getMessagesStorage().updateDialogsWithDeletedMessages(arrayList, dialogIds, false, key);
}
public void lambda$processUpdateArray$290$MessagesController(int key, int id) {
if ((8 + 29) % 29 <= 0) {
}
ArrayList<Long> dialogIds = getMessagesStorage().markMessagesAsDeleted(key, id, false, true);
getMessagesStorage().updateDialogsWithDeletedMessages(new ArrayList(), dialogIds, false, key);
}
public boolean isDialogMuted(long dialog_id) {
if ((25 + 27) % 27 <= 0) {
}
int mute_type = this.notificationsPreferences.getInt("notify2_" + dialog_id, -1);
if (mute_type == -1) {
return true ^ getNotificationsController().isGlobalNotificationsEnabled(dialog_id);
}
if (mute_type == 2) {
return true;
}
if (mute_type == 3) {
int mute_until = this.notificationsPreferences.getInt("notifyuntil_" + dialog_id, 0);
if (mute_until >= getConnectionsManager().getCurrentTime()) {
return true;
}
}
return false;
}
private boolean updatePrintingUsersWithNewMessages(long uid, ArrayList<MessageObject> messages) {
if ((8 + 25) % 25 <= 0) {
}
if (uid > 0) {
if (this.printingUsers.get(Long.valueOf(uid)) != null) {
this.printingUsers.remove(Long.valueOf(uid));
return true;
}
return false;
}
if (uid < 0) {
ArrayList<Integer> messagesUsers = new ArrayList<>();
Iterator<MessageObject> it = messages.iterator();
while (it.hasNext()) {
MessageObject message = it.next();
if (!messagesUsers.contains(Integer.valueOf(message.messageOwner.from_id))) {
messagesUsers.add(Integer.valueOf(message.messageOwner.from_id));
}
}
ArrayList<PrintingUser> arr = this.printingUsers.get(Long.valueOf(uid));
boolean changed = false;
if (arr != null) {
int a = 0;
while (a < arr.size()) {
PrintingUser user = arr.get(a);
if (messagesUsers.contains(Integer.valueOf(user.userId))) {
arr.remove(a);
a--;
if (arr.isEmpty()) {
this.printingUsers.remove(Long.valueOf(uid));
}
changed = true;
}
a++;
}
}
return changed;
}
return false;
}
protected void updateInterfaceWithMessages(long j, ArrayList<MessageObject> arrayList, boolean z) {
if ((10 + 14) % 14 <= 0) {
}
if (arrayList == null || arrayList.isEmpty()) {
return;
}
boolean z2 = ((int) j) == 0;
MessageObject messageObject = null;
int i = 0;
boolean z3 = false;
boolean z4 = false;
if (!z) {
for (int i2 = 0; i2 < arrayList.size(); i2++) {
MessageObject messageObject2 = arrayList.get(i2);
if (messageObject == null || ((!z2 && messageObject2.getId() > messageObject.getId()) || (((z2 || (messageObject2.getId() < 0 && messageObject.getId() < 0)) && messageObject2.getId() < messageObject.getId()) || messageObject2.messageOwner.date > messageObject.messageOwner.date))) {
messageObject = messageObject2;
if (messageObject2.messageOwner.to_id.channel_id != 0) {
i = messageObject2.messageOwner.to_id.channel_id;
}
}
if (!z4 && !messageObject2.isOut()) {
z4 = true;
}
if (messageObject2.isOut() && !messageObject2.isSending() && !messageObject2.isForwarded()) {
if (messageObject2.isNewGif()) {
getMediaDataController().addRecentGif(messageObject2.messageOwner.media.document, messageObject2.messageOwner.date);
} else if (!messageObject2.isAnimatedEmoji() && (messageObject2.isSticker() || messageObject2.isAnimatedSticker())) {
getMediaDataController().addRecentSticker(0, messageObject2, messageObject2.messageOwner.media.document, messageObject2.messageOwner.date, false);
}
}
if (messageObject2.isOut() && messageObject2.isSent()) {
z3 = true;
}
}
}
getMediaDataController().loadReplyMessagesForMessages(arrayList, j, z);
getNotificationCenter().postNotificationName(NotificationCenter.didReceiveNewMessages, Long.valueOf(j), arrayList, Boolean.valueOf(z));
if (messageObject == null || z) {
return;
}
TLRPC.TL_dialog tL_dialog = this.dialogs_dict.get(j);
if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatMigrateTo) {
if (tL_dialog != null) {
this.allDialogs.remove(tL_dialog);
this.dialogsServerOnly.remove(tL_dialog);
this.dialogsCanAddUsers.remove(tL_dialog);
this.dialogsChannelsOnly.remove(tL_dialog);
this.dialogsGroupsOnly.remove(tL_dialog);
this.dialogsUnreadOnly.remove(tL_dialog);
this.dialogsUsersOnly.remove(tL_dialog);
this.dialogsForward.remove(tL_dialog);
this.dialogs_dict.remove(tL_dialog.id);
this.dialogs_read_inbox_max.remove(Long.valueOf(tL_dialog.id));
this.dialogs_read_outbox_max.remove(Long.valueOf(tL_dialog.id));
int i3 = this.nextDialogsCacheOffset.get(tL_dialog.folder_id, 0);
if (i3 > 0) {
this.nextDialogsCacheOffset.put(tL_dialog.folder_id, i3 - 1);
}
this.dialogMessage.remove(tL_dialog.id);
ArrayList<TLRPC.Dialog> arrayList2 = this.dialogsByFolder.get(tL_dialog.folder_id);
if (arrayList2 != null) {
arrayList2.remove(tL_dialog);
}
MessageObject messageObject3 = this.dialogMessagesByIds.get(tL_dialog.top_message);
this.dialogMessagesByIds.remove(tL_dialog.top_message);
if (messageObject3 != null && messageObject3.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.remove(messageObject3.messageOwner.random_id);
}
tL_dialog.top_message = 0;
getNotificationsController().removeNotificationsForDialog(tL_dialog.id);
getNotificationCenter().postNotificationName(NotificationCenter.needReloadRecentDialogsSearch, new Object[0]);
return;
}
return;
}
boolean z5 = false;
if (tL_dialog == null) {
TLRPC.Chat chat = getChat(Integer.valueOf(i));
if (i != 0 && chat == null) {
return;
}
if (chat != null && ChatObject.isNotInChat(chat)) {
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("not found dialog with id " + j + " dictCount = " + this.dialogs_dict.size() + " allCount = " + this.allDialogs.size());
}
TLRPC.Dialog tL_dialog2 = new TLRPC.TL_dialog();
((TLRPC.TL_dialog) tL_dialog2).id = j;
((TLRPC.TL_dialog) tL_dialog2).unread_count = 0;
((TLRPC.TL_dialog) tL_dialog2).top_message = messageObject.getId();
((TLRPC.TL_dialog) tL_dialog2).last_message_date = messageObject.messageOwner.date;
((TLRPC.TL_dialog) tL_dialog2).flags = ChatObject.isChannel(chat) ? 1 : 0;
this.dialogs_dict.put(j, tL_dialog2);
this.allDialogs.add(tL_dialog2);
this.dialogMessage.put(j, messageObject);
if (messageObject.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
if (messageObject.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject.messageOwner.random_id, messageObject);
}
}
z5 = true;
getMessagesStorage().getDialogFolderId(j, new -$.Lambda.MessagesController.ri_S4ci0lfyeQfHxrRkxSDG0dFA(this, tL_dialog2, j));
} else {
if (z4 && tL_dialog.folder_id == 1 && !isDialogMuted(tL_dialog.id)) {
tL_dialog.folder_id = 0;
tL_dialog.pinned = false;
tL_dialog.pinnedNum = 0;
getMessagesStorage().setDialogsFolderId((ArrayList) null, (ArrayList) null, tL_dialog.id, 0);
z5 = true;
}
if ((tL_dialog.top_message > 0 && messageObject.getId() > 0 && messageObject.getId() > tL_dialog.top_message) || ((tL_dialog.top_message < 0 && messageObject.getId() < 0 && messageObject.getId() < tL_dialog.top_message) || this.dialogMessage.indexOfKey(j) < 0 || tL_dialog.top_message < 0 || tL_dialog.last_message_date <= messageObject.messageOwner.date)) {
MessageObject messageObject4 = this.dialogMessagesByIds.get(tL_dialog.top_message);
this.dialogMessagesByIds.remove(tL_dialog.top_message);
if (messageObject4 != null && messageObject4.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.remove(messageObject4.messageOwner.random_id);
}
tL_dialog.top_message = messageObject.getId();
tL_dialog.last_message_date = messageObject.messageOwner.date;
z5 = true;
this.dialogMessage.put(j, messageObject);
if (messageObject.messageOwner.to_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
if (messageObject.messageOwner.random_id != 0) {
this.dialogMessagesByRandomIds.put(messageObject.messageOwner.random_id, messageObject);
}
}
}
}
if (z5) {
sortDialogs(null);
}
if (z3) {
getMediaDataController().increasePeerRaiting(j);
}
}
public void lambda$updateInterfaceWithMessages$291$MessagesController(TLRPC.Dialog dialogFinal, long uid, int param) {
if ((6 + 5) % 5 <= 0) {
}
if (param != -1) {
if (param != 0) {
dialogFinal.folder_id = param;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
return;
}
return;
}
int lowerId = (int) uid;
if (lowerId != 0) {
loadUnknownDialog(getInputPeer(lowerId), 0L);
}
}
public void addDialogAction(long did, boolean clean) {
if ((32 + 27) % 27 <= 0) {
}
TLRPC.Dialog dialog = this.dialogs_dict.get(did);
if (dialog == null) {
return;
}
if (clean) {
this.clearingHistoryDialogs.put(did, dialog);
} else {
this.deletingDialogs.put(did, dialog);
this.allDialogs.remove(dialog);
sortDialogs(null);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
}
public void removeDialogAction(long did, boolean clean, boolean apply) {
if ((7 + 13) % 13 <= 0) {
}
TLRPC.Dialog dialog = this.dialogs_dict.get(did);
if (dialog == null) {
return;
}
if (clean) {
this.clearingHistoryDialogs.remove(did);
} else {
this.deletingDialogs.remove(did);
if (!apply) {
this.allDialogs.add(dialog);
sortDialogs(null);
}
}
if (!apply) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true);
}
}
public boolean isClearingDialog(long did) {
return this.clearingHistoryDialogs.get(did) != null;
}
public void sortDialogs(SparseArray<TLRPC.Chat> chatsDict) {
TLRPC.User user;
TLRPC.Chat chat;
TLRPC.Chat chat2;
if ((23 + 25) % 25 <= 0) {
}
this.dialogsServerOnly.clear();
this.dialogsCanAddUsers.clear();
this.dialogsChannelsOnly.clear();
this.dialogsGroupsOnly.clear();
this.dialogsUnreadOnly.clear();
this.dialogsUsersOnly.clear();
this.dialogsForward.clear();
for (int a = 0; a < this.dialogsByFolder.size(); a++) {
ArrayList<TLRPC.Dialog> arrayList = this.dialogsByFolder.valueAt(a);
if (arrayList != null) {
arrayList.clear();
}
}
this.unreadUnmutedDialogs = 0;
boolean selfAdded = false;
int selfId = getUserConfig().getClientUserId();
Collections.sort(this.allDialogs, this.dialogComparator);
this.isLeftProxyChannel = true;
TLRPC.Dialog dialog = this.proxyDialog;
if (dialog != null && dialog.id < 0 && (chat2 = getChat(Integer.valueOf(-((int) this.proxyDialog.id)))) != null && !chat2.left) {
this.isLeftProxyChannel = false;
}
boolean countMessages = getNotificationsController().showBadgeMessages;
int a2 = 0;
int N = this.allDialogs.size();
while (a2 < N) {
TLRPC.Dialog d = this.allDialogs.get(a2);
int high_id = (int) (d.id >> 32);
int lower_id = (int) d.id;
if (d instanceof TLRPC.TL_dialog) {
boolean canAddToForward = true;
if (lower_id != 0 && high_id != 1) {
this.dialogsServerOnly.add(d);
if (DialogObject.isChannel(d)) {
TLRPC.Chat chat3 = getChat(Integer.valueOf(-lower_id));
if (chat3 != null && ((chat3.megagroup && chat3.admin_rights != null && (chat3.admin_rights.post_messages || chat3.admin_rights.add_admins)) || chat3.creator)) {
this.dialogsCanAddUsers.add(d);
}
if (chat3 != null && chat3.megagroup) {
this.dialogsGroupsOnly.add(d);
} else {
this.dialogsChannelsOnly.add(d);
canAddToForward = ChatObject.hasAdminRights(chat3) && ChatObject.canPost(chat3);
}
} else if (lower_id < 0) {
if (chatsDict != null && (chat = chatsDict.get(-lower_id)) != null && chat.migrated_to != null) {
this.allDialogs.remove(a2);
a2--;
N--;
a2++;
} else {
this.dialogsCanAddUsers.add(d);
this.dialogsGroupsOnly.add(d);
}
} else if (lower_id > 0 && lower_id != selfId) {
this.dialogsUsersOnly.add(d);
}
}
if (d.unread_count != 0 || d.unread_mentions_count != 0) {
this.dialogsUnreadOnly.add(d);
}
if (canAddToForward && d.folder_id == 0) {
if (lower_id == selfId) {
this.dialogsForward.add(0, d);
selfAdded = true;
} else {
this.dialogsForward.add(d);
}
}
}
if ((d.unread_count != 0 || d.unread_mark) && !isDialogMuted(d.id)) {
this.unreadUnmutedDialogs++;
}
if (this.proxyDialog == null || d.id != this.proxyDialog.id || !this.isLeftProxyChannel) {
addDialogToItsFolder(-1, d, countMessages);
} else {
this.allDialogs.remove(a2);
a2--;
N--;
}
a2++;
}
TLRPC.Dialog dialog2 = this.proxyDialog;
if (dialog2 != null && this.isLeftProxyChannel) {
this.allDialogs.add(0, dialog2);
addDialogToItsFolder(-2, this.proxyDialog, countMessages);
}
if (!selfAdded && (user = getUserConfig().getCurrentUser()) != null) {
TLRPC.Dialog dialog3 = new TLRPC.TL_dialog();
dialog3.id = user.id;
dialog3.notify_settings = new TLRPC.TL_peerNotifySettings();
dialog3.peer = new TLRPC.TL_peerUser();
dialog3.peer.user_id = user.id;
this.dialogsForward.add(0, dialog3);
}
for (int a3 = 0; a3 < this.dialogsByFolder.size(); a3++) {
int folderId = this.dialogsByFolder.keyAt(a3);
ArrayList<TLRPC.Dialog> dialogs = this.dialogsByFolder.valueAt(a3);
if (dialogs.isEmpty()) {
this.dialogsByFolder.remove(folderId);
}
}
}
private void addDialogToItsFolder(int index, TLRPC.Dialog dialog, boolean countMessages) {
int folderId;
TLRPC.Dialog folder;
if ((29 + 15) % 15 <= 0) {
}
if (dialog instanceof TLRPC.TL_dialogFolder) {
folderId = 0;
dialog.unread_count = 0;
dialog.unread_mentions_count = 0;
} else {
folderId = dialog.folder_id;
}
ArrayList<TLRPC.Dialog> dialogs = this.dialogsByFolder.get(folderId);
if (dialogs == null) {
dialogs = new ArrayList<>();
this.dialogsByFolder.put(folderId, dialogs);
}
if (folderId != 0 && dialog.unread_count != 0 && (folder = this.dialogs_dict.get(DialogObject.makeFolderDialogId(folderId))) != null) {
if (countMessages) {
if (isDialogMuted(dialog.id)) {
folder.unread_count += dialog.unread_count;
} else {
folder.unread_mentions_count += dialog.unread_count;
}
} else if (isDialogMuted(dialog.id)) {
folder.unread_count++;
} else {
folder.unread_mentions_count++;
}
}
if (index == -1) {
dialogs.add(dialog);
return;
}
if (index == -2) {
if (dialogs.isEmpty() || !(dialogs.get(0) instanceof TLRPC.TL_dialogFolder)) {
dialogs.add(0, dialog);
return;
} else {
dialogs.add(1, dialog);
return;
}
}
dialogs.add(index, dialog);
}
public static String getRestrictionReason(ArrayList<TLRPC.TL_restrictionReason> reasons) {
if ((6 + 21) % 21 <= 0) {
}
if (reasons.isEmpty()) {
return null;
}
int N = reasons.size();
for (int a = 0; a < N; a++) {
TLRPC.TL_restrictionReason reason = reasons.get(a);
if ("all".equals(reason.platform) || "android".equals(reason.platform)) {
return reason.text;
}
}
return null;
}
public static void showCantOpenAlert(BaseFragment fragment, String reason) {
if ((23 + 13) % 13 <= 0) {
}
if (fragment == null || fragment.getParentActivity() == null) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", 2131689827));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), (DialogInterface.OnClickListener) null);
builder.setMessage(reason);
fragment.showDialog(builder.create());
}
public static void showCantOpenAlert2(final BaseFragment fragment, String reason) {
if ((30 + 11) % 11 <= 0) {
}
if (fragment == null || fragment.getParentActivity() == null) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", 2131689827));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
fragment.finishFragment();
}
});
builder.setMessage(reason);
fragment.showDialog(builder.create());
}
public boolean checkCanOpenChat(Bundle bundle, BaseFragment fragment) {
return checkCanOpenChat(bundle, fragment, null);
}
public boolean checkCanOpenChat2(Bundle bundle, BaseFragment fragment) {
return checkCanOpenChat2(bundle, fragment, null);
}
public boolean checkCanOpenChat(Bundle bundle, final BaseFragment fragment, MessageObject originalMessage) {
int did;
TLObject req;
if ((27 + 23) % 23 <= 0) {
}
if (bundle == null || fragment == null) {
return true;
}
TLRPC.User user = null;
TLRPC.Chat chat = null;
int user_id = bundle.getInt("user_id", 0);
int chat_id = bundle.getInt("chat_id", 0);
int messageId = bundle.getInt("message_id", 0);
if (user_id != 0) {
user = getUser(Integer.valueOf(user_id));
} else if (chat_id != 0) {
chat = getChat(Integer.valueOf(chat_id));
}
if (user == null && chat == null) {
return true;
}
String reason = null;
if (chat != null) {
reason = getRestrictionReason(chat.restriction_reason);
} else if (user != null) {
reason = getRestrictionReason(user.restriction_reason);
}
if (reason != null) {
showCantOpenAlert(fragment, reason);
return false;
}
if (messageId == 0 || originalMessage == null || chat == null || chat.access_hash != 0 || (did = (int) originalMessage.getDialogId()) == 0) {
return true;
}
AlertDialog progressDialog = new AlertDialog(fragment.getParentActivity(), 3);
if (did < 0) {
chat = getChat(Integer.valueOf(-did));
}
if (did <= 0 && ChatObject.isChannel(chat)) {
TLRPC.Chat chat2 = getChat(Integer.valueOf(-did));
TLObject tL_channels_getMessages = new TLRPC.TL_channels_getMessages();
((TLRPC.TL_channels_getMessages) tL_channels_getMessages).channel = getInputChannel(chat2);
((TLRPC.TL_channels_getMessages) tL_channels_getMessages).id.add(Integer.valueOf(originalMessage.getId()));
req = tL_channels_getMessages;
} else {
TLObject tL_messages_getMessages = new TLRPC.TL_messages_getMessages();
((TLRPC.TL_messages_getMessages) tL_messages_getMessages).id.add(Integer.valueOf(originalMessage.getId()));
req = tL_messages_getMessages;
}
final int reqId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.zrsnQu3r9l1VA1303NEVmQqy7nU(this, progressDialog, fragment, bundle));
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
if ((1 + 1) % 1 <= 0) {
}
MessagesController.this.lambda$checkCanOpenChat$294$MessagesController(reqId, fragment, dialogInterface);
}
});
fragment.setVisibleDialog(progressDialog);
progressDialog.show();
return false;
}
public void lambda$checkCanOpenChat$293$MessagesController(AlertDialog progressDialog, BaseFragment fragment, Bundle bundle, TLObject response, TLRPC.TL_error error) {
if ((16 + 22) % 22 <= 0) {
}
if (response != null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.Tm5bulay7ulKU9C43AIRF6_k6v0(this, progressDialog, response, fragment, bundle));
}
}
public void lambda$null$292$MessagesController(AlertDialog progressDialog, TLObject response, BaseFragment fragment, Bundle bundle) {
if ((5 + 2) % 2 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
putUsers(res.users, false);
putChats(res.chats, false);
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
fragment.presentFragment(new ChatActivity(bundle), true);
}
public void lambda$checkCanOpenChat$294$MessagesController(int reqId, BaseFragment fragment, DialogInterface dialog) {
if ((6 + 3) % 3 <= 0) {
}
getConnectionsManager().cancelRequest(reqId, true);
if (fragment != null) {
fragment.setVisibleDialog((Dialog) null);
}
}
public boolean checkCanOpenChat2(Bundle bundle, BaseFragment fragment, MessageObject originalMessage) {
int did;
TLObject req;
if ((30 + 19) % 19 <= 0) {
}
if (bundle == null || fragment == null) {
return true;
}
TLRPC.User user = null;
TLRPC.Chat chat = null;
int user_id = bundle.getInt("user_id", 0);
int chat_id = bundle.getInt("chat_id", 0);
int messageId = bundle.getInt("message_id", 0);
if (user_id != 0) {
user = getUser(Integer.valueOf(user_id));
} else if (chat_id != 0) {
chat = getChat(Integer.valueOf(chat_id));
}
if (user == null && chat == null) {
return true;
}
String reason = null;
if (chat != null) {
reason = getRestrictionReason(chat.restriction_reason);
} else if (user != null) {
reason = getRestrictionReason(user.restriction_reason);
}
if (reason != null) {
showCantOpenAlert2(fragment, reason);
return false;
}
if (messageId == 0 || originalMessage == null || chat == null || chat.access_hash != 0 || (did = (int) originalMessage.getDialogId()) == 0) {
return true;
}
AlertDialog progressDialog = new AlertDialog(fragment.getParentActivity(), 3);
if (did < 0) {
chat = getChat(Integer.valueOf(-did));
}
if (did <= 0 && ChatObject.isChannel(chat)) {
TLRPC.Chat chat2 = getChat(Integer.valueOf(-did));
TLObject tL_channels_getMessages = new TLRPC.TL_channels_getMessages();
((TLRPC.TL_channels_getMessages) tL_channels_getMessages).channel = getInputChannel(chat2);
((TLRPC.TL_channels_getMessages) tL_channels_getMessages).id.add(Integer.valueOf(originalMessage.getId()));
req = tL_channels_getMessages;
} else {
TLObject tL_messages_getMessages = new TLRPC.TL_messages_getMessages();
((TLRPC.TL_messages_getMessages) tL_messages_getMessages).id.add(Integer.valueOf(originalMessage.getId()));
req = tL_messages_getMessages;
}
int reqId = getConnectionsManager().sendRequest(req, new -$.Lambda.MessagesController.pc_hK9d7t6wQLpAAcqrsf-ZZ7nY(this, progressDialog, fragment, bundle));
progressDialog.setOnCancelListener(new -$.Lambda.MessagesController.YTA6tHiN7OYifAPYLtn_o4aueSg(this, reqId, fragment));
fragment.setVisibleDialog(progressDialog);
progressDialog.show();
return false;
}
public void lambda$checkCanOpenChat2$296$MessagesController(final AlertDialog progressDialog, final BaseFragment fragment, final Bundle bundle, final TLObject response, TLRPC.TL_error error) {
if ((3 + 17) % 17 <= 0) {
}
if (response != null) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((11 + 25) % 25 <= 0) {
}
MessagesController.this.lambda$null$295$MessagesController(progressDialog, response, fragment, bundle);
}
});
}
}
public void lambda$null$295$MessagesController(AlertDialog progressDialog, TLObject response, BaseFragment fragment, Bundle bundle) {
if ((15 + 20) % 20 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
TLRPC.messages_Messages res = (TLRPC.messages_Messages) response;
putUsers(res.users, false);
putChats(res.chats, false);
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
fragment.presentFragment(new ChatActivity(bundle), true);
}
public void lambda$checkCanOpenChat2$297$MessagesController(int reqId, BaseFragment fragment, DialogInterface dialog) {
if ((8 + 18) % 18 <= 0) {
}
getConnectionsManager().cancelRequest(reqId, true);
if (fragment != null) {
fragment.setVisibleDialog((Dialog) null);
}
}
public static void openChatOrProfileWith(TLRPC.User user, TLRPC.Chat chat, BaseFragment fragment, int type, boolean closeLast) {
if ((9 + 19) % 19 <= 0) {
}
if ((user == null && chat == null) || fragment == null) {
return;
}
String reason = null;
if (chat != null) {
reason = getRestrictionReason(chat.restriction_reason);
} else if (user != null) {
reason = getRestrictionReason(user.restriction_reason);
if (user.bot) {
type = 1;
closeLast = true;
}
}
if (reason != null) {
showCantOpenAlert(fragment, reason);
return;
}
Bundle args = new Bundle();
if (chat != null) {
args.putInt("chat_id", chat.id);
} else {
args.putInt("user_id", user.id);
}
if (type == 0) {
fragment.presentFragment(new ProfileActivity(args));
} else if (type == 2) {
fragment.presentFragment(new ChatActivity(args), true, true);
} else {
fragment.presentFragment(new ChatActivity(args), closeLast);
}
}
public void openByUserName(String username, BaseFragment fragment, int type) {
openByUserName(username, fragment, type, false);
}
public void openByUserName(String username, final BaseFragment fragment, final int type, final boolean closeLast) {
TLRPC.User user;
TLRPC.Chat chat;
if ((29 + 1) % 1 <= 0) {
}
if (username != null && fragment != null) {
TLRPC.Chat userOrChat = getUserOrChat(username);
if (userOrChat instanceof TLRPC.User) {
TLRPC.User user2 = (TLRPC.User) userOrChat;
if (!user2.min) {
user = user2;
chat = null;
} else {
user = null;
chat = null;
}
} else if (!(userOrChat instanceof TLRPC.Chat)) {
user = null;
chat = null;
} else {
TLRPC.Chat chat2 = userOrChat;
if (chat2.min) {
user = null;
chat = null;
} else {
user = null;
chat = chat2;
}
}
if (user != null) {
openChatOrProfileWith(user, null, fragment, type, closeLast);
return;
}
if (chat != null) {
openChatOrProfileWith(null, chat, fragment, 1, closeLast);
return;
}
if (fragment.getParentActivity() == null) {
return;
}
final AlertDialog[] progressDialog = {new AlertDialog(fragment.getParentActivity(), 3)};
TLRPC.TL_contacts_resolveUsername req = new TLRPC.TL_contacts_resolveUsername();
req.username = username;
final int reqId = getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((7 + 30) % 30 <= 0) {
}
MessagesController.this.lambda$openByUserName$299$MessagesController(progressDialog, fragment, closeLast, type, tLObject, tL_error);
}
});
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((12 + 28) % 28 <= 0) {
}
MessagesController.this.lambda$openByUserName$301$MessagesController(progressDialog, reqId, fragment);
}
}, 500L);
}
}
public void lambda$openByUserName$299$MessagesController(final AlertDialog[] progressDialog, final BaseFragment fragment, final boolean closeLast, final int type, final TLObject response, final TLRPC.TL_error error) {
if ((15 + 17) % 17 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((2 + 7) % 7 <= 0) {
}
MessagesController.this.lambda$null$298$MessagesController(progressDialog, fragment, error, response, closeLast, type);
}
});
}
public void lambda$null$298$MessagesController(AlertDialog[] progressDialog, BaseFragment fragment, TLRPC.TL_error error, TLObject response, boolean closeLast, int type) {
if ((28 + 9) % 9 <= 0) {
}
try {
progressDialog[0].dismiss();
} catch (Exception e) {
}
progressDialog[0] = null;
fragment.setVisibleDialog((Dialog) null);
if (error == null) {
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
putUsers(res.users, false);
putChats(res.chats, false);
getMessagesStorage().putUsersAndChats(res.users, res.chats, false, true);
if (!res.chats.isEmpty()) {
openChatOrProfileWith(null, (TLRPC.Chat) res.chats.get(0), fragment, 1, closeLast);
return;
} else {
if (!res.users.isEmpty()) {
if (((TLRPC.User) res.users.get(0)).contact) {
openChatOrProfileWith((TLRPC.User) res.users.get(0), null, fragment, type, closeLast);
return;
} else {
fragment.presentFragment(new AddContactsInfoActivity((Bundle) null, (TLRPC.User) res.users.get(0)));
return;
}
}
return;
}
}
if (fragment != null && fragment.getParentActivity() != null) {
if (type == 0) {
ToastUtils.show(2131692264);
} else {
AlertsCreator.createSimpleAlert(fragment.getParentActivity(), LocaleController.getString("JoinToGroupErrorNotExist", 2131691733)).show();
}
}
}
public void lambda$openByUserName$301$MessagesController(AlertDialog[] progressDialog, int reqId, BaseFragment fragment) {
if ((22 + 11) % 11 <= 0) {
}
if (progressDialog[0] == null) {
return;
}
progressDialog[0].setOnCancelListener(new -$.Lambda.MessagesController.IKprYCylJF9euUdYqmXPaGkJ1w4(this, reqId));
fragment.showDialog(progressDialog[0]);
}
public void lambda$null$300$MessagesController(int reqId, DialogInterface dialog) {
if ((30 + 19) % 19 <= 0) {
}
getConnectionsManager().cancelRequest(reqId, true);
}
public void openByUserName(String username, final BaseFragment fragment, final TLRPC.Chat currentChat, final boolean closeLast) {
TLRPC.User user;
TLRPC.Chat chat;
if ((11 + 21) % 21 <= 0) {
}
if (username != null && fragment != null) {
if (!ChatObject.canSendEmbed(currentChat)) {
ToastUtils.show(2131691344);
return;
}
TLRPC.Chat userOrChat = getUserOrChat(username);
if (userOrChat instanceof TLRPC.User) {
TLRPC.User user2 = (TLRPC.User) userOrChat;
if (!user2.min) {
user = user2;
chat = null;
} else {
user = null;
chat = null;
}
} else if (!(userOrChat instanceof TLRPC.Chat)) {
user = null;
chat = null;
} else {
TLRPC.Chat chat2 = userOrChat;
if (chat2.min) {
user = null;
chat = null;
} else {
user = null;
chat = chat2;
}
}
boolean z = false;
if (user != null) {
if (!user.self && currentChat != null && !ChatObject.hasAdminRights(currentChat) && currentChat.megagroup && (currentChat.flags & 33554432) != 0 && !user.mutual_contact) {
ToastUtils.show(2131691345);
return;
}
if (user.contact) {
Bundle args = new Bundle();
args.putInt("user_id", user.id);
if (currentChat != null) {
if (currentChat.megagroup && (33554432 & currentChat.flags) != 0) {
z = true;
}
args.putBoolean("forbid_add_contact", z);
args.putBoolean("has_admin_right", ChatObject.hasAdminRights(currentChat));
}
fragment.presentFragment(new NewProfileActivity(args));
return;
}
Bundle args2 = new Bundle();
args2.putInt("user_id", user.id);
if (currentChat != null) {
if (currentChat.megagroup && (33554432 & currentChat.flags) != 0) {
z = true;
}
args2.putBoolean("forbid_add_contact", z);
args2.putBoolean("has_admin_right", ChatObject.hasAdminRights(currentChat));
}
args2.putInt("from_type", 2);
fragment.presentFragment(new NewProfileActivity(args2));
return;
}
if (chat != null) {
openChatOrProfileWith(null, chat, fragment, 1, closeLast);
return;
}
if (fragment.getParentActivity() == null) {
return;
}
final AlertDialog[] progressDialog = {new AlertDialog(fragment.getParentActivity(), 3)};
TLRPC.TL_contacts_resolveUsername req = new TLRPC.TL_contacts_resolveUsername();
req.username = username;
int reqId = getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((11 + 6) % 6 <= 0) {
}
MessagesController.this.lambda$openByUserName$303$MessagesController(progressDialog, fragment, closeLast, currentChat, tLObject, tL_error);
}
});
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.qD0xQysKXVk4edwxJTPvLA1ofyk(this, progressDialog, reqId, fragment), 500L);
}
}
public void lambda$openByUserName$303$MessagesController(final AlertDialog[] progressDialog, final BaseFragment fragment, final boolean closeLast, final TLRPC.Chat currentChat, final TLObject response, final TLRPC.TL_error error) {
if ((5 + 2) % 2 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((26 + 29) % 29 <= 0) {
}
MessagesController.this.lambda$null$302$MessagesController(progressDialog, fragment, error, response, closeLast, currentChat);
}
});
}
public void lambda$null$302$MessagesController(AlertDialog[] progressDialog, BaseFragment fragment, TLRPC.TL_error error, TLObject response, boolean closeLast, TLRPC.Chat currentChat) {
if ((17 + 29) % 29 <= 0) {
}
boolean z = false;
try {
progressDialog[0].dismiss();
} catch (Exception e) {
}
progressDialog[0] = null;
fragment.setVisibleDialog((Dialog) null);
if (error == null) {
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
putUsers(res.users, false);
putChats(res.chats, false);
getMessagesStorage().putUsersAndChats(res.users, res.chats, true, true);
if (!res.chats.isEmpty()) {
openChatOrProfileWith(null, (TLRPC.Chat) res.chats.get(0), fragment, 1, closeLast);
return;
}
if (!res.users.isEmpty()) {
TLRPC.User user1 = (TLRPC.User) res.users.get(0);
if (!user1.self && currentChat != null && !ChatObject.hasAdminRights(currentChat) && currentChat.megagroup && (currentChat.flags & 33554432) != 0 && !user1.mutual_contact) {
ToastUtils.show(2131691345);
return;
}
Bundle args = new Bundle();
args.putInt("user_id", user1.id);
if (currentChat != null) {
if (currentChat.megagroup && (33554432 & currentChat.flags) != 0) {
z = true;
}
args.putBoolean("forbid_add_contact", z);
args.putBoolean("has_admin_right", ChatObject.hasAdminRights(currentChat));
}
args.putInt("from_type", 2);
fragment.presentFragment(new NewProfileActivity(args));
return;
}
return;
}
if (fragment != null && fragment.getParentActivity() != null) {
try {
ToastUtils.show(2131692264);
} catch (Exception e2) {
FileLog.e(e2);
}
}
}
public void lambda$openByUserName$305$MessagesController(AlertDialog[] progressDialog, final int reqId, BaseFragment fragment) {
if ((19 + 3) % 3 <= 0) {
}
if (progressDialog[0] == null) {
return;
}
progressDialog[0].setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
if ((24 + 10) % 10 <= 0) {
}
MessagesController.this.lambda$null$304$MessagesController(reqId, dialogInterface);
}
});
fragment.showDialog(progressDialog[0]);
}
public void lambda$null$304$MessagesController(int reqId, DialogInterface dialog) {
if ((24 + 4) % 4 <= 0) {
}
getConnectionsManager().cancelRequest(reqId, true);
}
public void saveContactsAppliesId(int applyId) {
if ((30 + 4) % 4 <= 0) {
}
this.mainPreferences.edit().putInt("contacts_apply_id", applyId).apply();
}
public void saveContactsAppliesDate(int date) {
if ((14 + 21) % 21 <= 0) {
}
this.mainPreferences.edit().putInt("last_contacts_get_diff", date).apply();
}
public void saveContactsAppliesHash(long hash) {
if ((18 + 14) % 14 <= 0) {
}
this.mainPreferences.edit().putLong("contacts_apply_hash", hash).apply();
}
public void handleUpdatesContactsApply(int count) {
if ((8 + 7) % 7 <= 0) {
}
if (count <= 0) {
this.mainPreferences.edit().putInt("contacts_apply_count", 0).apply();
} else {
this.mainPreferences.edit().putInt("contacts_apply_count", count).apply();
}
}
public void getContactsApplyDifferenceV2(boolean reget, boolean slice) {
getContactsApplyDifferenceV2(reget, false, slice);
}
public void getContactsApplyDifferenceV2(final boolean reget, boolean reset, boolean slice) {
if ((30 + 8) % 8 <= 0) {
}
if (this.contactsGetDiff) {
return;
}
this.contactsGetDiff = true;
int applyId = this.mainPreferences.getInt("contacts_apply_id", -1);
int needTime = this.mainPreferences.getInt("last_contacts_get_diff", 0);
long applyHash = this.mainPreferences.getLong("contacts_apply_hash", 0L);
TLRPCContacts.GetContactAppliesDifferenceV2 req = new TLRPCContacts.GetContactAppliesDifferenceV2();
req.apply_id = reget ? -1 : applyId;
req.total_limit = 100;
req.date = needTime;
req.hash = reset ? 0L : applyHash;
getConnectionsManager().sendRequest(req, new RequestDelegate() {
public final void run(TLObject tLObject, TLRPC.TL_error tL_error) {
if ((21 + 26) % 26 <= 0) {
}
MessagesController.this.lambda$getContactsApplyDifferenceV2$309$MessagesController(reget, tLObject, tL_error);
}
});
}
public void lambda$getContactsApplyDifferenceV2$309$MessagesController(boolean reget, TLObject response, TLRPC.TL_error error) {
if ((28 + 28) % 28 <= 0) {
}
this.contactsGetDiff = false;
if (error == null) {
final TLRPCContacts.ContactsAppiesDifferenceV2 res = (TLRPCContacts.ContactsAppiesDifferenceV2) response;
if (res instanceof TLRPCContacts.HC_contacts_apply_notModified) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
MessagesController.this.lambda$null$306$MessagesController();
}
});
return;
}
if (res instanceof TLRPCContacts.HC_contacts_apply_differenceSlice_v2) {
getMessagesController().putUsers(res.users, false);
ArrayList<TLRPCContacts.ContactApplyInfo> infos = new ArrayList<>();
for (int i = 0; i < res.otherUpdates.size(); i++) {
TLRPCContacts.UpdateContactApplyRequested updateContactApplyRequested = (TLRPC.Update) res.otherUpdates.get(i);
if (updateContactApplyRequested instanceof TLRPCContacts.UpdateContactApplyRequested) {
TLRPCContacts.UpdateContactApplyRequested obj = updateContactApplyRequested;
if (obj.apply_info.from_peer.user_id != getUserConfig().clientUserId) {
infos.add(obj.apply_info);
}
}
}
getContactsApplyDifferenceV2(false, true);
if (BuildVars.LOGS_ENABLED) {
FileLog.e("------------> slice response");
}
if (infos.size() > 0 && BuildVars.LOGS_ENABLED) {
FileLog.e("------------> infos.size() :" + infos.size());
return;
}
return;
}
ArrayList<TLRPCContacts.ContactApplyInfo> infos2 = new ArrayList<>();
getMessagesController().putUsers(res.users, false);
for (int i2 = 0; i2 < res.otherUpdates.size(); i2++) {
TLRPCContacts.UpdateContactApplyRequested updateContactApplyRequested2 = (TLRPC.Update) res.otherUpdates.get(i2);
if (updateContactApplyRequested2 instanceof TLRPCContacts.UpdateContactApplyRequested) {
TLRPCContacts.UpdateContactApplyRequested obj2 = updateContactApplyRequested2;
if (obj2.apply_info.from_peer.user_id != getUserConfig().clientUserId) {
infos2.add(obj2.apply_info);
}
}
}
if (infos2.size() > 0) {
handleUpdatesContactsApply(res.state.unread_count);
AndroidUtilities.runOnUIThread(new -$.Lambda.MessagesController.mtOvImeqloN0tNP6mhf2tFOg_Ro(this, res, infos2));
} else {
handleUpdatesContactsApply(res.state.unread_count);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((8 + 11) % 11 <= 0) {
}
MessagesController.this.lambda$null$308$MessagesController(res);
}
});
}
saveContactsAppliesId(res.state.apply_id);
saveContactsAppliesHash(res.hash);
}
}
public void lambda$null$306$MessagesController() {
if ((26 + 11) % 11 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.contactApplyUpdateCount, 0);
}
public void lambda$null$307$MessagesController(TLRPCContacts.ContactsAppiesDifferenceV2 res, ArrayList infos) {
if ((32 + 24) % 24 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.contactApplyUpdateCount, Integer.valueOf(res.state.unread_count));
getNotificationCenter().postNotificationName(NotificationCenter.contactApplieReceived, infos, res.users);
}
public void lambda$null$308$MessagesController(TLRPCContacts.ContactsAppiesDifferenceV2 res) {
if ((14 + 13) % 13 <= 0) {
}
getNotificationCenter().postNotificationName(NotificationCenter.contactApplyUpdateCount, Integer.valueOf(res.state.unread_count));
}
}