正在查看: Telegram v11.13.0 应用的 MessagesController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Telegram v11.13.0 应用的 MessagesController.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package org.telegram.messenger;
import android.app.Activity;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.Bundle;
import android.os.Looper;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.collection.LongSparseArray;
import androidx.core.util.Consumer;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import org.telegram.SQLite.SQLiteCursor;
import org.telegram.SQLite.SQLiteDatabase;
import org.telegram.SQLite.SQLiteException;
import org.telegram.SQLite.SQLitePreparedStatement;
import org.telegram.messenger.ChatObject;
import org.telegram.messenger.MessagesController$;
import org.telegram.messenger.MessagesStorage;
import org.telegram.messenger.SavedMessagesController;
import org.telegram.messenger.Timer;
import org.telegram.messenger.Utilities;
import org.telegram.messenger.browser.Browser;
import org.telegram.messenger.support.LongSparseIntArray;
import org.telegram.messenger.support.LongSparseLongArray;
import org.telegram.messenger.voip.VoIPDebugToSend;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.NativeByteBuffer;
import org.telegram.tgnet.OutputSerializedData;
import org.telegram.tgnet.RequestDelegate;
import org.telegram.tgnet.SerializedData;
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC;
import org.telegram.tgnet.TLRPC$Document;
import org.telegram.tgnet.TLRPC$Update;
import org.telegram.tgnet.TLRPC$User;
import org.telegram.tgnet.Vector;
import org.telegram.tgnet.tl.TL_account;
import org.telegram.tgnet.tl.TL_bots;
import org.telegram.tgnet.tl.TL_chatlists;
import org.telegram.tgnet.tl.TL_phone;
import org.telegram.tgnet.tl.TL_stars;
import org.telegram.ui.ActionBar.ActionBarLayout;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.Cells.CheckBoxCell;
import org.telegram.ui.ChatActivity;
import org.telegram.ui.ChatRightsEditActivity;
import org.telegram.ui.Components.AlertsCreator;
import org.telegram.ui.Components.AnimatedEmojiDrawable;
import org.telegram.ui.Components.BulletinFactory;
import org.telegram.ui.Components.ImageUpdater;
import org.telegram.ui.Components.LayoutHelper;
import org.telegram.ui.Components.Premium.LimitReachedBottomSheet;
import org.telegram.ui.Components.Reactions.ReactionsLayoutInBubble;
import org.telegram.ui.DialogsActivity;
import org.telegram.ui.LaunchActivity;
import org.telegram.ui.PremiumPreviewFragment;
import org.telegram.ui.SecretMediaViewer;
import org.telegram.ui.Stars.StarsController;
import org.telegram.ui.Stories.StoriesController;
import org.telegram.ui.ThemeActivity;
import org.telegram.ui.bots.BotWebViewSheet;
import org.telegram.ui.bots.WebViewRequestProps;
public class MessagesController extends BaseController implements NotificationCenter$NotificationCenterDelegate {
public static int DIALOG_FILTER_FLAG_ALL_CHATS = 31;
public static int DIALOG_FILTER_FLAG_BOTS = 16;
public static int DIALOG_FILTER_FLAG_CHANNELS = 8;
public static int DIALOG_FILTER_FLAG_CHATLIST = 512;
public static int DIALOG_FILTER_FLAG_CHATLIST_ADMIN = 1024;
public static int DIALOG_FILTER_FLAG_CONTACTS = 1;
public static int DIALOG_FILTER_FLAG_EXCLUDE_ARCHIVED = 128;
public static int DIALOG_FILTER_FLAG_EXCLUDE_MUTED = 32;
public static int DIALOG_FILTER_FLAG_EXCLUDE_READ = 64;
public static int DIALOG_FILTER_FLAG_GROUPS = 4;
public static int DIALOG_FILTER_FLAG_NON_CONTACTS = 2;
public static int DIALOG_FILTER_FLAG_ONLY_ARCHIVED = 256;
public static final int LOAD_AROUND_DATE = 4;
public static final int LOAD_AROUND_MESSAGE = 3;
public static final int LOAD_BACKWARD = 0;
public static final int LOAD_FORWARD = 1;
public static final int LOAD_FROM_UNREAD = 2;
public static int PROMO_TYPE_OTHER = 2;
public static int PROMO_TYPE_PROXY = 0;
public static int PROMO_TYPE_PSA = 1;
public static int UPDATE_MASK_ALL = 1050111;
public static int UPDATE_MASK_AVATAR = 2;
public static int UPDATE_MASK_CHAT = 8192;
public static int UPDATE_MASK_CHAT_AVATAR = 8;
public static int UPDATE_MASK_CHAT_MEMBERS = 32;
public static int UPDATE_MASK_CHAT_NAME = 16;
public static int UPDATE_MASK_CHECK = 65536;
public static int UPDATE_MASK_EMOJI_INTERACTIONS = 262144;
public static int UPDATE_MASK_EMOJI_STATUS = 524288;
public static int UPDATE_MASK_MESSAGE_TEXT = 32768;
public static int UPDATE_MASK_NAME = 1;
public static int UPDATE_MASK_NEW_MESSAGE = 2048;
public static int UPDATE_MASK_PHONE = 1024;
public static int UPDATE_MASK_REACTIONS_READ = 1048576;
public static int UPDATE_MASK_READ_DIALOG_MESSAGE = 256;
public static int UPDATE_MASK_REORDER = 131072;
public static int UPDATE_MASK_SELECT_DIALOG = 512;
public static int UPDATE_MASK_SEND_STATE = 4096;
public static int UPDATE_MASK_STATUS = 4;
public static int UPDATE_MASK_USER_PHONE = 128;
public static int UPDATE_MASK_USER_PRINT = 64;
private static volatile long lastPasswordCheckTime = 0;
private static volatile long lastThemeCheckTime = 0;
public static int stableIdPointer = 100;
private int DIALOGS_LOAD_TYPE_CACHE;
private int DIALOGS_LOAD_TYPE_CHANNEL;
private int DIALOGS_LOAD_TYPE_UNKNOWN;
public int aboutLengthLimitDefault;
public int aboutLengthLimitPremium;
private final HashMap<Long, TLRPC.Chat> activeVoiceChatsMap;
protected final ArrayList<TLRPC.Dialog> allDialogs;
public boolean androidDisableRoundCamera2;
public float animatedEmojisZoom;
private final CacheFetcher<Integer, TLRPC.TL_help_appConfig> appConfigFetcher;
public Set<String> authDomains;
public int authorizationAutoconfirmPeriod;
public boolean autoarchiveAvailable;
public Set<String> autologinDomains;
public String autologinToken;
private TLRPC.messages_AvailableEffects availableEffects;
public int availableMapProviders;
public boolean backgroundConnection;
public LongSparseIntArray blockePeers;
public boolean blockedCountry;
public boolean blockedEndReached;
public int boostsChannelLevelMax;
public long boostsPerSentGift;
public int botPreviewMediasMax;
public int botVerificationDescriptionLengthLimit;
public int businessChatLinksLimit;
public SparseIntArray businessFeaturesTypesToPosition;
private CacheByChatsController cacheByChatsController;
private HashMap<Long, ChannelRecommendations> cachedChannelRecommendations;
private TLRPC.TL_exportedContactToken cachedContactToken;
private final LongSparseArray cachedIsUserContactBlocked;
public int callConnectTimeout;
public int callPacketTimeout;
public int callReceiveTimeout;
public boolean callRequestsDisabled;
public int callRingTimeout;
public boolean canEditFactcheck;
public boolean canRevokePmInbox;
public int captionLengthLimitDefault;
public int captionLengthLimitPremium;
private LongSparseArray channelAdmins;
public int channelAutotranslationLevelMin;
public int channelBgIconLevelMin;
private ChannelBoostsController channelBoostsControler;
public int channelCustomWallpaperLevelMin;
public int channelEmojiStatusLevelMin;
public int channelProfileIconLevelMin;
public int channelRestrictSponsoredLevelMin;
public boolean channelRevenueWithdrawalEnabled;
private LongSparseArray channelViewsToSend;
public int channelWallpaperLevelMin;
public int channelsLimitDefault;
public int channelsLimitPremium;
private LongSparseIntArray channelsPts;
public int chatReadMarkExpirePeriod;
public int chatReadMarkSizeThreshold;
private SparseArray<ChatlistUpdatesStat> chatlistFoldersUpdates;
public int chatlistInvitesLimitDefault;
public int chatlistInvitesLimitPremium;
public int chatlistJoinedLimitDefault;
public int chatlistJoinedLimitPremium;
private int chatlistUpdatePeriod;
private final ConcurrentHashMap<Long, TLRPC.Chat> chats;
public int checkResetLangpack;
private LongSparseArray checkingLastMessagesDialogs;
private boolean checkingPromoInfo;
private int checkingPromoInfoRequestId;
private boolean checkingTosUpdate;
private LongSparseArray clearingHistoryDialogs;
public boolean collectDeviceStats;
public final android.util.LongSparseArray<CommonChatsList> commonChats;
public int conferenceCallSizeLimit;
public final AppGlobalConfig config;
private TL_account.contentSettings contentSettings;
private ArrayList<Utilities.Callback<TL_account.contentSettings>> contentSettingsCallbacks;
private long contentSettingsLoadedTime;
private boolean contentSettingsLoading;
private ArrayList<Long> createdDialogIds;
private ArrayList<Long> createdDialogMainThreadIds;
private ArrayList<Long> createdScheduledDialogIds;
private Runnable currentDeleteTaskRunnable;
private LongSparseArray currentDeletingTaskMediaMids;
private LongSparseArray currentDeletingTaskMids;
private int currentDeletingTaskTime;
public TLRPC.TL_pendingSuggestion customPendingSuggestion;
public String dcDomainName;
public LongSparseIntArray deletedHistory;
private LongSparseArray deletingDialogs;
private Comparator<TLRPC.Dialog> dialogComparator;
private final Comparator<TLRPC.Dialog> dialogDateComparator;
public ArrayList<DialogFilter> dialogFilters;
public SparseArray<DialogFilter> dialogFiltersById;
public int dialogFiltersChatsLimitDefault;
public int dialogFiltersChatsLimitPremium;
public int dialogFiltersLimitDefault;
public int dialogFiltersLimitPremium;
public boolean dialogFiltersLoaded;
public int dialogFiltersPinnedLimitDefault;
public int dialogFiltersPinnedLimitPremium;
public LongSparseArray dialogMessage;
public SparseArray<MessageObject> dialogMessagesByIds;
public LongSparseArray dialogMessagesByRandomIds;
private LongSparseArray dialogPhotos;
public final SparseArray<ArrayList<TLRPC.Dialog>> dialogsByFolder;
public ArrayList<TLRPC.Dialog> dialogsCanAddUsers;
public ArrayList<TLRPC.Dialog> dialogsChannelsOnly;
private SparseBooleanArray dialogsEndReached;
public ArrayList<TLRPC.Dialog> dialogsForBlock;
public ArrayList<TLRPC.Dialog> dialogsForward;
public ArrayList<TLRPC.Dialog> dialogsGroupsOnly;
private boolean dialogsInTransaction;
public boolean dialogsLoaded;
private int dialogsLoadedTillDate;
public ArrayList<TLRPC.Dialog> dialogsMyChannels;
public ArrayList<TLRPC.Dialog> dialogsMyGroups;
public ArrayList<TLRPC.Dialog> dialogsServerOnly;
public ArrayList<TLRPC.Dialog> dialogsUsersOnly;
public LongSparseArray dialogs_dict;
public ConcurrentHashMap<Long, Integer> dialogs_read_inbox_max;
public ConcurrentHashMap<Long, Integer> dialogs_read_outbox_max;
public HashSet<String> diceEmojies;
public HashMap<String, DiceFrameSuccess> diceSuccess;
public List<String> directPaymentsCurrency;
public boolean disableBotFullscreenBlur;
public Set<String> dismissedSuggestions;
private final CacheFetcher<Integer, TLRPC.messages_AvailableEffects> effectsFetcher;
public HashMap<Long, ArrayList<TLRPC.TL_sendMessageEmojiInteraction>> emojiInteractions;
private final SharedPreferences emojiPreferences;
public HashMap<String, EmojiSound> emojiSounds;
private final ConcurrentHashMap<Long, Integer> emojiStatusUntilValues;
public boolean enableGiftsInProfile;
public boolean enableJoined;
private final ConcurrentHashMap<Integer, TLRPC.EncryptedChat> encryptedChats;
public Set<String> exportGroupUri;
public Set<String> exportPrivateUri;
public Set<String> exportUri;
private final LongSparseArray exportedChats;
public int factcheckLengthLimit;
public ArrayList<FaqSearchResult> faqSearchArray;
public TLRPC.WebPage faqWebPage;
public boolean filtersEnabled;
public boolean firstGettingTask;
public boolean folderTags;
public int forumUpgradeParticipantsMin;
public String freezeAppealUrl;
public long freezeSinceDate;
public long freezeUntilDate;
public ArrayList<DialogFilter> frozenDialogFilters;
private final LongSparseArray fullChats;
private final LongSparseArray fullUsers;
private boolean getDifferenceFirstSync;
public boolean getfileExperimentalParams;
private LongSparseArray gettingChatInviters;
public boolean gettingDifference;
private LongSparseArray gettingDifferenceChannels;
private boolean gettingNewDeleteTask;
private LongSparseArray gettingUnknownChannels;
private LongSparseArray gettingUnknownDialogs;
public String gifSearchBot;
public ArrayList<String> gifSearchEmojies;
public boolean giftAttachMenuIcon;
public boolean giftTextFieldIcon;
public long giveawayAddPeersMax;
public long giveawayBoostsPerPremium;
public long giveawayCountriesMax;
public boolean giveawayGiftsPurchaseAvailable;
public long giveawayPeriodMax;
public int groupCallVideoMaxParticipants;
private final LongSparseArray groupCalls;
private final LongSparseArray groupCallsByChatId;
public int groupCustomWallpaperLevelMin;
public int groupEmojiStatusLevelMin;
public int groupEmojiStickersLevelMin;
public int groupProfileBgIconLevelMin;
public int groupTranscribeLevelMin;
public int groupWallpaperLevelMin;
private boolean hasArchivedChats;
private boolean hasStories;
public int hiddenMembersGroupSizeMin;
public ArrayList<Long> hiddenUndoChats;
public ArrayList<TLRPC.RecentMeUrl> hintDialogs;
public Set<String> ignoreRestrictionReasons;
public volatile boolean ignoreSetOnline;
public String imageSearchBot;
private String installReferer;
public int introDescriptionLengthLimit;
public int introTitleLengthLimit;
private boolean isLeftPromoChannel;
private final ArrayList<Long> joiningToChannels;
public boolean keepAliveService;
public int largeQueueMaxActiveOperations;
private int lastCheckPromoId;
public int lastKnownSessionsCount;
private int lastPrintingStringCount;
private long lastPushRegisterSendTime;
private LongSparseArray lastQuickReplyServerQueryTime;
private LongSparseArray lastSavedServerQueryTime;
private LongSparseArray lastScheduledServerQueryTime;
private LongSparseArray lastServerQueryTime;
private long lastStatusUpdateTime;
private long lastViewsCheckTime;
public String linkPrefix;
private Runnable loadAppConfigRunnable;
public LongSparseLongArray loadedFullChats;
private HashSet<Long> loadedFullParticipants;
private LongSparseLongArray loadedFullUsers;
private boolean loadingArePaidReactionsAnonymous;
private boolean loadingAvailableEffects;
public boolean loadingBlockedPeers;
private LongSparseIntArray loadingChannelAdmins;
private SparseBooleanArray loadingDialogs;
private HashSet<Long> loadingFullChats;
private HashSet<Long> loadingFullParticipants;
private HashSet<Long> loadingFullUsers;
private HashSet<Long> loadingGroupCalls;
private final HashSet<Long> loadingIsUserContactBlocked;
private int loadingNotificationSettings;
private boolean loadingNotificationSignUpSettings;
private boolean loadingPeerColors;
private LongSparseArray loadingPeerSettings;
private SparseIntArray loadingPinnedDialogs;
private boolean loadingProfilePeerColors;
private HashSet<Long> loadingReactionTags;
private boolean loadingRemoteFilters;
private boolean loadingSuggestedFilters;
private boolean loadingUnreadDialogs;
private boolean loggedDeviceStats;
private final SharedPreferences mainPreferences;
public String mapKey;
public int mapProvider;
public int maxBroadcastCount;
public int maxCaptionLength;
public int maxEditTime;
public int maxFaveStickersCount;
public int maxFolderPinnedDialogsCountDefault;
public int maxFolderPinnedDialogsCountPremium;
public int maxGroupCount;
public int maxMegagroupCount;
public int maxMessageLength;
public int maxPinnedDialogsCountDefault;
public int maxPinnedDialogsCountPremium;
public int maxRecentGifsCount;
public int maxRecentStickersCount;
private SparseIntArray migratedChats;
private boolean migratingDialogs;
public int minGroupConvertSize;
private final ConcurrentHashMap<Long, Long> monoForumLinkedChannels;
private LongSparseArray needShortPollChannels;
private LongSparseArray needShortPollOnlines;
public NewMessageCallback newMessageCallback;
public boolean newNoncontactPeersRequirePremiumWithoutOwnpremium;
private SparseIntArray nextDialogsCacheOffset;
private int nextPromoInfoCheckTime;
private int nextTosCheckTime;
private final SharedPreferences notificationsPreferences;
private final Runnable notifyTranscriptionAudioCooldownUpdate;
private final ConcurrentHashMap<String, TLObject> objectsByUsernames;
private boolean offlineSent;
private Utilities.Callback<Boolean> onLoadedRemoteFilters;
public ConcurrentHashMap<Long, Integer> onlinePrivacy;
public Long paidReactionsPrivacy;
public long paidReactionsPrivacyTime;
private Runnable passwordCheckRunnable;
public PeerColors peerColors;
private final long peerDialogRequestTimeout;
private final LongSparseArray peerDialogsRequested;
private final HashSet<Pair<StarsController.MessageId, AtomicBoolean>> pendingReportMessageDelivery;
public Set<String> pendingSuggestions;
private LongSparseIntArray pendingUnreadCounter;
public SparseArray<ImageUpdater> photoSuggestion;
public int pmReadDateExpirePeriod;
public int pollAnswersMax;
private LongSparseArray pollsToCheck;
private int pollsToCheckSize;
public boolean preloadFeaturedStickers;
public String premiumBotUsername;
public SparseIntArray premiumFeaturesTypesToPosition;
public String premiumInvoiceSlug;
public boolean premiumLocked;
public String premiumManageSubscriptionUrl;
public LongSparseArray printingStrings;
public LongSparseArray printingStringsTypes;
public ConcurrentHashMap<Long, ConcurrentHashMap<Integer, ArrayList<PrintingUser>>> printingUsers;
public PeerColors profilePeerColors;
private TLRPC.Dialog promoDialog;
private long promoDialogId;
public int promoDialogType;
public String promoPsaMessage;
public String promoPsaType;
private String proxyDialogAddress;
public int publicLinksLimitDefault;
public int publicLinksLimitPremium;
public boolean qrLoginCamera;
public int quickRepliesLimit;
public int quickReplyMessagesLimit;
public int quoteLengthMax;
public int ratingDecay;
private LongSparseArray reactionTags;
public int reactionsInChatMax;
public int reactionsUniqMax;
public int reactionsUserMaxDefault;
public int reactionsUserMaxPremium;
private ArrayList<ReadTask> readTasks;
private LongSparseArray readTasksMap;
private Runnable recentEmojiStatusUpdateRunnable;
private long recentEmojiStatusUpdateRunnableTime;
private long recentEmojiStatusUpdateRunnableTimeout;
public int recommendedChannelsLimitDefault;
public int recommendedChannelsLimitPremium;
public boolean registeringForPush;
private LongSparseArray reloadingMessages;
private HashMap<String, ArrayList<MessageObject>> reloadingSavedWebpages;
private LongSparseArray reloadingSavedWebpagesPending;
private HashMap<String, ArrayList<MessageObject>> reloadingScheduledWebpages;
private LongSparseArray reloadingScheduledWebpagesPending;
private HashMap<String, ArrayList<MessageObject>> reloadingWebpages;
private LongSparseArray reloadingWebpagesPending;
public boolean remoteConfigLoaded;
private ArrayList<ReadTask> repliesReadTasks;
private final HashSet<StarsController.MessageId> reportedMessageDelivery;
private final Runnable requestIsUserContactBlockedRunnable;
private boolean requestingContactToken;
private TLRPC.messages_Dialogs resetDialogsAll;
private TLRPC.TL_messages_peerDialogs resetDialogsPinned;
private boolean resetingDialogs;
public int revokeTimeLimit;
public int revokeTimePmLimit;
public int ringtoneDurationMax;
public int ringtoneSizeMax;
public int roundAudioBitrate;
public int roundVideoBitrate;
public int roundVideoSize;
public boolean saveGifsWithStickers;
public int savedDialogsPinnedLimitDefault;
public int savedDialogsPinnedLimitPremium;
public int savedGifsLimitDefault;
public int savedGifsLimitPremium;
public SavedMessagesController savedMessagesController;
public boolean savedViewAsChats;
public int secretWebpagePreview;
public DialogFilter[] selectedDialogFilter;
private LongSparseArray sendAsPeers;
private final Runnable sendReportMessageDeliver;
private final HashMap<String, Boolean> sendingSuggestedMessageApprovalMap;
public LongSparseArray[] sendingTypings;
private final HashSet<Long> sensitiveAgreed;
private SparseBooleanArray serverDialogsEndReached;
private LongSparseIntArray shortPollChannels;
private LongSparseIntArray shortPollOnlines;
public boolean showAnnualPerMonth;
public boolean showFiltersTooltip;
public int smallQueueMaxActiveOperations;
public boolean smsjobsStickyNotificationEnabled;
private DialogFilter sortingDialogFilter;
public boolean sponsoredLinksInappAllow;
private LongSparseArray sponsoredMessages;
public boolean stargiftsBlocked;
public int stargiftsConvertPeriodMax;
public int stargiftsMessageLengthMax;
public int stargiftsPinnedToTopLimit;
public boolean starrefConnectAllowed;
public int starrefMaxCommissionPermille;
public int starrefMinCommissionPermille;
public boolean starrefProgramAllowed;
public Set<String> starrefStartParamPrefixes;
public boolean starsGiftsEnabled;
public boolean starsLocked;
public long starsPaidMessageAmountMax;
public int starsPaidMessageCommissionPermille;
public boolean starsPaidMessagesAvailable;
public long starsPaidPostAmountMax;
public long starsPaidReactionAmountMax;
public long starsRevenueWithdrawalMin;
public long starsStargiftResaleAmountMax;
public long starsStargiftResaleAmountMin;
public int starsStargiftResaleCommisionPermille;
public long starsSubscriptionAmountMax;
public float starsUsdSellRate1000;
public float starsUsdWithdrawRate1000;
private int statusRequest;
private int statusSettingState;
public int stealthModeCooldown;
public int stealthModeFuture;
public int stealthModePast;
public int stickersFavedLimitDefault;
public int stickersFavedLimitPremium;
public long storiesChangelogUserId;
public StoriesController storiesController;
public String storiesEntities;
public boolean storiesExportNopublicLink;
public int storiesPinnedToTopCountMax;
public String storiesPosting;
public int storiesSentMonthlyLimitDefault;
public int storiesSentMonthlyLimitPremium;
public int storiesSentWeeklyLimitDefault;
public int storiesSentWeeklyLimitPremium;
public int storiesSuggestedReactionsLimitDefault;
public int storiesSuggestedReactionsLimitPremium;
public int storyCaptionLengthLimitDefault;
public int storyCaptionLengthLimitPremium;
public int storyExpiringLimitDefault;
public int storyExpiringLimitPremium;
public boolean storyQualityFull;
public String storyVenueSearchBot;
public boolean storyWeatherPreload;
public boolean suggestContacts;
public boolean suggestStickersApiOnly;
public ArrayList<TLRPC.TL_dialogFilterSuggested> suggestedFilters;
public String suggestedLangCode;
public int telegramAntispamGroupSizeMin;
public long telegramAntispamUserId;
private Runnable themeCheckRunnable;
private HashMap<String, ReadTask> threadsReadTasksMap;
public int todoItemLengthMax;
public int todoItemsMax;
public int todoTitleLengthMax;
public String tonBlockchainExplorerUrl;
public String tonProxyAddress;
private TopicsController topicsController;
public int topicsPinnedLimit;
public int totalBlockedCount;
public int transcribeAudioTrialCooldownUntil;
public int transcribeAudioTrialCurrentNumber;
public int transcribeAudioTrialDurationMax;
public int transcribeAudioTrialWeeklyNumber;
public int transcribeButtonPressed;
private TranslateController translateController;
public String translationsAutoEnabled;
public String translationsManualEnabled;
public UnconfirmedAuthController unconfirmedAuthController;
public int unreadUnmutedDialogs;
public int updateCheckDelay;
private Comparator<TLRPC$Update> updatesComparator;
private final LongSparseArray updatesQueueChannels;
private ArrayList<TLRPC.Updates> updatesQueuePts;
private ArrayList<TLRPC.Updates> updatesQueueQts;
private ArrayList<TLRPC.Updates> updatesQueueSeq;
private LongSparseLongArray updatesStartWaitTimeChannels;
private long updatesStartWaitTimePts;
private long updatesStartWaitTimeQts;
private long updatesStartWaitTimeSeq;
public boolean updatingState;
public boolean uploadMarkupVideo;
public int uploadMaxFileParts;
public int uploadMaxFilePartsPremium;
public float uploadPremiumSpeedupDownload;
public int uploadPremiumSpeedupNotifyPeriod;
public float uploadPremiumSpeedupUpload;
private String uploadingAvatar;
private HashMap<String, Object> uploadingThemes;
public String uploadingWallpaper;
public Theme.OverrideWallpaperInfo uploadingWallpaperInfo;
private UserNameResolver userNameResolver;
private final LongSparseArray userPeerSettings;
private final ConcurrentHashMap<Long, TLRPC$User> users;
public String venueSearchBot;
public boolean videoIgnoreAltDocuments;
private ArrayList<Long> visibleDialogMainThreadIds;
private ArrayList<Long> visibleScheduledDialogMainThreadIds;
public VoIPDebugToSend voipDebug;
public String weatherSearchUsername;
public Set<String> webAppAllowedProtocols;
public int webFileDatacenterId;
public String youtubePipType;
private static volatile MessagesController[] Instance = new MessagesController[4];
private static final Object[] lockObjects = new Object[4];
static {
for (int i = 0; i < 4; i++) {
lockObjects[i] = new Object();
}
}
public MessagesController(int i) {
super(i);
this.chats = new ConcurrentHashMap<>(100, 1.0f, 2);
this.encryptedChats = new ConcurrentHashMap<>(10, 1.0f, 2);
this.users = new ConcurrentHashMap<>(100, 1.0f, 3);
this.objectsByUsernames = new ConcurrentHashMap<>(100, 1.0f, 2);
this.monoForumLinkedChannels = new ConcurrentHashMap<>(3, 1.0f, 2);
this.activeVoiceChatsMap = new HashMap<>();
this.joiningToChannels = new ArrayList<>();
this.exportedChats = new LongSparseArray();
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.dialogsMyChannels = new ArrayList<>();
this.dialogsMyGroups = new ArrayList<>();
this.dialogsChannelsOnly = new ArrayList<>();
this.dialogsUsersOnly = new ArrayList<>();
this.dialogsForBlock = new ArrayList<>();
this.dialogsGroupsOnly = new ArrayList<>();
this.selectedDialogFilter = new DialogFilter[2];
this.dialogsLoadedTillDate = ConnectionsManager.DEFAULT_DATACENTER_ID;
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 LongSparseIntArray();
this.dialogMessagesByIds = new SparseArray<>();
this.printingUsers = new ConcurrentHashMap<>(20, 1.0f, 2);
this.printingStrings = new LongSparseArray();
this.printingStringsTypes = new LongSparseArray();
this.sendingTypings = new LongSparseArray[12];
this.onlinePrivacy = new ConcurrentHashMap<>(20, 1.0f, 2);
this.pendingUnreadCounter = new LongSparseIntArray();
this.chatlistFoldersUpdates = new SparseArray<>();
this.largeQueueMaxActiveOperations = 2;
this.smallQueueMaxActiveOperations = 5;
this.storiesChangelogUserId = 777000L;
this.giveawayAddPeersMax = 10L;
this.giveawayPeriodMax = 7L;
this.giveawayCountriesMax = 10L;
this.giveawayBoostsPerPremium = 4L;
this.boostsPerSentGift = 3L;
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 LongSparseIntArray();
this.needShortPollChannels = new LongSparseArray();
this.shortPollOnlines = new LongSparseIntArray();
this.needShortPollOnlines = new LongSparseArray();
this.deletingDialogs = new LongSparseArray();
this.clearingHistoryDialogs = new LongSparseArray();
this.loadingBlockedPeers = false;
this.blockePeers = new LongSparseIntArray();
this.totalBlockedCount = -1;
this.channelViewsToSend = new LongSparseArray();
this.pollsToCheck = new LongSparseArray();
this.premiumFeaturesTypesToPosition = new SparseIntArray();
this.businessFeaturesTypesToPosition = new SparseIntArray();
this.dialogFilters = new ArrayList<>();
this.frozenDialogFilters = null;
this.hiddenUndoChats = new ArrayList<>();
this.dialogFiltersById = new SparseArray<>();
this.suggestedFilters = new ArrayList<>();
this.updatesQueueChannels = new LongSparseArray();
this.updatesStartWaitTimeChannels = new LongSparseLongArray();
this.channelsPts = new LongSparseIntArray();
this.gettingDifferenceChannels = new LongSparseArray();
this.gettingChatInviters = new LongSparseArray();
this.gettingUnknownChannels = new LongSparseArray();
this.gettingUnknownDialogs = new LongSparseArray();
this.checkingLastMessagesDialogs = new LongSparseArray();
this.updatesQueueSeq = new ArrayList<>();
this.updatesQueuePts = new ArrayList<>();
this.updatesQueueQts = new ArrayList<>();
this.fullUsers = new LongSparseArray();
this.fullChats = new LongSparseArray();
this.groupCalls = new LongSparseArray();
this.groupCallsByChatId = new LongSparseArray();
this.userPeerSettings = new LongSparseArray();
this.loadingFullUsers = new HashSet<>();
this.loadedFullUsers = new LongSparseLongArray();
this.loadingFullChats = new HashSet<>();
this.loadingGroupCalls = new HashSet<>();
this.loadingFullParticipants = new HashSet<>();
this.loadedFullParticipants = new HashSet<>();
this.loadedFullChats = new LongSparseLongArray();
this.channelAdmins = new LongSparseArray();
this.loadingChannelAdmins = new LongSparseIntArray();
this.migratedChats = new SparseIntArray();
this.sponsoredMessages = new LongSparseArray();
this.sendAsPeers = new LongSparseArray();
this.reloadingWebpages = new HashMap<>();
this.reloadingWebpagesPending = new LongSparseArray();
this.reloadingScheduledWebpages = new HashMap<>();
this.reloadingScheduledWebpagesPending = new LongSparseArray();
this.reloadingSavedWebpages = new HashMap<>();
this.reloadingSavedWebpagesPending = new LongSparseArray();
this.lastScheduledServerQueryTime = new LongSparseArray();
this.lastQuickReplyServerQueryTime = new LongSparseArray();
this.lastSavedServerQueryTime = new LongSparseArray();
this.lastServerQueryTime = new LongSparseArray();
this.reloadingMessages = new LongSparseArray();
this.readTasks = new ArrayList<>();
this.readTasksMap = new LongSparseArray();
this.repliesReadTasks = new ArrayList<>();
this.threadsReadTasksMap = new HashMap<>();
this.nextDialogsCacheOffset = new SparseIntArray();
this.loadingDialogs = new SparseBooleanArray();
this.dialogsEndReached = new SparseBooleanArray();
this.serverDialogsEndReached = new SparseBooleanArray();
this.getDifferenceFirstSync = true;
this.loadingPinnedDialogs = new SparseIntArray();
this.faqSearchArray = new ArrayList<>();
this.suggestContacts = true;
this.themeCheckRunnable = new MessagesController$.ExternalSyntheticLambda71();
this.passwordCheckRunnable = new MessagesController$.ExternalSyntheticLambda75(this);
this.uploadingThemes = new HashMap<>();
this.appConfigFetcher = new 1(this);
this.maxBroadcastCount = 100;
this.minGroupConvertSize = 200;
this.gifSearchEmojies = new ArrayList<>();
this.diceSuccess = new HashMap<>();
this.emojiSounds = new HashMap<>();
this.emojiInteractions = new HashMap<>();
this.showAnnualPerMonth = false;
this.starrefStartParamPrefixes = new HashSet();
this.directPaymentsCurrency = new ArrayList();
this.emojiStatusUntilValues = new ConcurrentHashMap<>();
AppGlobalConfig appGlobalConfig = new AppGlobalConfig();
this.config = appGlobalConfig;
this.photoSuggestion = new SparseArray<>();
this.dialogDateComparator = new MessagesController$.ExternalSyntheticLambda76(this);
this.dialogComparator = new MessagesController$.ExternalSyntheticLambda77(this);
this.updatesComparator = new MessagesController$.ExternalSyntheticLambda78(this);
this.loadAppConfigRunnable = new MessagesController$.ExternalSyntheticLambda72(this);
this.notifyTranscriptionAudioCooldownUpdate = new MessagesController$.ExternalSyntheticLambda79(this);
this.peerDialogsRequested = new LongSparseArray();
this.peerDialogRequestTimeout = 240000L;
this.dialogPhotos = new LongSparseArray();
this.DIALOGS_LOAD_TYPE_CACHE = 1;
this.DIALOGS_LOAD_TYPE_CHANNEL = 2;
this.DIALOGS_LOAD_TYPE_UNKNOWN = 3;
this.sensitiveAgreed = new HashSet<>();
this.cachedIsUserContactBlocked = new LongSparseArray();
this.loadingIsUserContactBlocked = new HashSet<>();
this.requestIsUserContactBlockedRunnable = new MessagesController$.ExternalSyntheticLambda80(this);
this.effectsFetcher = new 4(this);
this.reportedMessageDelivery = new HashSet<>();
this.pendingReportMessageDelivery = new HashSet<>();
this.sendReportMessageDeliver = new MessagesController$.ExternalSyntheticLambda81(this);
this.commonChats = new android.util.LongSparseArray<>();
this.sendingSuggestedMessageApprovalMap = new HashMap<>();
ImageLoader.getInstance();
getMessagesStorage();
getLocationController();
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda82(this));
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);
}
System.currentTimeMillis();
this.remoteConfigLoaded = this.mainPreferences.getBoolean("remoteConfigLoaded", false);
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 = this.mainPreferences.getString("linkPrefix", "t.me");
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.updateCheckDelay = this.mainPreferences.getInt("updateCheckDelay", 86400);
this.maxFolderPinnedDialogsCountDefault = this.mainPreferences.getInt("maxFolderPinnedDialogsCountDefault", 100);
this.maxFolderPinnedDialogsCountPremium = this.mainPreferences.getInt("maxFolderPinnedDialogsCountPremium", 100);
this.maxMessageLength = this.mainPreferences.getInt("maxMessageLength", 4096);
this.maxCaptionLength = this.mainPreferences.getInt("maxCaptionLength", ConnectionsManager.RequestFlagDoNotWaitFloodWait);
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.revokeTimeLimit = this.mainPreferences.getInt("revokeTimeLimit", ConnectionsManager.DEFAULT_DATACENTER_ID);
this.revokeTimePmLimit = this.mainPreferences.getInt("revokeTimePmLimit", ConnectionsManager.DEFAULT_DATACENTER_ID);
this.canRevokePmInbox = this.mainPreferences.getBoolean("canRevokePmInbox", this.canRevokePmInbox);
this.preloadFeaturedStickers = this.mainPreferences.getBoolean("preloadFeaturedStickers", false);
this.youtubePipType = this.mainPreferences.getString("youtubePipType", "disabled");
this.keepAliveService = this.mainPreferences.getBoolean("keepAliveService", false);
this.backgroundConnection = this.mainPreferences.getBoolean("keepAliveService", false);
this.promoDialogId = this.mainPreferences.getLong("proxy_dialog", 0L);
this.nextPromoInfoCheckTime = this.mainPreferences.getInt("nextPromoInfoCheckTime", 0);
this.promoDialogType = this.mainPreferences.getInt("promo_dialog_type", 0);
this.promoPsaMessage = this.mainPreferences.getString("promo_psa_message", null);
this.promoPsaType = this.mainPreferences.getString("promo_psa_type", null);
this.proxyDialogAddress = this.mainPreferences.getString("proxyDialogAddress", null);
this.venueSearchBot = this.mainPreferences.getString("venueSearchBot", "foursquare");
this.storyVenueSearchBot = this.mainPreferences.getString("storyVenueSearchBot", "foursquare");
this.gifSearchBot = this.mainPreferences.getString("gifSearchBot", "gif");
this.imageSearchBot = this.mainPreferences.getString("imageSearchBot", "pic");
this.blockedCountry = this.mainPreferences.getBoolean("blockedCountry", false);
this.suggestedLangCode = this.mainPreferences.getString("suggestedLangCode", "en");
this.animatedEmojisZoom = this.mainPreferences.getFloat("animatedEmojisZoom", 0.625f);
this.qrLoginCamera = this.mainPreferences.getBoolean("qrLoginCamera", true);
this.saveGifsWithStickers = this.mainPreferences.getBoolean("saveGifsWithStickers", false);
this.filtersEnabled = this.mainPreferences.getBoolean("filtersEnabled", false);
this.getfileExperimentalParams = this.mainPreferences.getBoolean("getfileExperimentalParams", false);
this.smsjobsStickyNotificationEnabled = this.mainPreferences.getBoolean("smsjobsStickyNotificationEnabled", false);
this.showFiltersTooltip = this.mainPreferences.getBoolean("showFiltersTooltip", false);
this.autoarchiveAvailable = this.mainPreferences.getBoolean("autoarchiveAvailable", false);
this.groupCallVideoMaxParticipants = this.mainPreferences.getInt("groipCallVideoMaxParticipants", 30);
this.chatReadMarkSizeThreshold = this.mainPreferences.getInt("chatReadMarkSizeThreshold", 100);
this.chatReadMarkExpirePeriod = this.mainPreferences.getInt("chatReadMarkExpirePeriod", 604800);
this.ringtoneDurationMax = this.mainPreferences.getInt("ringtoneDurationMax", 5);
this.ringtoneSizeMax = this.mainPreferences.getInt("ringtoneSizeMax", 102400);
this.pmReadDateExpirePeriod = this.mainPreferences.getInt("pmReadDateExpirePeriod", 604800);
this.suggestStickersApiOnly = this.mainPreferences.getBoolean("suggestStickersApiOnly", false);
this.roundVideoSize = this.mainPreferences.getInt("roundVideoSize", 384);
this.roundVideoBitrate = this.mainPreferences.getInt("roundVideoBitrate", 1000);
this.roundAudioBitrate = this.mainPreferences.getInt("roundAudioBitrate", 64);
this.pendingSuggestions = this.mainPreferences.getStringSet("pendingSuggestions", null);
this.dismissedSuggestions = this.mainPreferences.getStringSet("dismissedSuggestions", null);
int i2 = this.mainPreferences.getInt("channelsLimitDefault", 500);
this.channelsLimitDefault = i2;
this.channelsLimitPremium = this.mainPreferences.getInt("channelsLimitPremium", i2 * 2);
this.savedGifsLimitDefault = this.mainPreferences.getInt("savedGifsLimitDefault", 200);
this.savedGifsLimitPremium = this.mainPreferences.getInt("savedGifsLimitPremium", 400);
this.stickersFavedLimitDefault = this.mainPreferences.getInt("stickersFavedLimitDefault", 5);
this.stickersFavedLimitPremium = this.mainPreferences.getInt("stickersFavedLimitPremium", 200);
this.maxPinnedDialogsCountDefault = this.mainPreferences.getInt("maxPinnedDialogsCountDefault", 5);
this.maxPinnedDialogsCountPremium = this.mainPreferences.getInt("maxPinnedDialogsCountPremium", 5);
this.maxPinnedDialogsCountDefault = this.mainPreferences.getInt("maxPinnedDialogsCountDefault", 5);
this.maxPinnedDialogsCountPremium = this.mainPreferences.getInt("maxPinnedDialogsCountPremium", 5);
this.dialogFiltersLimitDefault = this.mainPreferences.getInt("dialogFiltersLimitDefault", 10);
this.dialogFiltersLimitPremium = this.mainPreferences.getInt("dialogFiltersLimitPremium", 20);
this.dialogFiltersChatsLimitDefault = this.mainPreferences.getInt("dialogFiltersChatsLimitDefault", 100);
this.dialogFiltersChatsLimitPremium = this.mainPreferences.getInt("dialogFiltersChatsLimitPremium", 200);
this.dialogFiltersPinnedLimitDefault = this.mainPreferences.getInt("dialogFiltersPinnedLimitDefault", 5);
this.dialogFiltersPinnedLimitPremium = this.mainPreferences.getInt("dialogFiltersPinnedLimitPremium", 10);
this.publicLinksLimitDefault = this.mainPreferences.getInt("publicLinksLimitDefault", 10);
this.publicLinksLimitPremium = this.mainPreferences.getInt("publicLinksLimitPremium", 20);
this.captionLengthLimitDefault = this.mainPreferences.getInt("captionLengthLimitDefault", ConnectionsManager.RequestFlagDoNotWaitFloodWait);
this.captionLengthLimitPremium = this.mainPreferences.getInt("captionLengthLimitPremium", 4096);
this.storyCaptionLengthLimitDefault = this.mainPreferences.getInt("storyCaptionLengthLimit", 200);
this.storyCaptionLengthLimitPremium = this.mainPreferences.getInt("storyCaptionLengthLimitPremium", ConnectionsManager.RequestFlagListenAfterCancel);
this.aboutLengthLimitDefault = this.mainPreferences.getInt("aboutLengthLimitDefault", 70);
this.aboutLengthLimitPremium = this.mainPreferences.getInt("aboutLengthLimitPremium", 140);
this.reactionsUserMaxDefault = this.mainPreferences.getInt("reactionsUserMaxDefault", 1);
this.reactionsUserMaxPremium = this.mainPreferences.getInt("reactionsUserMaxPremium", 3);
this.reactionsInChatMax = this.mainPreferences.getInt("reactionsInChatMax", 3);
int i3 = this.mainPreferences.getInt("uploadMaxFileParts", 4000);
this.uploadMaxFileParts = i3;
this.uploadMaxFilePartsPremium = this.mainPreferences.getInt("uploadMaxFilePartsPremium", i3 * 2);
this.premiumInvoiceSlug = this.mainPreferences.getString("premiumInvoiceSlug", null);
this.starsStargiftResaleAmountMax = this.mainPreferences.getLong("starsStargiftResaleAmountMax", 35000L);
this.starsStargiftResaleAmountMin = this.mainPreferences.getLong("starsStargiftResaleAmountMin", 125L);
this.starsStargiftResaleCommisionPermille = this.mainPreferences.getInt("starsStargiftResaleCommisionPermille", 800);
this.premiumBotUsername = this.mainPreferences.getString("premiumBotUsername", null);
this.premiumLocked = this.mainPreferences.getBoolean("premiumLocked", false);
this.starsLocked = this.mainPreferences.getBoolean("starsLocked", true);
this.transcribeButtonPressed = this.mainPreferences.getInt("transcribeButtonPressed", 0);
this.forumUpgradeParticipantsMin = this.mainPreferences.getInt("forumUpgradeParticipantsMin", 200);
this.topicsPinnedLimit = this.mainPreferences.getInt("topicsPinnedLimit", 3);
this.telegramAntispamUserId = this.mainPreferences.getLong("telegramAntispamUserId", -1L);
this.telegramAntispamGroupSizeMin = this.mainPreferences.getInt("telegramAntispamGroupSizeMin", 100);
this.hiddenMembersGroupSizeMin = this.mainPreferences.getInt("hiddenMembersGroupSizeMin", 100);
this.chatlistUpdatePeriod = this.mainPreferences.getInt("chatlistUpdatePeriod", 3600);
this.uploadMarkupVideo = this.mainPreferences.getBoolean("uploadMarkupVideo", true);
this.giftAttachMenuIcon = this.mainPreferences.getBoolean("giftAttachMenuIcon", false);
this.giftTextFieldIcon = this.mainPreferences.getBoolean("giftTextFieldIcon", false);
this.checkResetLangpack = this.mainPreferences.getInt("checkResetLangpack", 0);
this.smallQueueMaxActiveOperations = this.mainPreferences.getInt("smallQueueMaxActiveOperations", 5);
this.largeQueueMaxActiveOperations = this.mainPreferences.getInt("largeQueueMaxActiveOperations", 2);
this.stealthModeFuture = this.mainPreferences.getInt("stories_stealth_future_period", 1500);
this.storiesChangelogUserId = this.mainPreferences.getLong("stories_changelog_user_id", 777000L);
this.giveawayAddPeersMax = this.mainPreferences.getLong("giveaway_add_peers_max", 10L);
this.giveawayCountriesMax = this.mainPreferences.getLong("giveaway_countries_max", 10L);
this.giveawayBoostsPerPremium = this.mainPreferences.getLong("giveaway_boosts_per_premium", 4L);
this.boostsPerSentGift = this.mainPreferences.getLong("boosts_per_sent_gift", 3L);
this.giveawayPeriodMax = this.mainPreferences.getLong("giveaway_period_max", 7L);
this.stealthModePast = this.mainPreferences.getInt("stories_stealth_past_period", 300);
this.stealthModeCooldown = this.mainPreferences.getInt("stories_stealth_cooldown_period", 3600);
boolean z = ConnectionsManager.native_isTestBackend(this.currentAccount) != 0;
this.chatlistInvitesLimitDefault = this.mainPreferences.getInt("chatlistInvitesLimitDefault", 3);
this.storyExpiringLimitDefault = this.mainPreferences.getInt("storyExpiringLimitDefault", 50);
this.storyExpiringLimitPremium = this.mainPreferences.getInt("storyExpiringLimitPremium", 100);
this.storiesSentWeeklyLimitDefault = this.mainPreferences.getInt("storiesSentWeeklyLimitDefault", 7);
this.storiesSuggestedReactionsLimitDefault = this.mainPreferences.getInt("storiesSuggestedReactionsLimitDefault", 1);
this.storiesSuggestedReactionsLimitPremium = this.mainPreferences.getInt("storiesSuggestedReactionsLimitPremium", 5);
this.storiesSentWeeklyLimitPremium = this.mainPreferences.getInt("storiesSentWeeklyLimitPremium", 70);
this.storiesSentMonthlyLimitDefault = this.mainPreferences.getInt("storiesSentMonthlyLimitDefault", 30);
this.storiesSentMonthlyLimitPremium = this.mainPreferences.getInt("storiesSentMonthlyLimitPremium", 300);
this.channelBgIconLevelMin = this.mainPreferences.getInt("channelBgIconLevelMin", 1);
this.channelProfileIconLevelMin = this.mainPreferences.getInt("channelProfileIconLevelMin", 1);
this.channelEmojiStatusLevelMin = this.mainPreferences.getInt("channelEmojiStatusLevelMin", 1);
this.groupProfileBgIconLevelMin = this.mainPreferences.getInt("groupProfileBgIconLevelMin", 1);
this.groupEmojiStatusLevelMin = this.mainPreferences.getInt("groupEmojiStatusLevelMin", 1);
this.groupEmojiStickersLevelMin = this.mainPreferences.getInt("groupEmojiStickersLevelMin", 1);
this.groupWallpaperLevelMin = this.mainPreferences.getInt("groupWallpaperLevelMin", 1);
this.groupCustomWallpaperLevelMin = this.mainPreferences.getInt("groupCustomWallpaperLevelMin", 1);
this.groupTranscribeLevelMin = this.mainPreferences.getInt("groupTranscribeLevelMin", 1);
this.quickRepliesLimit = this.mainPreferences.getInt("quickRepliesLimit", 10);
this.quickReplyMessagesLimit = this.mainPreferences.getInt("quickReplyMessagesLimit", 20);
this.channelWallpaperLevelMin = this.mainPreferences.getInt("channelWallpaperLevelMin", 1);
this.channelCustomWallpaperLevelMin = this.mainPreferences.getInt("channelCustomWallpaperLevelMin", 1);
this.chatlistInvitesLimitPremium = this.mainPreferences.getInt("chatlistInvitesLimitPremium", z ? 5 : 20);
this.chatlistJoinedLimitDefault = this.mainPreferences.getInt("chatlistJoinedLimitDefault", 2);
this.chatlistJoinedLimitPremium = this.mainPreferences.getInt("chatlistJoinedLimitPremium", z ? 5 : 20);
this.stargiftsMessageLengthMax = this.mainPreferences.getInt("stargiftsMessageLengthMax", 255);
this.stargiftsConvertPeriodMax = this.mainPreferences.getInt("stargiftsConvertPeriodMax", z ? 300 : 7776000);
this.videoIgnoreAltDocuments = this.mainPreferences.getBoolean("videoIgnoreAltDocuments", false);
this.disableBotFullscreenBlur = this.mainPreferences.getBoolean("disableBotFullscreenBlur", false);
this.tonBlockchainExplorerUrl = this.mainPreferences.getString("tonBlockchainExplorerUrl", "https://tonviewer.com/");
this.starsPaidMessageAmountMax = this.mainPreferences.getLong("starsPaidMessageAmountMax", 10000L);
this.starsPaidMessageCommissionPermille = this.mainPreferences.getInt("starsPaidMessageCommissionPermille", 850);
this.stargiftsPinnedToTopLimit = this.mainPreferences.getInt("stargiftsPinnedToTopLimit", 6);
this.starsPaidMessagesAvailable = this.mainPreferences.getBoolean("starsPaidMessagesAvailable", true);
this.freezeSinceDate = this.mainPreferences.getLong("freezeSinceDate", 0L);
this.freezeUntilDate = this.mainPreferences.getLong("freezeUntilDate", 0L);
this.conferenceCallSizeLimit = this.mainPreferences.getInt("conferenceCallSizeLimit", z ? 5 : 100);
this.callRequestsDisabled = this.mainPreferences.getBoolean("callRequestsDisabled", false);
this.pollAnswersMax = this.mainPreferences.getInt("pollAnswersMax", 12);
this.todoItemsMax = this.mainPreferences.getInt("todoItemsMax", z ? 10 : 30);
this.todoTitleLengthMax = this.mainPreferences.getInt("todoTitleLengthMax", 32);
this.todoItemLengthMax = this.mainPreferences.getInt("todoItemLengthMax", 64);
this.translationsManualEnabled = this.mainPreferences.getString("translationsManualEnabled", "enabled");
this.translationsAutoEnabled = this.mainPreferences.getString("translationsAutoEnabled", "enabled");
this.freezeAppealUrl = this.mainPreferences.getString("freezeAppealUrl", "t.me/spambot");
this.enableGiftsInProfile = this.mainPreferences.getBoolean("enableGiftsInProfile", true);
this.storiesPosting = this.mainPreferences.getString("storiesPosting", "enabled");
this.storiesEntities = this.mainPreferences.getString("storiesEntities", "premium");
this.storiesExportNopublicLink = this.mainPreferences.getBoolean("storiesExportNopublicLink", false);
this.authorizationAutoconfirmPeriod = this.mainPreferences.getInt("authorization_autoconfirm_period", 604800);
this.quoteLengthMax = this.mainPreferences.getInt("quoteLengthMax", ConnectionsManager.RequestFlagDoNotWaitFloodWait);
this.giveawayGiftsPurchaseAvailable = this.mainPreferences.getBoolean("giveawayGiftsPurchaseAvailable", false);
this.peerColors = PeerColors.fromString(0, this.mainPreferences.getString("peerColors", ""));
this.profilePeerColors = PeerColors.fromString(1, this.mainPreferences.getString("profilePeerColors", ""));
int i4 = this.mainPreferences.getInt("transcribeAudioTrialWeeklyNumber", BuildVars.DEBUG_PRIVATE_VERSION ? 2 : 0);
this.transcribeAudioTrialWeeklyNumber = i4;
this.transcribeAudioTrialCurrentNumber = this.mainPreferences.getInt("transcribeAudioTrialCurrentNumber", i4);
this.transcribeAudioTrialDurationMax = this.mainPreferences.getInt("transcribeAudioTrialDurationMax", 300);
this.transcribeAudioTrialCooldownUntil = this.mainPreferences.getInt("transcribeAudioTrialCooldownUntil", 0);
this.recommendedChannelsLimitDefault = this.mainPreferences.getInt("recommendedChannelsLimitDefault", 10);
this.recommendedChannelsLimitPremium = this.mainPreferences.getInt("recommendedChannelsLimitPremium", 100);
this.boostsChannelLevelMax = this.mainPreferences.getInt("boostsChannelLevelMax", 100);
this.channelRestrictSponsoredLevelMin = this.mainPreferences.getInt("channelRestrictSponsoredLevelMin", 30);
this.channelAutotranslationLevelMin = this.mainPreferences.getInt("channelAutotranslationLevelMin", 3);
this.savedDialogsPinnedLimitDefault = this.mainPreferences.getInt("savedDialogsPinnedLimitDefault", 4);
this.savedDialogsPinnedLimitPremium = this.mainPreferences.getInt("savedDialogsPinnedLimitPremium", 6);
this.storyQualityFull = this.mainPreferences.getBoolean("storyQualityFull", true);
this.savedViewAsChats = this.mainPreferences.getBoolean("savedViewAsChats", false);
this.folderTags = this.mainPreferences.getBoolean("folderTags", false);
this.uploadPremiumSpeedupUpload = this.mainPreferences.getFloat("uploadPremiumSpeedupUpload", 10.0f);
this.uploadPremiumSpeedupDownload = this.mainPreferences.getFloat("uploadPremiumSpeedupDownload", 10.0f);
this.uploadPremiumSpeedupNotifyPeriod = this.mainPreferences.getInt("uploadPremiumSpeedupNotifyPeriod2", 3600);
this.introTitleLengthLimit = this.mainPreferences.getInt("introTitleLengthLimit", 32);
this.introDescriptionLengthLimit = this.mainPreferences.getInt("introDescriptionLengthLimit", 72);
this.businessChatLinksLimit = this.mainPreferences.getInt("businessChatLinksLimit", 100);
this.channelRevenueWithdrawalEnabled = this.mainPreferences.getBoolean("channelRevenueWithdrawalEnabled", false);
this.newNoncontactPeersRequirePremiumWithoutOwnpremium = this.mainPreferences.getBoolean("newNoncontactPeersRequirePremiumWithoutOwnpremium", false);
this.reactionsUniqMax = this.mainPreferences.getInt("reactionsUniqMax", 11);
this.premiumManageSubscriptionUrl = this.mainPreferences.getString("premiumManageSubscriptionUrl", ApplicationLoader.isStandaloneBuild() ? "https://t.me/premiumbot?start=status" : "https://play.google.com/store/account/subscriptions?sku=telegram_premium&package=org.telegram.messenger");
this.androidDisableRoundCamera2 = this.mainPreferences.getBoolean("androidDisableRoundCamera2", true);
this.storiesPinnedToTopCountMax = this.mainPreferences.getInt("storiesPinnedToTopCountMax", 3);
this.showAnnualPerMonth = this.mainPreferences.getBoolean("showAnnualPerMonth", false);
this.canEditFactcheck = this.mainPreferences.getBoolean("canEditFactcheck", false);
this.factcheckLengthLimit = this.mainPreferences.getInt("factcheckLengthLimit", ConnectionsManager.RequestFlagDoNotWaitFloodWait);
this.starsRevenueWithdrawalMin = this.mainPreferences.getLong("starsRevenueWithdrawalMin", 1000L);
this.starsPaidPostAmountMax = this.mainPreferences.getLong("starsPaidPostAmountMax", 10000L);
this.botPreviewMediasMax = this.mainPreferences.getInt("botPreviewMediasMax", 10);
this.webAppAllowedProtocols = this.mainPreferences.getStringSet("webAppAllowedProtocols", new HashSet(Arrays.asList("http", "https")));
this.ignoreRestrictionReasons = this.mainPreferences.getStringSet("ignoreRestrictionReasons", new HashSet(Arrays.asList(new String[0])));
this.tonProxyAddress = this.mainPreferences.getString("tonProxyAddress", "magic.org");
this.weatherSearchUsername = this.mainPreferences.getString("weatherSearchUsername", "izweatherbot");
this.storyWeatherPreload = this.mainPreferences.getBoolean("storyWeatherPreload", true);
this.starsGiftsEnabled = this.mainPreferences.getBoolean("starsGiftsEnabled", true);
this.stargiftsBlocked = this.mainPreferences.getBoolean("stargiftsBlocked", true);
this.starsPaidReactionAmountMax = this.mainPreferences.getLong("starsPaidReactionAmountMax", 10000L);
this.starsSubscriptionAmountMax = this.mainPreferences.getLong("starsSubscriptionAmountMax", 2500L);
this.starsUsdSellRate1000 = this.mainPreferences.getFloat("starsUsdSellRate1000", 2000.0f);
this.starsUsdWithdrawRate1000 = this.mainPreferences.getFloat("starsUsdWithdrawRate1000", 1200.0f);
this.sponsoredLinksInappAllow = this.mainPreferences.getBoolean("sponsoredLinksInappAllow", false);
this.starrefProgramAllowed = this.mainPreferences.getBoolean("starrefProgramAllowed", false);
this.starrefConnectAllowed = this.mainPreferences.getBoolean("starrefConnectAllowed", false);
this.starrefStartParamPrefixes = this.mainPreferences.getStringSet("starrefStartParamPrefixes", new HashSet(Arrays.asList("_tgr_")));
this.starrefMinCommissionPermille = this.mainPreferences.getInt("starrefMinCommissionPermille", 1);
this.starrefMaxCommissionPermille = this.mainPreferences.getInt("starrefMaxCommissionPermille", 400);
this.botVerificationDescriptionLengthLimit = this.mainPreferences.getInt("botVerificationDescriptionLengthLimit", 70);
this.paidReactionsPrivacyTime = this.mainPreferences.getLong("paidReactionsAnonymousTime", 0L);
appGlobalConfig.load(this.mainPreferences);
System.currentTimeMillis();
this.paidReactionsPrivacy = null;
if (System.currentTimeMillis() - this.paidReactionsPrivacyTime < 7200000) {
this.paidReactionsPrivacy = this.mainPreferences.contains("paidReactionsDialogId") ? Long.valueOf(this.mainPreferences.getLong("paidReactionsDialogId", 0L)) : Long.valueOf(this.mainPreferences.getBoolean("paidReactionsAnonymous", false) ? 2666000L : 0L);
}
scheduleTranscriptionUpdate();
BuildVars.GOOGLE_AUTH_CLIENT_ID = this.mainPreferences.getString("googleAuthClientId", BuildVars.GOOGLE_AUTH_CLIENT_ID);
this.dcDomainName = this.mainPreferences.contains("dcDomainName2") ? this.mainPreferences.getString("dcDomainName2", "apv3.stel.com") : z ? "tapv3.stel.com" : "apv3.stel.com";
if (this.mainPreferences.contains("webFileDatacenterId")) {
this.webFileDatacenterId = this.mainPreferences.getInt("webFileDatacenterId", 4);
} else {
this.webFileDatacenterId = z ? 2 : 4;
}
Set<String> stringSet = this.mainPreferences.getStringSet("directPaymentsCurrency", null);
if (stringSet != null) {
this.directPaymentsCurrency.clear();
this.directPaymentsCurrency.addAll(stringSet);
}
loadPremiumFeaturesPreviewOrder(this.premiumFeaturesTypesToPosition, this.mainPreferences.getString("premiumFeaturesTypesToPosition", null));
loadPremiumFeaturesPreviewOrder(this.businessFeaturesTypesToPosition, this.mainPreferences.getString("businessFeaturesTypesToPosition", null));
this.pendingSuggestions = this.pendingSuggestions != null ? new HashSet(this.pendingSuggestions) : new HashSet();
this.dismissedSuggestions = this.dismissedSuggestions != null ? new HashSet(this.dismissedSuggestions) : new HashSet();
Set<String> stringSet2 = this.mainPreferences.getStringSet("exportUri2", null);
this.exportUri = stringSet2;
if (stringSet2 != null) {
this.exportUri = new HashSet(this.exportUri);
} else {
HashSet hashSet = new HashSet();
this.exportUri = hashSet;
hashSet.add("content://(\\d+@)?com\\.whatsapp\\.provider\\.media/export_chat/");
this.exportUri.add("content://(\\d+@)?com\\.whatsapp\\.w4b\\.provider\\.media/export_chat/");
this.exportUri.add("content://jp\\.naver\\.line\\.android\\.line\\.common\\.FileProvider/export-chat/");
this.exportUri.add(".*WhatsApp.*\\.txt$");
this.exportUri.add(".*WhatsApp.*\\.zip$");
}
Set<String> stringSet3 = this.mainPreferences.getStringSet("exportGroupUri", null);
this.exportGroupUri = stringSet3;
if (stringSet3 != null) {
this.exportGroupUri = new HashSet(this.exportGroupUri);
} else {
HashSet hashSet2 = new HashSet();
this.exportGroupUri = hashSet2;
hashSet2.add("@g.us/");
}
Set<String> stringSet4 = this.mainPreferences.getStringSet("exportPrivateUri", null);
this.exportPrivateUri = stringSet4;
if (stringSet4 != null) {
this.exportPrivateUri = new HashSet(this.exportPrivateUri);
} else {
HashSet hashSet3 = new HashSet();
this.exportPrivateUri = hashSet3;
hashSet3.add("@s.whatsapp.net/");
}
Set<String> stringSet5 = this.mainPreferences.getStringSet("autologinDomains", null);
this.autologinDomains = stringSet5;
this.autologinDomains = stringSet5 != null ? new HashSet(this.autologinDomains) : new HashSet();
Set<String> stringSet6 = this.mainPreferences.getStringSet("authDomains", null);
this.authDomains = stringSet6;
this.authDomains = stringSet6 != null ? new HashSet(this.authDomains) : new HashSet();
this.autologinToken = this.mainPreferences.getString("autologinToken", null);
Set<String> stringSet7 = this.mainPreferences.getStringSet("diceEmojies", null);
if (stringSet7 == null) {
HashSet<String> hashSet4 = new HashSet<>();
this.diceEmojies = hashSet4;
hashSet4.add("🎲");
this.diceEmojies.add("🎯");
} else {
this.diceEmojies = new HashSet<>(stringSet7);
}
String string = this.mainPreferences.getString("diceSuccess", null);
if (string == null) {
this.diceSuccess.put("🎯", new DiceFrameSuccess(62, 6));
} else {
try {
byte[] decode = Base64.decode(string, 0);
if (decode != null) {
SerializedData serializedData = new SerializedData(decode);
int readInt32 = serializedData.readInt32(true);
for (int i5 = 0; i5 < readInt32; i5++) {
this.diceSuccess.put(serializedData.readString(true), new DiceFrameSuccess(serializedData.readInt32(true), serializedData.readInt32(true)));
}
serializedData.cleanup();
}
} catch (Exception e) {
FileLog.e(e);
}
}
String string2 = this.mainPreferences.getString("emojiSounds", null);
if (string2 != null) {
try {
byte[] decode2 = Base64.decode(string2, 0);
if (decode2 != null) {
SerializedData serializedData2 = new SerializedData(decode2);
int readInt322 = serializedData2.readInt32(true);
for (int i6 = 0; i6 < readInt322; i6++) {
this.emojiSounds.put(serializedData2.readString(true), new EmojiSound(serializedData2.readInt64(true), serializedData2.readInt64(true), serializedData2.readByteArray(true)));
}
serializedData2.cleanup();
}
} catch (Exception e2) {
FileLog.e(e2);
}
}
String string3 = this.mainPreferences.getString("gifSearchEmojies", null);
if (string3 == null) {
this.gifSearchEmojies.add("👍");
this.gifSearchEmojies.add("👎");
this.gifSearchEmojies.add("😍");
this.gifSearchEmojies.add("😂");
this.gifSearchEmojies.add("😮");
this.gifSearchEmojies.add("🙄");
this.gifSearchEmojies.add("😥");
this.gifSearchEmojies.add("😡");
this.gifSearchEmojies.add("🥳");
this.gifSearchEmojies.add("😎");
} else {
try {
byte[] decode3 = Base64.decode(string3, 0);
if (decode3 != null) {
SerializedData serializedData3 = new SerializedData(decode3);
int readInt323 = serializedData3.readInt32(true);
for (int i7 = 0; i7 < readInt323; i7++) {
this.gifSearchEmojies.add(serializedData3.readString(true));
}
serializedData3.cleanup();
}
} catch (Exception e3) {
FileLog.e(e3);
}
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda72(this), 2000L);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda73(this), 400L);
this.topicsController = new TopicsController(i);
this.cacheByChatsController = new CacheByChatsController(i);
this.translateController = new TranslateController(this);
Utilities.globalQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda74(this));
}
private void addDialogToItsFolder(int i, TLRPC.Dialog dialog) {
int i2 = dialog instanceof TLRPC.TL_dialogFolder ? 0 : dialog.folder_id;
ArrayList<TLRPC.Dialog> arrayList = this.dialogsByFolder.get(i2);
if (arrayList == null) {
arrayList = new ArrayList<>();
this.dialogsByFolder.put(i2, arrayList);
}
if (i == -1) {
arrayList.add(dialog);
return;
}
if (i == -2) {
if (arrayList.isEmpty() || !(arrayList.get(0) instanceof TLRPC.TL_dialogFolder)) {
arrayList.add(0, dialog);
return;
}
i = 1;
}
arrayList.add(i, dialog);
}
private void addOrRemoveActiveVoiceChat(TLRPC.Chat chat) {
if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda197(this, chat));
} else {
lambda$addOrRemoveActiveVoiceChat$55(chat);
}
}
public void lambda$addOrRemoveActiveVoiceChat$55(TLRPC.Chat chat) {
TLRPC.Chat chat2 = this.activeVoiceChatsMap.get(Long.valueOf(chat.id));
if (chat.call_active && chat.call_not_empty && chat.migrated_to == null && !ChatObject.isNotInChat(chat)) {
if (chat2 != null) {
return;
}
this.activeVoiceChatsMap.put(Long.valueOf(chat.id), chat);
getNotificationCenter().postNotificationName(NotificationCenter.activeGroupCallsUpdated, new Object[0]);
return;
}
if (chat2 == null) {
return;
}
this.activeVoiceChatsMap.remove(Long.valueOf(chat.id));
getNotificationCenter().postNotificationName(NotificationCenter.activeGroupCallsUpdated, new Object[0]);
}
private void applyAppConfig(org.telegram.tgnet.TLRPC.TL_jsonObject r33) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.applyAppConfig(org.telegram.tgnet.TLRPC$TL_jsonObject):void");
}
private void applyDialogNotificationsSettings(long j, long j2, TLRPC.PeerNotifySettings peerNotifySettings) {
getNotificationsController().getNotificationsSettingsFacade().applyDialogNotificationsSettings(j, j2, peerNotifySettings);
}
private void applyDialogsNotificationsSettings(ArrayList<TLRPC.Dialog> arrayList) {
SharedPreferences.Editor edit = getNotificationsSettings(this.currentAccount).edit();
for (int i = 0; i < arrayList.size(); i++) {
TLRPC.Dialog dialog = arrayList.get(i);
if (dialog.peer != null && (dialog.notify_settings instanceof TLRPC.TL_peerNotifySettings)) {
getNotificationsController().getNotificationsSettingsFacade().setSettingsForDialog(edit, dialog, dialog.notify_settings);
}
}
edit.apply();
}
private boolean applyFoldersUpdates(ArrayList<TLRPC.TL_updateFolderPeers> arrayList) {
if (arrayList == null) {
return false;
}
int size = arrayList.size();
int i = 0;
boolean z = false;
while (i < size) {
TLRPC.TL_updateFolderPeers tL_updateFolderPeers = arrayList.get(i);
int size2 = tL_updateFolderPeers.folder_peers.size();
for (int i2 = 0; i2 < size2; i2++) {
TLRPC.TL_folderPeer tL_folderPeer = (TLRPC.TL_folderPeer) tL_updateFolderPeers.folder_peers.get(i2);
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(DialogObject.getPeerDialogId(tL_folderPeer.peer));
if (dialog != null) {
int i3 = dialog.folder_id;
int i4 = tL_folderPeer.folder_id;
if (i3 != i4) {
dialog.pinned = false;
dialog.pinnedNum = 0;
dialog.folder_id = i4;
this.hasArchivedChats = true;
checkArchiveFolder();
}
}
}
getMessagesStorage().setDialogsFolderId(arrayList.get(i).folder_peers, (ArrayList) null, 0L, 0);
i++;
z = true;
}
return z;
}
private void approveOrRejectSuggestedMessageImpl(long j, int i, int i2, boolean z, String str) {
if (this.sendingSuggestedMessageApprovalMap.containsKey(j + "_" + i)) {
return;
}
TLRPC.TL_messages_toggleSuggestedPostApproval tL_messages_toggleSuggestedPostApproval = new TLRPC.TL_messages_toggleSuggestedPostApproval();
tL_messages_toggleSuggestedPostApproval.reject = z;
tL_messages_toggleSuggestedPostApproval.peer = getMessagesController().getInputPeer(j);
tL_messages_toggleSuggestedPostApproval.msg_id = i;
if (i2 > 0) {
tL_messages_toggleSuggestedPostApproval.schedule_date = i2;
tL_messages_toggleSuggestedPostApproval.flags |= 1;
}
if (z && !TextUtils.isEmpty(str)) {
tL_messages_toggleSuggestedPostApproval.reject_comment = str;
}
this.sendingSuggestedMessageApprovalMap.put(j + "_" + i, Boolean.valueOf(!z));
getConnectionsManager().sendRequest(tL_messages_toggleSuggestedPostApproval, new MessagesController$.ExternalSyntheticLambda56(this, j, i));
}
private void checkChannelError(String str, long j) {
str.hashCode();
switch (str) {
case "USER_BANNED_IN_CHANNEL":
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, new Object[]{Long.valueOf(j), 2});
break;
case "CHANNEL_PRIVATE":
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, new Object[]{Long.valueOf(j), 0});
break;
case "CHANNEL_PUBLIC_GROUP_NA":
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, new Object[]{Long.valueOf(j), 1});
break;
}
}
private boolean checkDeletingTask(boolean z) {
int i;
int currentTime = getConnectionsManager().getCurrentTime();
if ((this.currentDeletingTaskMids == null && this.currentDeletingTaskMediaMids == null) || (!z && ((i = this.currentDeletingTaskTime) == 0 || i > currentTime))) {
return false;
}
this.currentDeletingTaskTime = 0;
if (this.currentDeleteTaskRunnable != null && !z) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
}
this.currentDeleteTaskRunnable = null;
LongSparseArray longSparseArray = this.currentDeletingTaskMids;
LongSparseArray m2clone = longSparseArray != null ? longSparseArray.m2clone() : null;
LongSparseArray longSparseArray2 = this.currentDeletingTaskMediaMids;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda217(this, m2clone, longSparseArray2 != null ? longSparseArray2.m2clone() : null));
return true;
}
public void lambda$checkPromoInfo$154(boolean z) {
String str;
boolean z2 = false;
if (z && this.checkingPromoInfo) {
this.checkingPromoInfo = false;
}
if ((z || this.nextPromoInfoCheckTime <= getConnectionsManager().getCurrentTime()) && !this.checkingPromoInfo) {
if (this.checkingPromoInfoRequestId != 0) {
getConnectionsManager().cancelRequest(this.checkingPromoInfoRequestId, true);
this.checkingPromoInfoRequestId = 0;
}
SharedPreferences globalMainSettings = getGlobalMainSettings();
globalMainSettings.getBoolean("proxy_enabled", true);
String string = globalMainSettings.getString("proxy_ip", "");
String string2 = globalMainSettings.getString("proxy_secret", "");
if (this.promoDialogId != 0 && this.promoDialogType == PROMO_TYPE_PROXY && (str = this.proxyDialogAddress) != null) {
if (!str.equals(string + string2)) {
z2 = true;
}
}
int i = this.lastCheckPromoId + 1;
this.lastCheckPromoId = i;
this.checkingPromoInfo = true;
this.checkingPromoInfoRequestId = getConnectionsManager().sendRequest(new TLRPC.TL_help_getPromoData(), new MessagesController$.ExternalSyntheticLambda48(this, i, string, string2));
if (z2) {
this.promoDialogId = 0L;
this.proxyDialogAddress = null;
this.nextPromoInfoCheckTime = getConnectionsManager().getCurrentTime() + 3600;
getGlobalMainSettings().edit().putLong("proxy_dialog", this.promoDialogId).remove("proxyDialogAddress").putInt("nextPromoInfoCheckTime", this.nextPromoInfoCheckTime).commit();
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda49(this));
}
}
}
private void checkReadTasks() {
long elapsedRealtime = SystemClock.elapsedRealtime();
int size = this.readTasks.size();
int i = 0;
int i2 = 0;
while (i2 < size) {
ReadTask readTask = this.readTasks.get(i2);
if (readTask.sendRequestTime <= elapsedRealtime) {
completeReadTask(readTask);
this.readTasks.remove(i2);
this.readTasksMap.remove(readTask.dialogId);
i2--;
size--;
}
i2++;
}
int size2 = this.repliesReadTasks.size();
while (i < size2) {
ReadTask readTask2 = this.repliesReadTasks.get(i);
if (readTask2.sendRequestTime <= elapsedRealtime) {
completeReadTask(readTask2);
this.repliesReadTasks.remove(i);
this.threadsReadTasksMap.remove(readTask2.dialogId + "_" + readTask2.replyId);
i += -1;
size2 += -1;
}
i++;
}
}
private void checkTosUpdate() {
if (this.nextTosCheckTime > getConnectionsManager().getCurrentTime() || this.checkingTosUpdate || !getUserConfig().isClientActivated()) {
return;
}
this.checkingTosUpdate = true;
getConnectionsManager().sendRequest(new TLRPC.TL_help_getTermsOfServiceUpdate(), new MessagesController$.ExternalSyntheticLambda259(this));
}
private void completeReadTask(ReadTask readTask) {
TLRPC.TL_messages_readDiscussion tL_messages_readDiscussion;
ConnectionsManager connectionsManager;
MessagesController$.ExternalSyntheticLambda198 externalSyntheticLambda199;
if (readTask.replyId != 0 && readTask.monoForumPeerId == 0) {
tL_messages_readDiscussion = new TLRPC.TL_messages_readDiscussion();
tL_messages_readDiscussion.msg_id = (int) readTask.replyId;
tL_messages_readDiscussion.peer = getInputPeer(readTask.dialogId);
tL_messages_readDiscussion.read_max_id = readTask.maxId;
connectionsManager = getConnectionsManager();
externalSyntheticLambda199 = new MessagesController$.ExternalSyntheticLambda198();
} else {
if (DialogObject.isEncryptedDialog(readTask.dialogId)) {
TLRPC.EncryptedChat encryptedChat = getEncryptedChat(Integer.valueOf(DialogObject.getEncryptedChatId(readTask.dialogId)));
byte[] bArr = encryptedChat.auth_key;
if (bArr == null || bArr.length <= 1 || !(encryptedChat instanceof TLRPC.TL_encryptedChat)) {
return;
}
TLRPC.TL_messages_readEncryptedHistory tL_messages_readEncryptedHistory = new TLRPC.TL_messages_readEncryptedHistory();
TLRPC.TL_inputEncryptedChat tL_inputEncryptedChat = new TLRPC.TL_inputEncryptedChat();
tL_messages_readEncryptedHistory.peer = tL_inputEncryptedChat;
tL_inputEncryptedChat.chat_id = encryptedChat.id;
tL_inputEncryptedChat.access_hash = encryptedChat.access_hash;
tL_messages_readEncryptedHistory.max_date = readTask.maxDate;
getConnectionsManager().sendRequest(tL_messages_readEncryptedHistory, new MessagesController$.ExternalSyntheticLambda200());
return;
}
TLRPC.InputPeer inputPeer = getInputPeer(readTask.dialogId);
if (readTask.monoForumPeerId != 0) {
tL_messages_readDiscussion = new TLRPC.TL_messages_readSavedHistory();
((TLRPC.TL_messages_readSavedHistory) tL_messages_readDiscussion).parent_peer = getInputPeer(readTask.dialogId);
((TLRPC.TL_messages_readSavedHistory) tL_messages_readDiscussion).peer = getInputPeer(readTask.monoForumPeerId);
((TLRPC.TL_messages_readSavedHistory) tL_messages_readDiscussion).max_id = readTask.maxId;
} else if (inputPeer instanceof TLRPC.TL_inputPeerChannel) {
tL_messages_readDiscussion = new TLRPC.TL_channels_readHistory();
((TLRPC.TL_channels_readHistory) tL_messages_readDiscussion).channel = getInputChannel(-readTask.dialogId);
((TLRPC.TL_channels_readHistory) tL_messages_readDiscussion).max_id = readTask.maxId;
} else {
TLRPC.TL_messages_readDiscussion tL_messages_readHistory = new TLRPC.TL_messages_readHistory();
((TLRPC.TL_messages_readHistory) tL_messages_readHistory).peer = inputPeer;
((TLRPC.TL_messages_readHistory) tL_messages_readHistory).max_id = readTask.maxId;
tL_messages_readDiscussion = tL_messages_readHistory;
}
connectionsManager = getConnectionsManager();
externalSyntheticLambda199 = new MessagesController$.ExternalSyntheticLambda199(this);
}
connectionsManager.sendRequest(tL_messages_readDiscussion, externalSyntheticLambda199);
}
public static TLRPC.TL_emojiStatusCollectible emojiStatusCollectibleFromGift(TL_stars.TL_starGiftUnique tL_starGiftUnique) {
TLRPC.TL_emojiStatusCollectible tL_emojiStatusCollectible = new TLRPC.TL_emojiStatusCollectible();
tL_emojiStatusCollectible.collectible_id = ((TL_stars.StarGift) tL_starGiftUnique).id;
TL_stars.starGiftAttributeModel findAttribute = StarsController.findAttribute(((TL_stars.StarGift) tL_starGiftUnique).attributes, TL_stars.starGiftAttributeModel.class);
TL_stars.starGiftAttributeBackdrop findAttribute2 = StarsController.findAttribute(((TL_stars.StarGift) tL_starGiftUnique).attributes, TL_stars.starGiftAttributeBackdrop.class);
TL_stars.starGiftAttributePattern findAttribute3 = StarsController.findAttribute(((TL_stars.StarGift) tL_starGiftUnique).attributes, TL_stars.starGiftAttributePattern.class);
tL_emojiStatusCollectible.title = ((TL_stars.StarGift) tL_starGiftUnique).title + " #" + ((TL_stars.StarGift) tL_starGiftUnique).num;
if (findAttribute != null) {
tL_emojiStatusCollectible.document_id = findAttribute.document.id;
}
if (findAttribute3 != null) {
tL_emojiStatusCollectible.pattern_document_id = findAttribute3.document.id;
}
if (findAttribute2 != null) {
tL_emojiStatusCollectible.center_color = findAttribute2.center_color;
tL_emojiStatusCollectible.edge_color = findAttribute2.edge_color;
tL_emojiStatusCollectible.text_color = findAttribute2.text_color;
tL_emojiStatusCollectible.pattern_color = findAttribute2.pattern_color;
}
return tL_emojiStatusCollectible;
}
public static boolean equals(TLRPC.MessageMedia messageMedia, TLRPC.MessageMedia messageMedia2) {
return messageMedia instanceof TLRPC.TL_messageMediaDocument ? (messageMedia2 instanceof TLRPC.TL_messageMediaDocument) && messageMedia.document.id == messageMedia2.document.id : (messageMedia2 instanceof TLRPC.TL_messageMediaPhoto) && (messageMedia2 instanceof TLRPC.TL_messageMediaPhoto) && messageMedia.photo.id == messageMedia2.photo.id;
}
private void fetchFolderInLoadedPinnedDialogs(TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs) {
TLRPC.TL_inputPeerChannel tL_inputPeerUser;
long j;
int size = tL_messages_peerDialogs.dialogs.size();
int i = 0;
for (int i2 = 0; i2 < size; i2++) {
TLRPC.TL_dialogFolder tL_dialogFolder = (TLRPC.Dialog) tL_messages_peerDialogs.dialogs.get(i2);
if (tL_dialogFolder instanceof TLRPC.TL_dialogFolder) {
TLRPC.TL_dialogFolder tL_dialogFolder2 = tL_dialogFolder;
long peerDialogId = DialogObject.getPeerDialogId(((TLRPC.Dialog) tL_dialogFolder).peer);
if (((TLRPC.Dialog) tL_dialogFolder2).top_message != 0 && peerDialogId != 0) {
int size2 = tL_messages_peerDialogs.messages.size();
for (int i3 = 0; i3 < size2; i3++) {
TLRPC.Message message = (TLRPC.Message) tL_messages_peerDialogs.messages.get(i3);
if (peerDialogId == MessageObject.getDialogId(message) && ((TLRPC.Dialog) tL_dialogFolder).top_message == message.id) {
TLRPC.TL_dialog tL_dialog = new TLRPC.TL_dialog();
((TLRPC.Dialog) tL_dialog).peer = ((TLRPC.Dialog) tL_dialogFolder).peer;
((TLRPC.Dialog) tL_dialog).top_message = ((TLRPC.Dialog) tL_dialogFolder).top_message;
((TLRPC.Dialog) tL_dialog).folder_id = tL_dialogFolder2.folder.id;
((TLRPC.Dialog) tL_dialog).flags |= 16;
tL_messages_peerDialogs.dialogs.add(tL_dialog);
TLRPC.Peer peer = ((TLRPC.Dialog) tL_dialogFolder).peer;
if (peer instanceof TLRPC.TL_peerChannel) {
tL_inputPeerUser = new TLRPC.TL_inputPeerChannel();
((TLRPC.InputPeer) tL_inputPeerUser).channel_id = ((TLRPC.Dialog) tL_dialogFolder).peer.channel_id;
int size3 = tL_messages_peerDialogs.chats.size();
while (i < size3) {
TLRPC.Chat chat = (TLRPC.Chat) tL_messages_peerDialogs.chats.get(i);
if (chat.id == ((TLRPC.InputPeer) tL_inputPeerUser).channel_id) {
j = chat.access_hash;
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = j;
break;
}
i++;
}
loadUnknownDialog(tL_inputPeerUser, 0L);
return;
}
if (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 size4 = tL_messages_peerDialogs.users.size();
while (i < size4) {
TLRPC$User tLRPC$User = (TLRPC$User) tL_messages_peerDialogs.users.get(i);
if (tLRPC$User.id == ((TLRPC.InputPeer) tL_inputPeerUser).user_id) {
j = tLRPC$User.access_hash;
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = j;
break;
}
i++;
}
}
loadUnknownDialog(tL_inputPeerUser, 0L);
return;
}
}
return;
}
tL_messages_peerDialogs.dialogs.remove(tL_dialogFolder2);
}
}
}
public static <T extends TLRPC$Update> ArrayList<T> findUpdates(TLRPC.Updates updates, Class<T> cls) {
ArrayList<T> arrayList = new ArrayList<>();
if (updates == null) {
return arrayList;
}
if (cls.isInstance(updates.update)) {
arrayList.add(cls.cast(updates.update));
}
if (updates.updates != null) {
for (int i = 0; i < updates.updates.size(); i++) {
TLRPC$Update tLRPC$Update = (TLRPC$Update) updates.updates.get(i);
if (cls.isInstance(tLRPC$Update)) {
arrayList.add(cls.cast(tLRPC$Update));
}
}
}
return arrayList;
}
public static <T extends TLRPC$Update> ArrayList<T> findUpdatesAndRemove(TLRPC.Updates updates, Class<T> cls) {
ArrayList<T> arrayList = new ArrayList<>();
if (updates == null) {
return arrayList;
}
if (cls.isInstance(updates.update)) {
TLRPC$Update tLRPC$Update = updates.update;
updates.update = null;
arrayList.add(cls.cast(tLRPC$Update));
}
if (updates.updates != null) {
int i = 0;
while (i < updates.updates.size()) {
if (cls.isInstance(updates.updates.get(i))) {
arrayList.add(cls.cast(updates.updates.remove(i)));
i--;
}
i++;
}
}
return arrayList;
}
private void getChannelDifference(long j) {
getChannelDifference(j, 0, 0L, null);
}
public static SharedPreferences getEmojiSettings(int i) {
return getInstance(i).emojiPreferences;
}
public static SharedPreferences getGlobalEmojiSettings() {
return getInstance(0).emojiPreferences;
}
public static SharedPreferences getGlobalMainSettings() {
return getInstance(0).mainPreferences;
}
public static SharedPreferences getGlobalNotificationsSettings() {
return getInstance(0).notificationsPreferences;
}
public static TLRPC.InputChannel getInputChannel(TLRPC.Chat chat) {
if (!(chat instanceof TLRPC.TL_channel) && !(chat instanceof TLRPC.TL_channelForbidden)) {
return new TLRPC.TL_inputChannelEmpty();
}
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;
}
public static TLRPC.InputChannel getInputChannel(TLRPC.InputPeer inputPeer) {
TLRPC.TL_inputChannel tL_inputChannel = new TLRPC.TL_inputChannel();
((TLRPC.InputChannel) tL_inputChannel).channel_id = inputPeer.channel_id;
((TLRPC.InputChannel) tL_inputChannel).access_hash = inputPeer.access_hash;
return tL_inputChannel;
}
public static TLRPC.InputPeer getInputPeer(TLObject tLObject) {
if (tLObject instanceof TLRPC$User) {
return getInputPeer((TLRPC$User) tLObject);
}
if (tLObject instanceof TLRPC.Chat) {
return getInputPeer((TLRPC.Chat) tLObject);
}
return null;
}
public static TLRPC.InputPeer getInputPeer(TLRPC.Chat chat) {
if (!ChatObject.isChannel(chat)) {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = chat.id;
return tL_inputPeerChat;
}
TLRPC.TL_inputPeerChannel tL_inputPeerChannel = new TLRPC.TL_inputPeerChannel();
((TLRPC.InputPeer) tL_inputPeerChannel).channel_id = chat.id;
((TLRPC.InputPeer) tL_inputPeerChannel).access_hash = chat.access_hash;
return tL_inputPeerChannel;
}
public static TLRPC.InputPeer getInputPeer(TLRPC$User tLRPC$User) {
TLRPC.TL_inputPeerUser tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
((TLRPC.InputPeer) tL_inputPeerUser).user_id = tLRPC$User.id;
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = tLRPC$User.access_hash;
return tL_inputPeerUser;
}
public static TLRPC.InputWallPaper getInputWallpaper(Theme.OverrideWallpaperInfo overrideWallpaperInfo) {
if (overrideWallpaperInfo.wallpaperId <= 0) {
TLRPC.TL_inputWallPaperSlug tL_inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
tL_inputWallPaperSlug.slug = overrideWallpaperInfo.slug;
return tL_inputWallPaperSlug;
}
TLRPC.TL_inputWallPaper tL_inputWallPaper = new TLRPC.TL_inputWallPaper();
tL_inputWallPaper.id = overrideWallpaperInfo.wallpaperId;
tL_inputWallPaper.access_hash = overrideWallpaperInfo.accessHash;
return tL_inputWallPaper;
}
public static MessagesController getInstance(int i) {
MessagesController messagesController = Instance[i];
if (messagesController == null) {
synchronized (lockObjects[i]) {
try {
messagesController = Instance[i];
if (messagesController == null) {
MessagesController[] messagesControllerArr = Instance;
MessagesController messagesController2 = new MessagesController(i);
messagesControllerArr[i] = messagesController2;
messagesController = messagesController2;
}
} finally {
}
}
}
return messagesController;
}
public static SharedPreferences getMainSettings(int i) {
return getInstance(i).mainPreferences;
}
public static SharedPreferences getNotificationsSettings(int i) {
return getInstance(i).notificationsPreferences;
}
public static TLRPC.Peer getPeerFromInputPeer(TLRPC.InputPeer inputPeer) {
if (inputPeer.chat_id != 0) {
TLRPC.TL_peerChat tL_peerChat = new TLRPC.TL_peerChat();
((TLRPC.Peer) tL_peerChat).chat_id = inputPeer.chat_id;
return tL_peerChat;
}
if (inputPeer.channel_id != 0) {
TLRPC.TL_peerChannel tL_peerChannel = new TLRPC.TL_peerChannel();
((TLRPC.Peer) tL_peerChannel).channel_id = inputPeer.channel_id;
return tL_peerChannel;
}
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Peer) tL_peerUser).user_id = inputPeer.user_id;
return tL_peerUser;
}
private long getTagLongId(TLRPC.Reaction reaction) {
long j;
if (reaction == null) {
return 0L;
}
long j2 = reaction.tag_long_id;
if (j2 != 0) {
return j2;
}
if (reaction instanceof TLRPC.TL_reactionEmoji) {
j = MessagesController$.ExternalSyntheticBackport2.m(Utilities.MD5(((TLRPC.TL_reactionEmoji) reaction).emoticon).substring(0, 16), 16);
} else {
if (!(reaction instanceof TLRPC.TL_reactionCustomEmoji)) {
return 0L;
}
j = ((TLRPC.TL_reactionCustomEmoji) reaction).document_id;
}
reaction.tag_long_id = j;
return j;
}
public static long getUpdateChannelId(TLRPC$Update tLRPC$Update) {
if (tLRPC$Update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) tLRPC$Update).message.peer_id.channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) tLRPC$Update).message.peer_id.channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadChannelOutbox) {
return ((TLRPC.TL_updateReadChannelOutbox) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelMessageViews) {
return ((TLRPC.TL_updateChannelMessageViews) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelMessageForwards) {
return ((TLRPC.TL_updateChannelMessageForwards) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelTooLong) {
return ((TLRPC.TL_updateChannelTooLong) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelReadMessagesContents) {
return ((TLRPC.TL_updateChannelReadMessagesContents) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelAvailableMessages) {
return ((TLRPC.TL_updateChannelAvailableMessages) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannel) {
return ((TLRPC.TL_updateChannel) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadChannelInbox) {
return ((TLRPC.TL_updateReadChannelInbox) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelPinnedTopic) {
return ((TLRPC.TL_updateChannelPinnedTopic) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelPinnedTopics) {
return ((TLRPC.TL_updateChannelPinnedTopics) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadChannelDiscussionInbox) {
return ((TLRPC.TL_updateReadChannelDiscussionInbox) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadChannelDiscussionOutbox) {
return ((TLRPC.TL_updateReadChannelDiscussionOutbox) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelUserTyping) {
return ((TLRPC.TL_updateChannelUserTyping) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updatePinnedChannelMessages) {
return ((TLRPC.TL_updatePinnedChannelMessages) tLRPC$Update).channel_id;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelViewForumAsMessages) {
return ((TLRPC.TL_updateChannelViewForumAsMessages) tLRPC$Update).channel_id;
}
if (!BuildVars.LOGS_ENABLED) {
return 0L;
}
FileLog.e("trying to get unknown update channel_id for " + tLRPC$Update);
return 0L;
}
private static int getUpdatePts(TLRPC$Update tLRPC$Update) {
if (tLRPC$Update instanceof TLRPC.TL_updateDeleteMessages) {
return ((TLRPC.TL_updateDeleteMessages) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryOutbox) {
return ((TLRPC.TL_updateReadHistoryOutbox) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateNewMessage) {
return ((TLRPC.TL_updateNewMessage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateEditMessage) {
return ((TLRPC.TL_updateEditMessage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateWebPage) {
return ((TLRPC.TL_updateWebPage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryInbox) {
return ((TLRPC.TL_updateReadHistoryInbox) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadMessagesContents) {
return ((TLRPC.TL_updateReadMessagesContents) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelTooLong) {
return ((TLRPC.TL_updateChannelTooLong) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updateFolderPeers) {
return ((TLRPC.TL_updateFolderPeers) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updatePinnedChannelMessages) {
return ((TLRPC.TL_updatePinnedChannelMessages) tLRPC$Update).pts;
}
if (tLRPC$Update instanceof TLRPC.TL_updatePinnedMessages) {
return ((TLRPC.TL_updatePinnedMessages) tLRPC$Update).pts;
}
return 0;
}
private static int getUpdatePtsCount(TLRPC$Update tLRPC$Update) {
if (tLRPC$Update instanceof TLRPC.TL_updateDeleteMessages) {
return ((TLRPC.TL_updateDeleteMessages) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateNewChannelMessage) {
return ((TLRPC.TL_updateNewChannelMessage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryOutbox) {
return ((TLRPC.TL_updateReadHistoryOutbox) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateNewMessage) {
return ((TLRPC.TL_updateNewMessage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateEditMessage) {
return ((TLRPC.TL_updateEditMessage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateWebPage) {
return ((TLRPC.TL_updateWebPage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryInbox) {
return ((TLRPC.TL_updateReadHistoryInbox) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateChannelWebPage) {
return ((TLRPC.TL_updateChannelWebPage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateDeleteChannelMessages) {
return ((TLRPC.TL_updateDeleteChannelMessages) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateEditChannelMessage) {
return ((TLRPC.TL_updateEditChannelMessage) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateReadMessagesContents) {
return ((TLRPC.TL_updateReadMessagesContents) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updateFolderPeers) {
return ((TLRPC.TL_updateFolderPeers) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updatePinnedChannelMessages) {
return ((TLRPC.TL_updatePinnedChannelMessages) tLRPC$Update).pts_count;
}
if (tLRPC$Update instanceof TLRPC.TL_updatePinnedMessages) {
return ((TLRPC.TL_updatePinnedMessages) tLRPC$Update).pts_count;
}
return 0;
}
private static int getUpdateQts(TLRPC$Update tLRPC$Update) {
if (tLRPC$Update instanceof TLRPC.TL_updateNewEncryptedMessage) {
return ((TLRPC.TL_updateNewEncryptedMessage) tLRPC$Update).qts;
}
return 0;
}
private int getUpdateSeq(TLRPC.Updates updates) {
return updates instanceof TLRPC.TL_updatesCombined ? updates.seq_start : updates.seq;
}
private int getUpdateType(TLRPC$Update tLRPC$Update) {
if ((tLRPC$Update instanceof TLRPC.TL_updateNewMessage) || (tLRPC$Update instanceof TLRPC.TL_updateReadMessagesContents) || (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryInbox) || (tLRPC$Update instanceof TLRPC.TL_updateReadHistoryOutbox) || (tLRPC$Update instanceof TLRPC.TL_updateDeleteMessages) || (tLRPC$Update instanceof TLRPC.TL_updateWebPage) || (tLRPC$Update instanceof TLRPC.TL_updateEditMessage) || (tLRPC$Update instanceof TLRPC.TL_updateFolderPeers) || (tLRPC$Update instanceof TLRPC.TL_updatePinnedMessages)) {
return 0;
}
if (tLRPC$Update instanceof TLRPC.TL_updateNewEncryptedMessage) {
return 1;
}
return ((tLRPC$Update instanceof TLRPC.TL_updateNewChannelMessage) || (tLRPC$Update instanceof TLRPC.TL_updateDeleteChannelMessages) || (tLRPC$Update instanceof TLRPC.TL_updateEditChannelMessage) || (tLRPC$Update instanceof TLRPC.TL_updateChannelWebPage) || (tLRPC$Update instanceof TLRPC.TL_updatePinnedChannelMessages)) ? 2 : 3;
}
private String getUserNameForTyping(TLRPC$User tLRPC$User) {
String str;
if (tLRPC$User == null) {
return "";
}
String str2 = tLRPC$User.first_name;
if (str2 == null || str2.length() <= 0) {
String str3 = tLRPC$User.last_name;
if (str3 == null || str3.length() <= 0) {
return "";
}
str = tLRPC$User.last_name;
} else {
str = tLRPC$User.first_name;
}
return AndroidUtilities.removeDiacritics(str);
}
public static org.telegram.tgnet.TLRPC.TL_wallPaperSettings getWallpaperSetting(org.telegram.ui.ActionBar.Theme.OverrideWallpaperInfo r5) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.getWallpaperSetting(org.telegram.ui.ActionBar.Theme$OverrideWallpaperInfo):org.telegram.tgnet.TLRPC$TL_wallPaperSettings");
}
public static boolean isStoryQualityFull() {
return getInstance(UserConfig.selectedAccount).isStoryQualityFullOnAccount();
}
public static boolean isSupportUser(TLRPC$User tLRPC$User) {
if (tLRPC$User != null) {
if (!tLRPC$User.support) {
long j = tLRPC$User.id;
if (j == 777000 || j == 333000 || j == 4240000 || j == 4244000 || j == 4245000 || j == 4246000 || j == 410000 || j == 420000 || j == 431000 || j == 431415000 || j == 434000 || j == 4243000 || j == 439000 || j == 449000 || j == 450000 || j == 452000 || j == 454000 || j == 4254000 || j == 455000 || j == 460000 || j == 470000 || j == 479000 || j == 796000 || j == 482000 || j == 490000 || j == 496000 || j == 497000 || j == 498000 || j == 4298000) {
}
}
return true;
}
return false;
}
private int isValidUpdate(TLRPC.Updates updates, int i) {
if (i == 0) {
int updateSeq = getUpdateSeq(updates);
if (getMessagesStorage().getLastSeqValue() + 1 == updateSeq || getMessagesStorage().getLastSeqValue() == updateSeq) {
return 0;
}
return getMessagesStorage().getLastSeqValue() < updateSeq ? 1 : 2;
}
if (i == 1) {
if (updates.pts <= getMessagesStorage().getLastPtsValue()) {
return 2;
}
return getMessagesStorage().getLastPtsValue() + updates.pts_count == updates.pts ? 0 : 1;
}
if (i != 2) {
return 0;
}
if (updates.pts <= getMessagesStorage().getLastQtsValue()) {
return 2;
}
return getMessagesStorage().getLastQtsValue() + updates.updates.size() == updates.pts ? 0 : 1;
}
public void lambda$addDialogToFolder$186(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$addToViewsQueue$218(MessageObject messageObject) {
long dialogId = messageObject.getDialogId();
int id = messageObject.getId();
ArrayList arrayList = (ArrayList) this.channelViewsToSend.get(dialogId);
if (arrayList == null) {
arrayList = new ArrayList();
this.channelViewsToSend.put(dialogId, arrayList);
}
if (arrayList.contains(Integer.valueOf(id))) {
return;
}
arrayList.add(Integer.valueOf(id));
}
public void lambda$addUserToChat$275(long j) {
this.joiningToChannels.remove(Long.valueOf(j));
}
public void lambda$addUserToChat$276(Utilities.Callback callback, TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers, long j) {
if (callback != null) {
callback.run(tL_messages_invitedUsers);
} else {
AlertsCreator.checkRestrictedInviteUsers(this.currentAccount, getChat(Long.valueOf(j)), tL_messages_invitedUsers);
}
}
public static void lambda$addUserToChat$277(Utilities.Callback callback) {
if (callback != null) {
callback.run((Object) null);
}
}
public void lambda$addUserToChat$278(ErrorDelegate errorDelegate, TLRPC.TL_error tL_error, BaseFragment baseFragment, TLObject tLObject, boolean z, boolean z2) {
if (errorDelegate.run(tL_error)) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tLObject, new Object[]{Boolean.valueOf(z && !z2)});
}
}
public void lambda$addUserToChat$279(ErrorDelegate errorDelegate, TLRPC.TL_error tL_error, BaseFragment baseFragment, TLObject tLObject, boolean z, boolean z2, TLRPC.InputUser inputUser) {
if (errorDelegate == null) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tLObject, new Object[]{Boolean.valueOf(z && !z2)});
}
if (z && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
}
public static void lambda$addUserToChat$280(Utilities.Callback callback) {
if (callback != null) {
callback.run((Object) null);
}
}
public void lambda$addUserToChat$281(TLRPC.Updates updates, Utilities.Callback callback, TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers, long j) {
putUsers(updates.users, false);
putChats(updates.chats, false);
if (callback != null) {
callback.run(tL_messages_invitedUsers);
} else {
AlertsCreator.checkRestrictedInviteUsers(this.currentAccount, getChat(Long.valueOf(j)), tL_messages_invitedUsers);
}
}
public void lambda$addUserToChat$282(long j) {
loadFullChat(j, 0, true);
}
public void lambda$addUserToChat$284(boolean z, TLRPC.InputUser inputUser, long j, TLRPC$User tLRPC$User, Utilities.Callback callback, boolean z2, Runnable runnable, ErrorDelegate errorDelegate, BaseFragment baseFragment, TLObject tLObject, boolean z3, TLObject tLObject2, TLRPC.TL_error tL_error) {
TLRPC.Updates updates;
TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers;
boolean z4;
if (z && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda137(this, j));
}
if (tL_error != null) {
if ("PRIVACY_PREMIUM_REQUIRED".equals(tL_error.text)) {
TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers2 = new TLRPC.TL_messages_invitedUsers();
tL_messages_invitedUsers2.updates = new TLRPC.TL_updates();
TLRPC.TL_missingInvitee tL_missingInvitee = new TLRPC.TL_missingInvitee();
tL_missingInvitee.user_id = tLRPC$User.id;
tL_missingInvitee.premium_would_allow_invite = true;
tL_missingInvitee.premium_required_for_pm = true;
tL_messages_invitedUsers2.missing_invitees.add(tL_missingInvitee);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda138(this, callback, tL_messages_invitedUsers2, j));
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda139(callback));
if ("USER_ALREADY_PARTICIPANT".equals(tL_error.text) && z2) {
if (runnable != null) {
AndroidUtilities.runOnUIThread(runnable);
return;
}
return;
} else {
if (errorDelegate != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda140(this, errorDelegate, tL_error, baseFragment, tLObject, z, z3));
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda141(this, errorDelegate, tL_error, baseFragment, tLObject, z, z3, inputUser));
return;
}
}
if (tLObject2 instanceof TLRPC.TL_messages_invitedUsers) {
tL_messages_invitedUsers = (TLRPC.TL_messages_invitedUsers) tLObject2;
updates = tL_messages_invitedUsers.updates;
} else {
if (!(tLObject2 instanceof TLRPC.Updates)) {
FileLog.e("unexpected " + tLObject2 + " in addUserToChat");
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda145(callback));
return;
}
updates = (TLRPC.Updates) tLObject2;
tL_messages_invitedUsers = null;
}
int i = 0;
while (true) {
if (i >= updates.updates.size()) {
z4 = false;
break;
}
TLRPC.TL_updateNewChannelMessage tL_updateNewChannelMessage = (TLRPC$Update) updates.updates.get(i);
if ((tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewChannelMessage) && (tL_updateNewChannelMessage.message.action instanceof TLRPC.TL_messageActionChatAddUser)) {
z4 = true;
break;
}
i++;
}
processUpdates(updates, false);
if (tL_messages_invitedUsers != null && !tL_messages_invitedUsers.missing_invitees.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda142(this, updates, callback, tL_messages_invitedUsers, j));
return;
}
if (z) {
if (!z4 && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
generateJoinMessage(j, true);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda143(this, j), 1000L);
}
if (z && (inputUser instanceof TLRPC.TL_inputUserSelf)) {
getMessagesStorage().updateDialogsWithDeletedMessages(-j, j, new ArrayList(), (ArrayList) null, true);
}
if (runnable != null) {
AndroidUtilities.runOnUIThread(runnable);
}
if (callback != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda144(callback));
}
}
public void lambda$addUsersToChannel$250(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_channels_inviteToChannel tL_channels_inviteToChannel) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_channels_inviteToChannel, new Object[]{Boolean.TRUE});
}
public void lambda$addUsersToChannel$251(TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers, long j) {
putUsers(tL_messages_invitedUsers.updates.users, false);
putChats(tL_messages_invitedUsers.updates.chats, false);
AlertsCreator.checkRestrictedInviteUsers(this.currentAccount, getChat(Long.valueOf(j)), tL_messages_invitedUsers);
}
public void lambda$addUsersToChannel$252(BaseFragment baseFragment, TLRPC.TL_channels_inviteToChannel tL_channels_inviteToChannel, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda424(this, tL_error, baseFragment, tL_channels_inviteToChannel));
} else if (tLObject instanceof TLRPC.TL_messages_invitedUsers) {
TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers = (TLRPC.TL_messages_invitedUsers) tLObject;
processUpdates(tL_messages_invitedUsers.updates, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda425(this, tL_messages_invitedUsers, j));
}
}
public static void lambda$addUsersToChat$271(Consumer consumer, TLRPC$User tLRPC$User) {
if (consumer != null) {
consumer.accept(tLRPC$User);
}
}
public static boolean lambda$addUsersToChat$272(Consumer consumer, TLRPC$User tLRPC$User, TLRPC.TL_error tL_error) {
if (consumer != null) {
consumer.accept(tLRPC$User);
}
return tL_error == null || !"USER_PRIVACY_RESTRICTED".equals(tL_error.text);
}
public void lambda$addUsersToChat$273(TLRPC.Chat chat, TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers) {
AlertsCreator.checkRestrictedInviteUsers(this.currentAccount, chat, tL_messages_invitedUsers);
}
public void lambda$addUsersToChat$274(TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers, int[] iArr, int i, TLRPC.Chat chat, Runnable runnable, TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers2) {
if (tL_messages_invitedUsers2 != null) {
tL_messages_invitedUsers.missing_invitees.addAll(tL_messages_invitedUsers2.missing_invitees);
}
int i2 = iArr[0] + 1;
iArr[0] = i2;
if (i2 >= i) {
if (!tL_messages_invitedUsers.missing_invitees.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda239(this, chat, tL_messages_invitedUsers));
}
if (runnable != null) {
runnable.run();
}
}
}
public void lambda$applyAppConfig$31() {
getNotificationCenter().postNotificationName(NotificationCenter.appConfigUpdated, new Object[0]);
}
public void lambda$applyAppConfig$32() {
getNotificationCenter().postNotificationName(NotificationCenter.storiesEnabledUpdate, new Object[0]);
}
public void lambda$approveOrRejectSuggestedMessageImpl$457(long j, int i, TLObject tLObject, TLRPC.TL_error tL_error) {
this.sendingSuggestedMessageApprovalMap.remove(j + "_" + i);
if (tL_error == null && tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
}
public static void lambda$blockPeer$83(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$changeChatAvatar$292(Runnable runnable) {
if (runnable != null) {
runnable.run();
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_AVATAR)});
getNotificationCenter().postNotificationName(NotificationCenter.reloadDialogPhotos, new Object[0]);
}
public void lambda$changeChatAvatar$293(TLRPC.TL_inputChatPhoto tL_inputChatPhoto, TLRPC.FileLocation fileLocation, TLRPC.FileLocation fileLocation2, String str, long j, Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.Photo photo;
if (tL_error != null) {
return;
}
TLRPC.Updates updates = (TLRPC.Updates) tLObject;
if (tL_inputChatPhoto == null) {
int size = updates.updates.size();
int i = 0;
while (true) {
if (i >= size) {
photo = null;
break;
}
TLRPC.TL_updateNewChannelMessage tL_updateNewChannelMessage = (TLRPC$Update) updates.updates.get(i);
if (tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewChannelMessage) {
TLRPC.MessageAction messageAction = tL_updateNewChannelMessage.message.action;
if (messageAction instanceof TLRPC.TL_messageActionChatEditPhoto) {
photo = messageAction.photo;
if (photo instanceof TLRPC.TL_photo) {
break;
}
} else {
continue;
}
i++;
} else {
if (tL_updateNewChannelMessage instanceof TLRPC.TL_updateNewMessage) {
TLRPC.MessageAction messageAction2 = ((TLRPC.TL_updateNewMessage) tL_updateNewChannelMessage).message.action;
if (messageAction2 instanceof TLRPC.TL_messageActionChatEditPhoto) {
photo = messageAction2.photo;
if (photo instanceof TLRPC.TL_photo) {
break;
}
} else {
continue;
}
} else {
continue;
}
i++;
}
}
if (photo != null) {
TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 150);
TLRPC.VideoSize videoSize = photo.video_sizes.isEmpty() ? null : (TLRPC.VideoSize) photo.video_sizes.get(0);
if (closestPhotoSizeWithSize != null && fileLocation != null) {
getFileLoader().getPathToAttach(fileLocation, true).renameTo(getFileLoader().getPathToAttach(closestPhotoSizeWithSize, true));
ImageLoader.getInstance().replaceImageInCache(fileLocation.volume_id + "_" + fileLocation.local_id + "@50_50", closestPhotoSizeWithSize.location.volume_id + "_" + closestPhotoSizeWithSize.location.local_id + "@50_50", ImageLocation.getForPhoto(closestPhotoSizeWithSize, photo), true);
}
TLRPC.PhotoSize closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 800);
if (closestPhotoSizeWithSize2 != null && fileLocation2 != null) {
getFileLoader().getPathToAttach(fileLocation2, true).renameTo(getFileLoader().getPathToAttach(closestPhotoSizeWithSize2, true));
}
if (videoSize != null && str != null) {
new File(str).renameTo(getFileLoader().getPathToAttach(videoSize, "mp4", true));
}
getDialogPhotos(-j).addPhotoAtStart(photo);
}
}
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda107(this, runnable));
}
public void lambda$changeChatTitle$291(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
}
public void lambda$checkCanOpenChat$402(AlertDialog alertDialog, Browser.Progress progress, TLObject tLObject, BaseFragment baseFragment, Bundle bundle) {
if (alertDialog != null) {
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
}
if (progress != null) {
progress.end();
}
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
putUsers(messages_messages.users, false);
putChats(messages_messages.chats, false);
getMessagesStorage().putUsersAndChats(messages_messages.users, messages_messages.chats, true, true);
baseFragment.presentFragment(new ChatActivity(bundle), true);
}
public void lambda$checkCanOpenChat$403(AlertDialog alertDialog, Browser.Progress progress, BaseFragment baseFragment, Bundle bundle, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda57(this, alertDialog, progress, tLObject, baseFragment, bundle));
}
}
public void lambda$checkCanOpenChat$404(int i, BaseFragment baseFragment, DialogInterface dialogInterface) {
getConnectionsManager().cancelRequest(i, true);
baseFragment.setVisibleDialog(null);
}
public void lambda$checkCanOpenChat$405(int i, BaseFragment baseFragment) {
getConnectionsManager().cancelRequest(i, true);
baseFragment.setVisibleDialog(null);
}
public void lambda$checkChatInviter$345(TLRPC.TL_channels_channelParticipant tL_channels_channelParticipant) {
putUsers(tL_channels_channelParticipant.users, false);
putChats(tL_channels_channelParticipant.chats, false);
}
public void lambda$checkChatInviter$346(ArrayList arrayList) {
getNotificationsController().processNewMessages(arrayList, true, false, (CountDownLatch) null);
}
public void lambda$checkChatInviter$347(ArrayList arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda359(this, arrayList));
}
public void lambda$checkChatInviter$348(long j, ArrayList arrayList, TLRPC.TL_channels_channelParticipant tL_channels_channelParticipant) {
this.gettingChatInviters.delete(j);
if (arrayList != null) {
updateInterfaceWithMessages(-j, arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
getNotificationCenter().postNotificationName(NotificationCenter.didLoadChatInviter, new Object[]{Long.valueOf(j), Long.valueOf(tL_channels_channelParticipant.participant.inviter_id)});
}
public void lambda$checkChatInviter$349(TLRPC.Chat chat, boolean z, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
ArrayList arrayList;
TLRPC.TL_channels_channelParticipant tL_channels_channelParticipant = (TLRPC.TL_channels_channelParticipant) tLObject;
if (tL_channels_channelParticipant != null) {
TLRPC.TL_channelParticipantSelf tL_channelParticipantSelf = tL_channels_channelParticipant.participant;
if (tL_channelParticipantSelf instanceof TLRPC.TL_channelParticipantSelf) {
TLRPC.TL_channelParticipantSelf tL_channelParticipantSelf2 = tL_channelParticipantSelf;
if (chat.megagroup && getMessagesStorage().isMigratedChat(chat.id)) {
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda148(this, tL_channels_channelParticipant));
getMessagesStorage().putUsersAndChats(tL_channels_channelParticipant.users, tL_channels_channelParticipant.chats, true, true);
if (!z || Math.abs(getConnectionsManager().getCurrentTime() - tL_channels_channelParticipant.participant.date) >= 86400 || getMessagesStorage().hasInviteMeMessage(j)) {
arrayList = null;
} else {
TLRPC.TL_messageService tL_messageService = new TLRPC.TL_messageService();
((TLRPC.Message) tL_messageService).flags = 256;
int newMessageId = getUserConfig().getNewMessageId();
((TLRPC.Message) tL_messageService).id = newMessageId;
((TLRPC.Message) tL_messageService).local_id = newMessageId;
((TLRPC.Message) tL_messageService).date = tL_channels_channelParticipant.participant.date;
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Message) tL_messageService).from_id = tL_peerUser;
((TLRPC.Peer) tL_peerUser).user_id = tL_channels_channelParticipant.participant.inviter_id;
TLRPC.TL_peerChannel tL_peerChannel = new TLRPC.TL_peerChannel();
((TLRPC.Message) tL_messageService).peer_id = tL_peerChannel;
((TLRPC.Peer) tL_peerChannel).channel_id = j;
((TLRPC.Message) tL_messageService).media_unread = true;
((TLRPC.Message) tL_messageService).unread = true;
((TLRPC.Message) tL_messageService).post = true;
((TLRPC.Message) tL_messageService).action = (((TLRPC.ChannelParticipant) tL_channelParticipantSelf2).via_invite && ((TLRPC.ChannelParticipant) tL_channelParticipantSelf2).inviter_id == getUserConfig().getClientUserId()) ? new TLRPC.TL_messageActionChatJoinedByRequest() : new TLRPC.TL_messageActionChatAddUser();
((TLRPC.Message) tL_messageService).action.users.add(Long.valueOf(getUserConfig().getClientUserId()));
((TLRPC.Message) tL_messageService).dialog_id = -j;
getUserConfig().saveConfig(false);
ArrayList arrayList2 = new ArrayList();
ArrayList arrayList3 = new ArrayList();
ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
for (int i = 0; i < tL_channels_channelParticipant.users.size(); i++) {
TLRPC$User tLRPC$User = (TLRPC$User) tL_channels_channelParticipant.users.get(i);
concurrentHashMap.put(Long.valueOf(tLRPC$User.id), tLRPC$User);
}
arrayList3.add(tL_messageService);
arrayList2.add(new MessageObject(this.currentAccount, tL_messageService, concurrentHashMap, true, false));
if (((TLRPC.Message) tL_messageService).from_id.user_id != getUserConfig().getClientUserId()) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda149(this, arrayList2));
}
getMessagesStorage().putMessages(arrayList3, true, true, false, 0, 0, 0L);
arrayList = arrayList2;
}
getMessagesStorage().saveChatInviter(j, tL_channels_channelParticipant.participant.inviter_id);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda150(this, j, arrayList, tL_channels_channelParticipant));
}
}
}
public void lambda$checkChatlistFolderUpdate$428(TLObject tLObject, int i, ChatlistUpdatesStat chatlistUpdatesStat) {
if (!(tLObject instanceof TL_chatlists.TL_chatlists_chatlistUpdates)) {
chatlistUpdatesStat.loading = false;
return;
}
TL_chatlists.TL_chatlists_chatlistUpdates tL_chatlists_chatlistUpdates = (TL_chatlists.TL_chatlists_chatlistUpdates) tLObject;
putChats(tL_chatlists_chatlistUpdates.chats, false);
putUsers(tL_chatlists_chatlistUpdates.users, false);
this.chatlistFoldersUpdates.put(i, new ChatlistUpdatesStat(this, tL_chatlists_chatlistUpdates));
getNotificationCenter().postNotificationName(NotificationCenter.chatlistFolderUpdate, new Object[]{Integer.valueOf(i)});
}
public void lambda$checkChatlistFolderUpdate$429(int i, ChatlistUpdatesStat chatlistUpdatesStat, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda272(this, tLObject, i, chatlistUpdatesStat));
}
public void lambda$checkDeletingTask$79(LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
getNewDeleteTask(longSparseArray, longSparseArray2);
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
this.currentDeletingTaskMediaMids = null;
}
public void lambda$checkDeletingTask$80(LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
long j;
ArrayList arrayList;
boolean z = true;
if (longSparseArray != null) {
int size = longSparseArray.size();
for (int i = 0; i < size; i++) {
ArrayList<Integer> arrayList2 = (ArrayList) longSparseArray.valueAt(i);
deleteMessages(arrayList2, null, null, longSparseArray.keyAt(i), 0, true, 0, !arrayList2.isEmpty() && arrayList2.get(0).intValue() > 0);
}
}
if (longSparseArray2 != null) {
boolean z2 = SecretMediaViewer.hasInstance() && SecretMediaViewer.getInstance().isVisible();
MessageObject currentMessageObject = z2 ? SecretMediaViewer.getInstance().getCurrentMessageObject() : null;
int size2 = longSparseArray2.size();
int i2 = 0;
while (i2 < size2) {
long keyAt = longSparseArray2.keyAt(i2);
ArrayList arrayList3 = (ArrayList) longSparseArray2.valueAt(i2);
if (z2 && currentMessageObject != null && currentMessageObject.currentAccount == this.currentAccount && currentMessageObject.getDialogId() == keyAt && arrayList3.contains(Integer.valueOf(currentMessageObject.getId()))) {
int id = currentMessageObject.getId();
arrayList3.remove(Integer.valueOf(id));
currentMessageObject.forceExpired = z;
j = keyAt;
arrayList = arrayList3;
SecretMediaViewer.getInstance().setOnClose(new MessagesController$.ExternalSyntheticLambda122(this, createDeleteShowOnceTask(keyAt, id), keyAt, id));
getNotificationCenter().postNotificationName(NotificationCenter.updateMessageMedia, new Object[]{currentMessageObject.messageOwner});
} else {
j = keyAt;
arrayList = arrayList3;
}
if (!arrayList.isEmpty()) {
getMessagesStorage().emptyMessagesMedia(j, arrayList);
}
i2++;
z = true;
}
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda123(this, longSparseArray, longSparseArray2));
}
public static void lambda$checkIsInChat$424(IsInChatCheckedCallback isInChatCheckedCallback, TLObject tLObject, TLRPC.TL_error tL_error) {
if (isInChatCheckedCallback != null) {
TLRPC.ChannelParticipant channelParticipant = tLObject instanceof TLRPC.TL_channels_channelParticipant ? ((TLRPC.TL_channels_channelParticipant) tLObject).participant : null;
isInChatCheckedCallback.run((tL_error != null || channelParticipant == null || channelParticipant.left) ? false : true, channelParticipant != null ? channelParticipant.admin_rights : null, channelParticipant != null ? channelParticipant.rank : null);
}
}
public void lambda$checkLastDialogMessage$212(TLRPC.Dialog dialog) {
deleteDialog(dialog.id, 3);
}
public void lambda$checkLastDialogMessage$213(TLRPC.Dialog dialog) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("checkLastDialogMessage for " + dialog.id + " has not message");
}
if (getMediaDataController().getDraft(dialog.id, 0L) == null) {
TLRPC.Dialog dialog2 = (TLRPC.Dialog) this.dialogs_dict.get(dialog.id);
if (dialog2 == null) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("checkLastDialogMessage for " + dialog.id + " current dialog not found");
}
getMessagesStorage().isDialogHasTopMessage(dialog.id, new MessagesController$.ExternalSyntheticLambda463(this, dialog));
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("checkLastDialogMessage for " + dialog.id + " current dialog top message " + dialog2.top_message);
}
if (dialog2.top_message == 0) {
deleteDialog(dialog.id, 3);
}
}
}
public void lambda$checkLastDialogMessage$214(TLRPC.Dialog dialog) {
this.checkingLastMessagesDialogs.delete(dialog.id);
}
public void lambda$checkLastDialogMessage$215(TLRPC.Dialog dialog, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
removeDeletedMessagesFromArray(dialog.id, messages_messages.messages);
if (messages_messages.messages.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda251(this, dialog));
} else {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("checkLastDialogMessage for " + dialog.id + " has message");
}
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
TLRPC.Message message = (TLRPC.Message) messages_messages.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 = message.id;
((TLRPC.Dialog) tL_dialog).last_message_date = message.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).unread_reactions_count = dialog.unread_reactions_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 j2 = dialog.id;
((TLRPC.Dialog) tL_dialog).id = j2;
message.dialog_id = j2;
((TLRPC.messages_Dialogs) tL_messages_dialogs).users.addAll(messages_messages.users);
((TLRPC.messages_Dialogs) tL_messages_dialogs).chats.addAll(messages_messages.chats);
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs.add(tL_dialog);
((TLRPC.messages_Dialogs) tL_messages_dialogs).messages.addAll(messages_messages.messages);
((TLRPC.messages_Dialogs) tL_messages_dialogs).count = 1;
processDialogsUpdate(tL_messages_dialogs, null, false);
getMessagesStorage().putMessages(messages_messages.messages, true, true, false, getDownloadController().getAutodownloadMask(), true, 0, 0L);
}
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda252(this, dialog));
}
public void lambda$checkPeerColors$441(TLObject tLObject) {
this.loadingPeerColors = false;
this.peerColors = PeerColors.fromTL(0, (TLRPC.TL_help_peerColors) tLObject);
this.mainPreferences.edit().putString("peerColors", this.peerColors.toString()).apply();
}
public void lambda$checkPeerColors$442(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof TLRPC.TL_help_peerColors) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda401(this, tLObject));
}
}
public void lambda$checkPeerColors$443(TLObject tLObject) {
this.loadingProfilePeerColors = false;
this.profilePeerColors = PeerColors.fromTL(1, (TLRPC.TL_help_peerColors) tLObject);
this.mainPreferences.edit().putString("profilePeerColors", this.profilePeerColors.toString()).apply();
}
public void lambda$checkPeerColors$444(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof TLRPC.TL_help_peerColors) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda219(this, tLObject));
}
}
public void lambda$checkPromoInfoInternal$155(TLRPC.TL_help_promoData tL_help_promoData, TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, long j) {
putUsers(tL_help_promoData.users, false);
putChats(tL_help_promoData.chats, false);
putUsers(tL_messages_peerDialogs.users, false);
putChats(tL_messages_peerDialogs.chats, false);
TLRPC.Dialog dialog = this.promoDialog;
if (dialog != null) {
long j2 = dialog.id;
if (j2 < 0) {
TLRPC.Chat chat = getChat(Long.valueOf(-j2));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
dialog = this.promoDialog;
}
}
removeDialog(dialog);
}
TLRPC.Dialog dialog2 = (TLRPC.Dialog) tL_messages_peerDialogs.dialogs.get(0);
this.promoDialog = dialog2;
dialog2.id = j;
dialog2.folder_id = 0;
if (DialogObject.isChannel(dialog2)) {
LongSparseIntArray longSparseIntArray = this.channelsPts;
TLRPC.Dialog dialog3 = this.promoDialog;
longSparseIntArray.put(-dialog3.id, dialog3.pts);
}
Integer num = (Integer) this.dialogs_read_inbox_max.get(Long.valueOf(this.promoDialog.id));
if (num == null) {
num = r3;
}
this.dialogs_read_inbox_max.put(Long.valueOf(this.promoDialog.id), Integer.valueOf(Math.max(num.intValue(), this.promoDialog.read_inbox_max_id)));
Integer num2 = (Integer) this.dialogs_read_outbox_max.get(Long.valueOf(this.promoDialog.id));
this.dialogs_read_outbox_max.put(Long.valueOf(this.promoDialog.id), Integer.valueOf(Math.max((num2 != null ? num2 : 0).intValue(), this.promoDialog.read_outbox_max_id)));
this.dialogs_dict.put(j, this.promoDialog);
if (!tL_messages_peerDialogs.messages.isEmpty()) {
LongSparseArray longSparseArray = new LongSparseArray();
LongSparseArray longSparseArray2 = new LongSparseArray();
for (int i = 0; i < tL_messages_peerDialogs.users.size(); i++) {
TLRPC$User tLRPC$User = (TLRPC$User) tL_messages_peerDialogs.users.get(i);
longSparseArray.put(tLRPC$User.id, tLRPC$User);
}
for (int i2 = 0; i2 < tL_messages_peerDialogs.chats.size(); i2++) {
TLRPC.Chat chat2 = (TLRPC.Chat) tL_messages_peerDialogs.chats.get(i2);
longSparseArray2.put(chat2.id, chat2);
}
MessageObject messageObject = new MessageObject(this.currentAccount, (TLRPC.Message) tL_messages_peerDialogs.messages.get(0), longSparseArray, longSparseArray2, false, true);
ArrayList arrayList = (ArrayList) this.dialogMessage.get(j);
if (arrayList == null) {
arrayList = new ArrayList(1);
}
if (arrayList.size() > 0 && arrayList.get(0) != null && ((MessageObject) arrayList.get(0)).hasValidGroupId() && ((MessageObject) arrayList.get(0)).getGroupIdForUse() != messageObject.getGroupIdForUse()) {
arrayList.clear();
}
arrayList.add(messageObject);
this.dialogMessage.put(j, arrayList);
TLRPC.Dialog dialog4 = this.promoDialog;
if (dialog4.last_message_date == 0) {
dialog4.last_message_date = messageObject.messageOwner.date;
}
getTranslateController().checkDialogMessage(j);
}
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
public void lambda$checkPromoInfoInternal$156() {
TLRPC.Dialog dialog = this.promoDialog;
if (dialog != null) {
long j = dialog.id;
if (j < 0) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
dialog = this.promoDialog;
}
this.promoDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
removeDialog(dialog);
this.promoDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
public void lambda$checkPromoInfoInternal$157(int i, TLRPC.TL_help_promoData tL_help_promoData, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (i != this.lastCheckPromoId) {
return;
}
this.checkingPromoInfoRequestId = 0;
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
if (tL_messages_peerDialogs == null || tL_messages_peerDialogs.dialogs.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda406(this));
} else {
getMessagesStorage().putUsersAndChats(tL_help_promoData.users, tL_help_promoData.chats, true, true);
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
((TLRPC.messages_Dialogs) tL_messages_dialogs).chats = tL_messages_peerDialogs.chats;
((TLRPC.messages_Dialogs) tL_messages_dialogs).users = tL_messages_peerDialogs.users;
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs = tL_messages_peerDialogs.dialogs;
((TLRPC.messages_Dialogs) tL_messages_dialogs).messages = tL_messages_peerDialogs.messages;
getMessagesStorage().putDialogs(tL_messages_dialogs, 2);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda405(this, tL_help_promoData, tL_messages_peerDialogs, j));
}
this.checkingPromoInfo = false;
}
public void lambda$checkPromoInfoInternal$158(long r12, org.telegram.tgnet.TLRPC.TL_help_promoData r14, int r15) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$checkPromoInfoInternal$158(long, org.telegram.tgnet.TLRPC$TL_help_promoData, int):void");
}
public void lambda$checkPromoInfoInternal$159(int r17, java.lang.String r18, java.lang.String r19, org.telegram.tgnet.TLObject r20, org.telegram.tgnet.TLRPC.TL_error r21) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$checkPromoInfoInternal$159(int, java.lang.String, java.lang.String, org.telegram.tgnet.TLObject, org.telegram.tgnet.TLRPC$TL_error):void");
}
public static void lambda$checkSensitive$397(boolean[] zArr, View view) {
boolean z = !zArr[0];
zArr[0] = z;
((CheckBoxCell) view).setChecked(z, true);
}
public static void lambda$checkSensitive$398(BaseFragment baseFragment) {
baseFragment.presentFragment((BaseFragment) new ThemeActivity(0).highlightSensitiveRow());
}
public void lambda$checkSensitive$399(boolean[] zArr, long j, boolean[] zArr2, TL_account.contentSettings contentsettings, BaseFragment baseFragment, Runnable runnable, AlertDialog alertDialog, int i) {
zArr[0] = true;
this.sensitiveAgreed.add(Long.valueOf(j));
if (zArr2[0] && contentsettings != null && contentsettings.sensitive_can_change) {
getMessagesController().setContentSettings(true);
BulletinFactory.of(baseFragment).createSimpleBulletinDetail(R.raw.chats_infotip, AndroidUtilities.replaceArrows(AndroidUtilities.premiumText(LocaleController.getString(R.string.SensitiveContentSettingsToast), new MessagesController$.ExternalSyntheticLambda223(baseFragment)), true)).show(true);
}
if (runnable != null) {
runnable.run();
}
}
public static void lambda$checkSensitive$400(boolean[] zArr, Runnable runnable, DialogInterface dialogInterface) {
if (zArr[0] || runnable == null) {
return;
}
runnable.run();
}
public void lambda$checkSensitive$401(AlertDialog alertDialog, BaseFragment baseFragment, long j, Runnable runnable, Runnable runnable2, TL_account.contentSettings contentsettings) {
alertDialog.dismissUnless(200L);
boolean[] zArr = new boolean[1];
FrameLayout frameLayout = new FrameLayout(baseFragment.getContext());
if (contentsettings != null && contentsettings.sensitive_can_change) {
CheckBoxCell checkBoxCell = new CheckBoxCell(baseFragment.getContext(), 1, baseFragment.getResourceProvider());
checkBoxCell.setBackground(Theme.getSelectorDrawable(false));
checkBoxCell.setText(LocaleController.getString(R.string.MessageShowSensitiveContentAlways), "", zArr[0], false);
checkBoxCell.setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16.0f) : AndroidUtilities.dp(8.0f), 0, LocaleController.isRTL ? AndroidUtilities.dp(8.0f) : AndroidUtilities.dp(16.0f), 0);
frameLayout.addView((View) checkBoxCell, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, 48.0f, 51, 0.0f, 0.0f, 0.0f, 0.0f));
checkBoxCell.setOnClickListener(new MessagesController$.ExternalSyntheticLambda182(zArr));
}
boolean[] zArr2 = new boolean[1];
new AlertDialog.Builder(baseFragment.getContext(), baseFragment.getResourceProvider()).setTitle(LocaleController.getString(R.string.MessageShowSensitiveContentChannelTitle)).setMessage(LocaleController.getString(R.string.MessageShowSensitiveContentChannelText)).setView(frameLayout).setCustomViewOffset(9).setNegativeButton(LocaleController.getString(R.string.Cancel), (AlertDialog.OnButtonClickListener) null).setPositiveButton(LocaleController.getString(R.string.MessageShowSensitiveContentButton), new MessagesController$.ExternalSyntheticLambda183(this, zArr2, j, zArr, contentsettings, baseFragment, runnable)).setOnDismissListener(new MessagesController$.ExternalSyntheticLambda184(zArr2, runnable2)).show();
}
public void lambda$checkTosUpdate$152(TLRPC.TL_help_termsOfServiceUpdate tL_help_termsOfServiceUpdate) {
getNotificationCenter().postNotificationName(NotificationCenter.needShowAlert, new Object[]{4, tL_help_termsOfServiceUpdate.terms_of_service});
}
public void lambda$checkTosUpdate$153(TLObject tLObject, TLRPC.TL_error tL_error) {
int currentTime;
this.checkingTosUpdate = false;
if (tLObject instanceof TLRPC.TL_help_termsOfServiceUpdateEmpty) {
currentTime = ((TLRPC.TL_help_termsOfServiceUpdateEmpty) tLObject).expires;
} else {
if (tLObject instanceof TLRPC.TL_help_termsOfServiceUpdate) {
TLRPC.TL_help_termsOfServiceUpdate tL_help_termsOfServiceUpdate = (TLRPC.TL_help_termsOfServiceUpdate) tLObject;
this.nextTosCheckTime = tL_help_termsOfServiceUpdate.expires;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda216(this, tL_help_termsOfServiceUpdate));
this.notificationsPreferences.edit().putInt("nextTosCheckTime", this.nextTosCheckTime).commit();
}
currentTime = getConnectionsManager().getCurrentTime() + 3600;
}
this.nextTosCheckTime = currentTime;
this.notificationsPreferences.edit().putInt("nextTosCheckTime", this.nextTosCheckTime).commit();
}
public void lambda$checkUnreadReactions$381(long j, int i, long j2, ArrayList arrayList) {
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog == null) {
getMessagesStorage().updateDialogUnreadReactions(j, 0L, i, false);
return;
}
dialog.unread_reactions_count = i;
getMessagesStorage().updateUnreadReactionsCount(j, j2, i);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsUnreadReactionsCounterChanged, new Object[]{Long.valueOf(j), Long.valueOf(j2), Integer.valueOf(i), arrayList});
}
public void lambda$checkUnreadReactions$382(long j, long j2, ArrayList arrayList, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda188(this, j, tL_messages_peerDialogs.dialogs.size() == 0 ? 0 : ((TLRPC.Dialog) tL_messages_peerDialogs.dialogs.get(0)).unread_reactions_count, j2, arrayList));
}
}
public void lambda$checkUnreadReactions$383(long j, long j2, int i, ArrayList arrayList) {
getMessagesController().getTopicsController().updateReactionsUnread(j, j2, i, false);
getMessagesStorage().updateUnreadReactionsCount(j, j2, i);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsUnreadReactionsCounterChanged, new Object[]{Long.valueOf(j), Long.valueOf(j2), Integer.valueOf(i), arrayList});
}
public void lambda$checkUnreadReactions$384(long j, long j2, ArrayList arrayList, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_savedDialogs tL_messages_savedDialogs = (TLRPC.TL_messages_savedDialogs) tLObject;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda347(this, j, j2, tL_messages_savedDialogs.dialogs.size() == 0 ? 0 : ((TLRPC.savedDialog) tL_messages_savedDialogs.dialogs.get(0)).unread_reactions_count, arrayList));
}
}
public void lambda$checkUnreadReactions$385(long j, long j2, int i, ArrayList arrayList) {
getMessagesController().getTopicsController().updateReactionsUnread(j, j2, i, false);
getMessagesStorage().updateUnreadReactionsCount(j, j2, i);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsUnreadReactionsCounterChanged, new Object[]{Long.valueOf(j), Long.valueOf(j2), Integer.valueOf(i), arrayList});
}
public void lambda$checkUnreadReactions$386(long j, long j2, ArrayList arrayList, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_forumTopics tL_messages_forumTopics = (TLRPC.TL_messages_forumTopics) tLObject;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda338(this, j, j2, tL_messages_forumTopics.topics.size() == 0 ? 0 : ((TLRPC.TL_forumTopic) tL_messages_forumTopics.topics.get(0)).unread_reactions_count, arrayList));
}
}
public void lambda$checkUnreadReactions$387(long j, long j2, int i, ArrayList arrayList) {
if (j != 0) {
int updateReactionsUnread = getMessagesController().getTopicsController().updateReactionsUnread(j2, j, i, true);
if (updateReactionsUnread >= 0) {
getMessagesStorage().updateUnreadReactionsCount(j2, j, updateReactionsUnread, true);
if (isForum(j2) || isMonoForum(j2)) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsUnreadReactionsCounterChanged, new Object[]{Long.valueOf(j2), Long.valueOf(j), Integer.valueOf(updateReactionsUnread), arrayList});
return;
}
return;
}
return;
}
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j2);
if (dialog == null) {
getMessagesStorage().updateDialogUnreadReactions(j2, 0L, i, true);
return;
}
int i2 = dialog.unread_reactions_count + i;
dialog.unread_reactions_count = i2;
if (i2 < 0) {
dialog.unread_reactions_count = 0;
}
getMessagesStorage().updateUnreadReactionsCount(j2, 0L, dialog.unread_reactions_count);
if (isForum(j2) || isMonoForum(j2)) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsUnreadReactionsCounterChanged, new Object[]{Long.valueOf(j2), Long.valueOf(j), Integer.valueOf(dialog.unread_reactions_count), arrayList});
}
}
public void lambda$checkUnreadReactions$388(SparseBooleanArray sparseBooleanArray, long j, long j2) {
TLRPC.TL_messages_getPeerDialogs tL_channels_getForumTopicsByID;
ConnectionsManager connectionsManager;
MessagesController$.ExternalSyntheticLambda229 externalSyntheticLambda231;
int i;
boolean z;
boolean z2;
SQLitePreparedStatement executeFast;
ArrayList arrayList = new ArrayList();
StringBuilder sb = new StringBuilder();
int i2 = 0;
for (int i3 = 0; i3 < sparseBooleanArray.size(); i3++) {
int keyAt = sparseBooleanArray.keyAt(i3);
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(keyAt);
}
SparseBooleanArray sparseBooleanArray2 = new SparseBooleanArray();
try {
SQLiteCursor queryFinalized = j == 0 ? getMessagesStorage().getDatabase().queryFinalized(String.format(Locale.US, "SELECT message_id, state FROM reaction_mentions WHERE message_id IN (%s) AND dialog_id = %d", sb, Long.valueOf(j2)), new Object[0]) : getMessagesStorage().getDatabase().queryFinalized(String.format(Locale.US, "SELECT message_id, state FROM reaction_mentions_topics WHERE message_id IN (%s) AND dialog_id = %d AND topic_id = %d", sb, Long.valueOf(j2), Long.valueOf(j)), new Object[0]);
while (queryFinalized.next()) {
sparseBooleanArray2.put(queryFinalized.intValue(0), queryFinalized.intValue(1) == 1);
}
queryFinalized.dispose();
} catch (SQLiteException e) {
e.printStackTrace();
}
boolean z3 = false;
int i4 = 0;
boolean z4 = false;
while (i4 < sparseBooleanArray.size()) {
int keyAt2 = sparseBooleanArray.keyAt(i4);
boolean valueAt = sparseBooleanArray.valueAt(i4);
if (sparseBooleanArray2.indexOfKey(keyAt2) < 0) {
i = i2;
z = z4;
z2 = true;
} else if (sparseBooleanArray2.get(keyAt2) != valueAt) {
z2 = z3;
i = i2 + (valueAt ? 1 : -1);
z = true;
} else {
i = i2;
z = z4;
z2 = z3;
}
if (valueAt) {
arrayList.add(Integer.valueOf(keyAt2));
}
if (j == 0) {
try {
executeFast = getMessagesStorage().getDatabase().executeFast("REPLACE INTO reaction_mentions VALUES(?, ?, ?)");
executeFast.requery();
executeFast.bindInteger(1, keyAt2);
executeFast.bindInteger(2, valueAt ? 1 : 0);
executeFast.bindLong(3, j2);
executeFast.step();
} catch (SQLiteException e2) {
e = e2;
e.printStackTrace();
i4++;
z3 = z2;
z4 = z;
i2 = i;
}
} else {
executeFast = getMessagesStorage().getDatabase().executeFast("REPLACE INTO reaction_mentions_topics VALUES(?, ?, ?, ?)");
executeFast.requery();
executeFast.bindInteger(1, keyAt2);
try {
executeFast.bindInteger(2, valueAt ? 1 : 0);
} catch (SQLiteException e3) {
e = e3;
e.printStackTrace();
i4++;
z3 = z2;
z4 = z;
i2 = i;
}
try {
executeFast.bindLong(3, j2);
executeFast.bindLong(4, j);
executeFast.step();
} catch (SQLiteException e4) {
e = e4;
e.printStackTrace();
i4++;
z3 = z2;
z4 = z;
i2 = i;
}
}
executeFast.dispose();
i4++;
z3 = z2;
z4 = z;
i2 = i;
}
if (!z3) {
if (z4) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda232(this, j, j2, i2, arrayList));
return;
}
return;
}
if (j == 0) {
tL_channels_getForumTopicsByID = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = getInputPeer(j2);
tL_channels_getForumTopicsByID.peers.add(tL_inputDialogPeer);
connectionsManager = ConnectionsManager.getInstance(this.currentAccount);
externalSyntheticLambda231 = new MessagesController$.ExternalSyntheticLambda229(this, j2, j, arrayList);
} else if (isMonoForum(j2)) {
tL_channels_getForumTopicsByID = new TLRPC.TL_messages_getSavedDialogsByID();
((TLRPC.TL_messages_getSavedDialogsByID) tL_channels_getForumTopicsByID).ids.add(getInputPeer(j));
((TLRPC.TL_messages_getSavedDialogsByID) tL_channels_getForumTopicsByID).parent_peer = getInputPeer(j2);
connectionsManager = ConnectionsManager.getInstance(this.currentAccount);
externalSyntheticLambda231 = new MessagesController$.ExternalSyntheticLambda230(this, j2, j, arrayList);
} else {
tL_channels_getForumTopicsByID = new TLRPC.TL_channels_getForumTopicsByID();
((TLRPC.TL_channels_getForumTopicsByID) tL_channels_getForumTopicsByID).topics.add(Integer.valueOf((int) j));
((TLRPC.TL_channels_getForumTopicsByID) tL_channels_getForumTopicsByID).channel = getMessagesController().getInputChannel(-j2);
connectionsManager = ConnectionsManager.getInstance(this.currentAccount);
externalSyntheticLambda231 = new MessagesController$.ExternalSyntheticLambda231(this, j2, j, arrayList);
}
connectionsManager.sendRequest(tL_channels_getForumTopicsByID, externalSyntheticLambda231);
}
public void lambda$cleanup$47() {
this.readTasks.clear();
this.readTasksMap.clear();
this.repliesReadTasks.clear();
this.threadsReadTasksMap.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$48() {
FileLog.d("cleanup: isUpdating = false");
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 void lambda$cleanup$49() {
getNotificationCenter().postNotificationName(NotificationCenter.suggestedFiltersLoaded, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$completeDialogsReset$199(TLRPC.messages_Dialogs messages_dialogs, LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
MediaDataController mediaDataController;
long j;
this.resetingDialogs = false;
applyDialogsNotificationsSettings(messages_dialogs.dialogs);
MediaDataController mediaDataController2 = getMediaDataController();
mediaDataController2.clearAllDrafts(false);
mediaDataController2.loadDraftsIfNeed();
putUsers(messages_dialogs.users, false);
putChats(messages_dialogs.chats, false);
for (int i = 0; i < this.allDialogs.size(); i++) {
TLRPC.Dialog dialog = this.allDialogs.get(i);
if (!DialogObject.isEncryptedDialog(dialog.id)) {
this.dialogs_dict.remove(dialog.id);
ArrayList arrayList = (ArrayList) this.dialogMessage.get(dialog.id);
this.dialogMessage.remove(dialog.id);
if (arrayList != null) {
for (int i2 = 0; i2 < arrayList.size(); i2++) {
MessageObject messageObject = (MessageObject) arrayList.get(i2);
if (messageObject != null) {
if (messageObject.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.remove(messageObject.getId());
}
long j2 = messageObject.messageOwner.random_id;
if (j2 != 0) {
this.dialogMessagesByRandomIds.remove(j2);
}
}
}
}
}
}
int i3 = 0;
while (i3 < longSparseArray.size()) {
long keyAt = longSparseArray.keyAt(i3);
TLRPC.Dialog dialog2 = (TLRPC.Dialog) longSparseArray.valueAt(i3);
TLRPC.DraftMessage draftMessage = dialog2.draft;
if (draftMessage instanceof TLRPC.TL_draftMessage) {
mediaDataController = mediaDataController2;
j = keyAt;
mediaDataController2.saveDraft(dialog2.id, 0L, draftMessage, (TLRPC.Message) null, false);
} else {
mediaDataController = mediaDataController2;
j = keyAt;
}
this.dialogs_dict.put(j, dialog2);
ArrayList arrayList2 = (ArrayList) longSparseArray2.get(dialog2.id);
this.dialogMessage.put(j, arrayList2);
if (arrayList2 != null) {
for (int i4 = 0; i4 < arrayList2.size(); i4++) {
MessageObject messageObject2 = (MessageObject) arrayList2.get(i4);
if (messageObject2 != null && messageObject2.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject2.getId(), messageObject2);
this.dialogsLoadedTillDate = Math.min(this.dialogsLoadedTillDate, messageObject2.messageOwner.date);
long j3 = messageObject2.messageOwner.random_id;
if (j3 != 0) {
this.dialogMessagesByRandomIds.put(j3, messageObject2);
}
}
}
}
getTranslateController().checkDialogMessage(j);
i3++;
mediaDataController2 = mediaDataController;
}
this.allDialogs.clear();
int size = this.dialogs_dict.size();
for (int i5 = 0; i5 < size; i5++) {
TLRPC.Dialog dialog3 = (TLRPC.Dialog) this.dialogs_dict.valueAt(i5);
if (this.deletingDialogs.indexOfKey(dialog3.id) < 0) {
this.allDialogs.add(dialog3);
}
}
sortDialogs(null);
this.dialogsEndReached.put(0, true);
this.serverDialogsEndReached.put(0, false);
this.dialogsEndReached.put(1, true);
this.serverDialogsEndReached.put(1, false);
int totalDialogsCount = getUserConfig().getTotalDialogsCount(0);
long[] dialogLoadOffsets = getUserConfig().getDialogLoadOffsets(0);
if (totalDialogsCount < 400) {
long j4 = dialogLoadOffsets[0];
if (j4 != -1 && j4 != 2147483647L) {
loadDialogs(0, 0, 100, false);
}
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$completeDialogsReset$200(int i, int i2, int i3, TLRPC.messages_Dialogs messages_dialogs, LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
this.gettingDifference = false;
getMessagesStorage().setLastPtsValue(i);
getMessagesStorage().setLastDateValue(i2);
getMessagesStorage().setLastQtsValue(i3);
getDifference();
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda154(this, messages_dialogs, longSparseArray, longSparseArray2));
}
public static void lambda$completeReadTask$225(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$completeReadTask$226(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null && (tLObject instanceof TLRPC.TL_messages_affectedMessages)) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedMessages.pts, -1, tL_messages_affectedMessages.pts_count);
}
}
public static void lambda$completeReadTask$227(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public static void lambda$convertToGigaGroup$245(Context context, AlertDialog alertDialog) {
if (((Activity) context).isFinishing()) {
return;
}
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
}
public static void lambda$convertToGigaGroup$246(MessagesStorage.BooleanCallback booleanCallback) {
if (booleanCallback != null) {
booleanCallback.run(true);
}
}
public void lambda$convertToGigaGroup$247(MessagesStorage.BooleanCallback booleanCallback, Context context, AlertDialog alertDialog, TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_channels_convertToGigagroup tL_channels_convertToGigagroup) {
if (booleanCallback != null) {
booleanCallback.run(false);
}
if (context == null || ((Activity) context).isFinishing()) {
return;
}
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_channels_convertToGigagroup, new Object[]{Boolean.FALSE});
}
public void lambda$convertToGigaGroup$248(Context context, AlertDialog alertDialog, MessagesStorage.BooleanCallback booleanCallback, BaseFragment baseFragment, TLRPC.TL_channels_convertToGigagroup tL_channels_convertToGigagroup, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda381(this, booleanCallback, context, alertDialog, tL_error, baseFragment, tL_channels_convertToGigagroup));
return;
}
if (context != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda379(context, alertDialog));
}
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda380(booleanCallback));
}
public void lambda$convertToGigaGroup$249(int i, DialogInterface dialogInterface) {
getConnectionsManager().cancelRequest(i, true);
}
public static void lambda$convertToMegaGroup$240(Context context, AlertDialog alertDialog) {
if (((Activity) context).isFinishing()) {
return;
}
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
}
public static void lambda$convertToMegaGroup$241(MessagesStorage.LongCallback longCallback, TLRPC.Updates updates, long j) {
TLRPC.Chat chat;
TLRPC.Chat chat2;
TLRPC.InputChannel inputChannel;
if (longCallback != null) {
int i = 0;
int i2 = 0;
while (true) {
chat = null;
if (i2 >= updates.chats.size()) {
chat2 = null;
break;
}
chat2 = (TLRPC.Chat) updates.chats.get(i2);
if (j == chat2.id) {
break;
} else {
i2++;
}
}
if (chat2 == null || (inputChannel = chat2.migrated_to) == null) {
return;
}
long j2 = inputChannel.channel_id;
while (true) {
if (i >= updates.chats.size()) {
break;
}
TLRPC.Chat chat3 = (TLRPC.Chat) updates.chats.get(i);
if (j2 == chat3.id) {
chat = chat3;
break;
}
i++;
}
if (chat != null) {
longCallback.run(j2);
}
}
}
public void lambda$convertToMegaGroup$242(MessagesStorage.LongCallback longCallback, Context context, AlertDialog alertDialog, TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_messages_migrateChat tL_messages_migrateChat) {
if (longCallback != null) {
longCallback.run(0L);
}
if (context == null || ((Activity) context).isFinishing()) {
return;
}
try {
alertDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_messages_migrateChat, new Object[]{Boolean.FALSE});
}
public void lambda$convertToMegaGroup$243(Context context, AlertDialog alertDialog, MessagesStorage.LongCallback longCallback, long j, Runnable runnable, BaseFragment baseFragment, TLRPC.TL_messages_migrateChat tL_messages_migrateChat, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
if (runnable != null) {
runnable.run();
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda262(this, longCallback, context, alertDialog, tL_error, baseFragment, tL_messages_migrateChat));
} else {
if (context != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda260(context, alertDialog));
}
TLRPC.Updates updates = (TLRPC.Updates) tLObject;
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda261(longCallback, updates, j));
}
}
public void lambda$convertToMegaGroup$244(int i, DialogInterface dialogInterface) {
getConnectionsManager().cancelRequest(i, true);
}
public void lambda$createChat$234(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_messages_createChat tL_messages_createChat) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_messages_createChat, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
public void lambda$createChat$235(TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers) {
putUsers(tL_messages_invitedUsers.updates.users, false);
putChats(tL_messages_invitedUsers.updates.chats, false);
ArrayList arrayList = tL_messages_invitedUsers.updates.chats;
if (arrayList == null || arrayList.isEmpty()) {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
} else {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidCreated, new Object[]{Long.valueOf(((TLRPC.Chat) tL_messages_invitedUsers.updates.chats.get(0)).id)});
AlertsCreator.checkRestrictedInviteUsers(this.currentAccount, (TLRPC.Chat) tL_messages_invitedUsers.updates.chats.get(0), tL_messages_invitedUsers);
}
}
public void lambda$createChat$236(BaseFragment baseFragment, TLRPC.TL_messages_createChat tL_messages_createChat, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda443(this, tL_error, baseFragment, tL_messages_createChat));
} else if (tLObject instanceof TLRPC.TL_messages_invitedUsers) {
TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers = (TLRPC.TL_messages_invitedUsers) tLObject;
processUpdates(tL_messages_invitedUsers.updates, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda444(this, tL_messages_invitedUsers));
}
}
public void lambda$createChat$237(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_channels_createChannel tL_channels_createChannel) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_channels_createChannel, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
}
public void lambda$createChat$238(TLRPC.Updates updates) {
putUsers(updates.users, false);
putChats(updates.chats, false);
ArrayList arrayList = updates.chats;
if (arrayList == null || arrayList.isEmpty()) {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidFailCreate, new Object[0]);
} else {
getNotificationCenter().postNotificationName(NotificationCenter.chatDidCreated, new Object[]{Long.valueOf(((TLRPC.Chat) updates.chats.get(0)).id)});
}
}
public void lambda$createChat$239(BaseFragment baseFragment, TLRPC.TL_channels_createChannel tL_channels_createChannel, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda360(this, tL_error, baseFragment, tL_channels_createChannel));
return;
}
TLRPC.Updates updates = (TLRPC.Updates) tLObject;
processUpdates(updates, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda361(this, updates));
}
public void lambda$deleteDialog$128(long j, int i, boolean z, TLRPC.InputPeer inputPeer, long j2, int i2) {
if (j == getUserConfig().getClientUserId()) {
getSavedMessagesController().deleteAllDialogs();
}
deleteDialog(j, 2, i, Math.max(0, i2), z, inputPeer, j2);
checkIfFolderEmpty(1);
}
public void lambda$deleteDialog$129(long j) {
getNotificationsController().removeNotificationsForDialog(j);
}
public void lambda$deleteDialog$130(long j) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda256(this, j));
}
public void lambda$deleteDialog$131(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
}
public void lambda$deleteDialog$132(long j, long j2, int i, int i2, boolean z, TLRPC.InputPeer inputPeer, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
if (tL_error == null) {
TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory = (TLRPC.TL_messages_affectedHistory) tLObject;
if (tL_messages_affectedHistory.offset > 0) {
deleteDialog(j2, 0, i, i2, z, inputPeer, 0L);
}
processNewDifferenceParams(-1, tL_messages_affectedHistory.pts, -1, tL_messages_affectedHistory.pts_count);
getMessagesStorage().onDeleteQueryComplete(j2);
}
}
public void lambda$deleteMessages$117(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$deleteMessages$118(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$deleteMessages$119(long j, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewChannelDifferenceParams(tL_messages_affectedMessages.pts, tL_messages_affectedMessages.pts_count, j);
}
if (j2 != 0) {
getMessagesStorage().removePendingTask(j2);
}
}
public void lambda$deleteMessages$120(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedMessages.pts, -1, tL_messages_affectedMessages.pts_count);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$deleteMessagesByPush$343(ArrayList arrayList, long j) {
getNotificationCenter().postNotificationName(NotificationCenter.messagesDeleted, new Object[]{arrayList, Long.valueOf(j), Boolean.FALSE});
if (j == 0) {
int size = arrayList.size();
for (int i = 0; i < size; i++) {
MessageObject messageObject = this.dialogMessagesByIds.get(((Integer) arrayList.get(i)).intValue());
if (messageObject != null) {
messageObject.deleted = true;
}
}
return;
}
ArrayList arrayList2 = (ArrayList) this.dialogMessage.get(-j);
if (arrayList2 != null) {
for (int i2 = 0; i2 < arrayList2.size(); i2++) {
MessageObject messageObject2 = (MessageObject) arrayList2.get(i2);
int size2 = arrayList.size();
int i3 = 0;
while (true) {
if (i3 >= size2) {
break;
}
if (messageObject2.getId() == ((Integer) arrayList.get(i3)).intValue()) {
messageObject2.deleted = true;
break;
}
i3++;
}
}
}
}
public void lambda$deleteMessagesByPush$344(ArrayList arrayList, long j, long j2) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda298(this, arrayList, j));
getMessagesStorage().deletePushMessages(j2, arrayList);
getMessagesStorage().updateDialogsWithDeletedMessages(j2, j, arrayList, getMessagesStorage().markMessagesAsDeleted(j2, arrayList, false, true, 0, 0), false);
}
public void lambda$deleteMessagesRange$414(ArrayList arrayList, long j, TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory, long j2, int i, int i2, boolean z, Runnable runnable) {
getNotificationCenter().postNotificationName(NotificationCenter.messagesDeleted, new Object[]{arrayList, Long.valueOf(j), Boolean.FALSE});
if (tL_messages_affectedHistory.offset > 0) {
deleteMessagesRange(j2, j, i, i2, z, runnable);
} else {
runnable.run();
}
}
public void lambda$deleteMessagesRange$415(long j, int i, int i2, long j2, TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory, boolean z, Runnable runnable) {
ArrayList cachedMessagesInRange = getMessagesStorage().getCachedMessagesInRange(j, i, i2);
getMessagesStorage().markMessagesAsDeleted(j, cachedMessagesInRange, false, true, 0, 0);
getMessagesStorage().updateDialogsWithDeletedMessages(j, 0L, cachedMessagesInRange, (ArrayList) null, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda329(this, cachedMessagesInRange, j2, tL_messages_affectedHistory, j, i, i2, z, runnable));
}
public void lambda$deleteMessagesRange$417(long j, int i, int i2, long j2, boolean z, Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda350(runnable));
return;
}
TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory = (TLRPC.TL_messages_affectedHistory) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedHistory.pts, -1, tL_messages_affectedHistory.pts_count);
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda349(this, j, i, i2, j2, tL_messages_affectedHistory, z, runnable));
}
public static void lambda$deleteParticipantFromChat$285(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$deleteParticipantFromChat$286(long j) {
loadFullChat(j, 0, true);
}
public void lambda$deleteParticipantFromChat$287(boolean z, boolean z2, long j, Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
if (z && !z2) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda353(this, j), 1000L);
}
if (runnable != null) {
AndroidUtilities.runOnUIThread(runnable);
}
}
public static void lambda$deleteParticipantFromChat$288(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$deleteParticipantFromChat$289(long j) {
loadFullChat(j, 0, true);
}
public void lambda$deleteParticipantFromChat$290(boolean z, TLRPC$User tLRPC$User, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
if (!z || UserObject.isUserSelf(tLRPC$User)) {
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda430(this, j), 1000L);
}
public void lambda$deleteSavedDialog$133(long j, int[] iArr, TLRPC.InputPeer inputPeer, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory = (TLRPC.TL_messages_affectedHistory) tLObject;
if (tL_messages_affectedHistory.offset > 0) {
deleteSavedDialog(j, iArr[0], inputPeer);
}
processNewDifferenceParams(-1, tL_messages_affectedHistory.pts, -1, tL_messages_affectedHistory.pts_count);
getMessagesStorage().onDeleteQueryComplete(j);
}
}
public void lambda$deleteSavedDialog$134(long j, long j2, TLRPC.InputPeer inputPeer, int i, int[] iArr) {
SavedMessagesController.SavedDialog savedDialog;
if (j == 0) {
getMessagesStorage().deleteSavedDialog(j2);
}
TLRPC.TL_messages_deleteSavedHistory tL_messages_deleteSavedHistory = new TLRPC.TL_messages_deleteSavedHistory();
tL_messages_deleteSavedHistory.peer = getInputPeer(j2);
tL_messages_deleteSavedHistory.parent_peer = inputPeer;
if (i == 0 && j == 0) {
int i2 = 0;
while (true) {
if (i2 >= getSavedMessagesController().allDialogs.size()) {
savedDialog = null;
break;
} else {
if (((SavedMessagesController.SavedDialog) getSavedMessagesController().allDialogs.get(i2)).dialogId == j2) {
savedDialog = (SavedMessagesController.SavedDialog) getSavedMessagesController().allDialogs.get(i2);
break;
}
i2++;
}
}
if (savedDialog != null) {
iArr[0] = Math.max(iArr[0], savedDialog.top_message_id);
getSavedMessagesController().deleteDialog(j2);
}
int i3 = iArr[0];
if (i3 <= 0) {
i3 = ConnectionsManager.DEFAULT_DATACENTER_ID;
}
tL_messages_deleteSavedHistory.max_id = i3;
}
getConnectionsManager().sendRequest(tL_messages_deleteSavedHistory, new MessagesController$.ExternalSyntheticLambda346(this, j2, iArr, inputPeer), 64);
}
public static void lambda$deleteSavedDialog$135(int[] iArr, Runnable runnable, int i) {
iArr[0] = i;
runnable.run();
}
public void lambda$deleteUserChannelHistory$123(TLRPC.Chat chat, TLRPC$User tLRPC$User, TLRPC.Chat chat2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory = (TLRPC.TL_messages_affectedHistory) tLObject;
int i = tL_messages_affectedHistory.offset;
if (i > 0) {
deleteUserChannelHistory(chat, tLRPC$User, chat2, i);
}
processNewChannelDifferenceParams(tL_messages_affectedHistory.pts, tL_messages_affectedHistory.pts_count, chat.id);
}
}
public void lambda$deleteUserPhoto$109(TLObject tLObject, long j) {
TLRPC.TL_photos_photo tL_photos_photo = (TLRPC.TL_photos_photo) tLObject;
TLRPC$User user = getUser(Long.valueOf(getUserConfig().getClientUserId()));
if (user == null) {
user = getUserConfig().getCurrentUser();
putUser(user, false);
} else {
getUserConfig().setCurrentUser(user);
}
if (user == null) {
return;
}
ArrayList arrayList = new ArrayList();
arrayList.add(user);
getMessagesStorage().putUsersAndChats(arrayList, (List) null, false, true);
if (tL_photos_photo.photo instanceof TLRPC.TL_photo) {
TLRPC.TL_userProfilePhoto tL_userProfilePhoto = new TLRPC.TL_userProfilePhoto();
user.photo = tL_userProfilePhoto;
((TLRPC.UserProfilePhoto) tL_userProfilePhoto).has_video = !tL_photos_photo.photo.video_sizes.isEmpty();
TLRPC.UserProfilePhoto userProfilePhoto = user.photo;
TLRPC.Photo photo = tL_photos_photo.photo;
userProfilePhoto.photo_id = photo.id;
userProfilePhoto.photo_small = FileLoader.getClosestPhotoSizeWithSize(photo.sizes, 150).location;
user.photo.photo_big = FileLoader.getClosestPhotoSizeWithSize(tL_photos_photo.photo.sizes, 800).location;
user.photo.dc_id = tL_photos_photo.photo.dc_id;
} else {
user.photo = new TLRPC.TL_userProfilePhotoEmpty();
}
TLRPC.UserFull userFull = getUserFull(j);
if (userFull != null) {
userFull.profile_photo = tL_photos_photo.photo;
getMessagesStorage().updateUserInfo(userFull, false);
}
getUserConfig().getCurrentUser().photo = user.photo;
putUser(user, false);
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
NotificationCenter notificationCenter = getNotificationCenter();
int i = NotificationCenter.updateInterfaces;
notificationCenter.postNotificationName(i, new Object[]{Integer.valueOf(UPDATE_MASK_ALL)});
getNotificationCenter().postNotificationName(i, new Object[]{Integer.valueOf(UPDATE_MASK_AVATAR)});
getUserConfig().saveConfig(true);
}
public void lambda$deleteUserPhoto$110(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda135(this, tLObject, j));
}
}
public void lambda$didAddedNewTask$75(int i) {
int i2;
if (!(this.currentDeletingTaskMids == null && this.currentDeletingTaskMediaMids == null && !this.gettingNewDeleteTask) && ((i2 = this.currentDeletingTaskTime) == 0 || i >= i2)) {
return;
}
getNewDeleteTask(null, null);
}
public void lambda$didAddedNewTask$76(long j, SparseArray sparseArray) {
getNotificationCenter().postNotificationName(NotificationCenter.didCreatedNewDeleteTask, new Object[]{Long.valueOf(j), sparseArray});
}
public void lambda$didReceivedNotification$37() {
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_AVATAR)});
getUserConfig().saveConfig(true);
}
public void lambda$didReceivedNotification$38(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC$User user = getUser(Long.valueOf(getUserConfig().getClientUserId()));
if (user == null) {
user = getUserConfig().getCurrentUser();
putUser(user, true);
} else {
getUserConfig().setCurrentUser(user);
}
if (user == null) {
return;
}
TLRPC.TL_photos_photo tL_photos_photo = (TLRPC.TL_photos_photo) tLObject;
ArrayList arrayList = tL_photos_photo.photo.sizes;
TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(arrayList, 100);
TLRPC.PhotoSize closestPhotoSizeWithSize2 = FileLoader.getClosestPhotoSizeWithSize(arrayList, 1000);
TLRPC.TL_userProfilePhoto tL_userProfilePhoto = new TLRPC.TL_userProfilePhoto();
user.photo = tL_userProfilePhoto;
((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_id = tL_photos_photo.photo.id;
if (closestPhotoSizeWithSize != null) {
((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_small = closestPhotoSizeWithSize.location;
}
if (closestPhotoSizeWithSize2 != null) {
((TLRPC.UserProfilePhoto) tL_userProfilePhoto).photo_big = closestPhotoSizeWithSize2.location;
}
getDialogPhotos(user.id).reset();
getDialogPhotos(user.id).load(0, 80);
ArrayList arrayList2 = new ArrayList();
arrayList2.add(user);
getMessagesStorage().putUsersAndChats(arrayList2, (List) null, false, true);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda53(this));
}
}
public void lambda$didReceivedNotification$39(TLRPC.WallPaper wallPaper, TLRPC.TL_wallPaperSettings tL_wallPaperSettings, Theme.OverrideWallpaperInfo overrideWallpaperInfo, File file, String str) {
if (this.uploadingWallpaper == null || this.uploadingWallpaperInfo.requestIds == null || wallPaper == null) {
return;
}
wallPaper.settings = tL_wallPaperSettings;
wallPaper.flags |= 4;
overrideWallpaperInfo.slug = wallPaper.slug;
overrideWallpaperInfo.saveOverrideWallpaper();
ArrayList arrayList = new ArrayList();
arrayList.add(wallPaper);
getMessagesStorage().putWallpapers(arrayList, 2);
TLRPC.PhotoSize closestPhotoSizeWithSize = FileLoader.getClosestPhotoSizeWithSize(wallPaper.document.thumbs, 320);
if (closestPhotoSizeWithSize != null) {
ImageLoader.getInstance().replaceImageInCache(Utilities.MD5(file.getAbsolutePath()) + "@100_100", closestPhotoSizeWithSize.location.volume_id + "_" + closestPhotoSizeWithSize.location.local_id + "@100_100", ImageLocation.getForDocument(closestPhotoSizeWithSize, wallPaper.document), false);
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.wallpapersNeedReload, new Object[]{wallPaper.slug});
ArrayList arrayList2 = this.uploadingWallpaperInfo.requestIds;
if (arrayList2 == null || overrideWallpaperInfo.dialogId == 0) {
return;
}
arrayList2.add(Integer.valueOf(ChatThemeController.getInstance(this.currentAccount).setWallpaperToPeer(overrideWallpaperInfo.dialogId, str, overrideWallpaperInfo, (MessageObject) null, (Runnable) null)));
}
public void lambda$didReceivedNotification$40(Theme.OverrideWallpaperInfo overrideWallpaperInfo, TLRPC.TL_wallPaperSettings tL_wallPaperSettings, String str, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.WallPaper wallPaper = (TLRPC.WallPaper) tLObject;
File file = new File(ApplicationLoader.getFilesDirFixed(), overrideWallpaperInfo.originalFileName);
if (wallPaper != null) {
try {
AndroidUtilities.copyFile(file, getFileLoader().getPathToAttach(wallPaper.document, true));
} catch (Exception unused) {
}
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda18(this, wallPaper, tL_wallPaperSettings, overrideWallpaperInfo, file, str));
}
public void lambda$didReceivedNotification$41(TLObject tLObject, Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent) {
if (!(tLObject instanceof TLRPC.TL_theme)) {
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, new Object[]{themeInfo, themeAccent});
return;
}
Theme.setThemeUploadInfo(themeInfo, themeAccent, (TLRPC.TL_theme) tLObject, this.currentAccount, false);
installTheme(themeInfo, themeAccent, themeInfo == Theme.getCurrentNightTheme());
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadedToServer, new Object[]{themeInfo, themeAccent});
}
public void lambda$didReceivedNotification$42(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda467(this, tLObject, themeInfo, themeAccent));
}
public void lambda$didReceivedNotification$43(TLObject tLObject, Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent) {
if (!(tLObject instanceof TLRPC.TL_theme)) {
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, new Object[]{themeInfo, themeAccent});
} else {
Theme.setThemeUploadInfo(themeInfo, themeAccent, (TLRPC.TL_theme) tLObject, this.currentAccount, false);
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadedToServer, new Object[]{themeInfo, themeAccent});
}
}
public void lambda$didReceivedNotification$44(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda376(this, tLObject, themeInfo, themeAccent));
}
public void lambda$didReceivedNotification$45(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent) {
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, new Object[]{themeInfo, themeAccent});
}
public void lambda$didReceivedNotification$46(TLRPC.TL_theme tL_theme, Theme.ThemeInfo themeInfo, TLRPC.TL_inputThemeSettings tL_inputThemeSettings, Theme.ThemeAccent themeAccent, TLObject tLObject, TLRPC.TL_error tL_error) {
TL_account.updateTheme createtheme;
ConnectionsManager connectionsManager;
MessagesController$.ExternalSyntheticLambda127 externalSyntheticLambda128;
String name = tL_theme != null ? tL_theme.title : themeInfo.getName();
int lastIndexOf = name.lastIndexOf(".attheme");
if (lastIndexOf > 0) {
name = name.substring(0, lastIndexOf);
}
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda129(this, themeInfo, themeAccent));
return;
}
TLRPC$Document tLRPC$Document = (TLRPC$Document) tLObject;
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).file_reference = tLRPC$Document.file_reference;
if (tL_theme == null || !tL_theme.creator) {
createtheme = new TL_account.createTheme();
((TL_account.createTheme) createtheme).document = tL_inputDocument;
((TL_account.createTheme) createtheme).flags |= 4;
((TL_account.createTheme) createtheme).slug = (tL_theme == null || TextUtils.isEmpty(tL_theme.slug)) ? "" : tL_theme.slug;
((TL_account.createTheme) createtheme).title = name;
if (tL_inputThemeSettings != null) {
((TL_account.createTheme) createtheme).settings = tL_inputThemeSettings;
((TL_account.createTheme) createtheme).flags |= 8;
}
connectionsManager = getConnectionsManager();
externalSyntheticLambda128 = new MessagesController$.ExternalSyntheticLambda128(this, themeInfo, themeAccent);
} else {
createtheme = new TL_account.updateTheme();
TLRPC.TL_inputTheme tL_inputTheme = new TLRPC.TL_inputTheme();
tL_inputTheme.id = tL_theme.id;
tL_inputTheme.access_hash = tL_theme.access_hash;
createtheme.theme = tL_inputTheme;
createtheme.slug = tL_theme.slug;
int i = createtheme.flags;
createtheme.title = name;
createtheme.document = tL_inputDocument;
createtheme.flags = i | 7;
if (tL_inputThemeSettings != null) {
createtheme.settings = tL_inputThemeSettings;
createtheme.flags = i | 15;
}
createtheme.format = "android";
connectionsManager = getConnectionsManager();
externalSyntheticLambda128 = new MessagesController$.ExternalSyntheticLambda127(this, themeInfo, themeAccent);
}
connectionsManager.sendRequest(createtheme, externalSyntheticLambda128);
}
public void lambda$ensureMessagesLoaded$410(boolean[] zArr, TLRPC.Chat chat, Runnable[] runnableArr, long j, int i, MessagesLoadedCallback messagesLoadedCallback) {
if (zArr[0]) {
return;
}
if (chat != null) {
getMessagesController().putChat(chat, true);
runnableArr[0] = ensureMessagesLoaded(j, i, messagesLoadedCallback);
} else if (messagesLoadedCallback != null) {
messagesLoadedCallback.onError();
}
}
public void lambda$ensureMessagesLoaded$411(boolean[] zArr, MessagesStorage messagesStorage, long j, Runnable[] runnableArr, long j2, int i, MessagesLoadedCallback messagesLoadedCallback) {
if (zArr[0]) {
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda383(this, zArr, messagesStorage.getChat(j), runnableArr, j2, i, messagesLoadedCallback));
}
public static void lambda$ensureMessagesLoaded$412(boolean[] zArr, Runnable[] runnableArr) {
zArr[0] = true;
Runnable runnable = runnableArr[0];
if (runnable != null) {
runnable.run();
}
}
public void lambda$ensureMessagesLoaded$413(int i) {
getConnectionsManager().cancelRequestsForGuid(i);
}
public void lambda$generateJoinMessage$342(long j, ArrayList arrayList) {
updateInterfaceWithMessages(-j, arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$getAvailableEffects$447(TLRPC.messages_AvailableEffects messages_availableeffects) {
if (this.availableEffects != messages_availableeffects) {
this.availableEffects = messages_availableeffects;
if (messages_availableeffects != null) {
AnimatedEmojiDrawable.getDocumentFetcher(this.currentAccount).putDocuments(this.availableEffects.documents);
}
getNotificationCenter().postNotificationName(NotificationCenter.availableEffectsUpdate, new Object[0]);
}
this.loadingAvailableEffects = false;
}
public void lambda$getBlockedPeers$107(TLObject tLObject, boolean z, TLRPC.TL_contacts_getBlocked tL_contacts_getBlocked) {
if (tLObject != null) {
TLRPC.contacts_Blocked contacts_blocked = (TLRPC.contacts_Blocked) tLObject;
putUsers(contacts_blocked.users, false);
putChats(contacts_blocked.chats, false);
getMessagesStorage().putUsersAndChats(contacts_blocked.users, contacts_blocked.chats, true, true);
if (z) {
this.blockePeers.clear();
}
this.totalBlockedCount = Math.max(contacts_blocked.count, contacts_blocked.blocked.size());
this.blockedEndReached = contacts_blocked.blocked.size() < tL_contacts_getBlocked.limit;
int size = contacts_blocked.blocked.size();
for (int i = 0; i < size; i++) {
this.blockePeers.put(MessageObject.getPeerId(((TLRPC.TL_peerBlocked) contacts_blocked.blocked.get(i)).peer_id), 1);
}
this.loadingBlockedPeers = false;
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
}
public void lambda$getBlockedPeers$108(boolean z, TLRPC.TL_contacts_getBlocked tL_contacts_getBlocked, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda124(this, tLObject, z, tL_contacts_getBlocked));
}
public void lambda$getChannelDifference$308(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$309(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$310(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$311(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$312(TLRPC.updates_ChannelDifference updates_channeldifference) {
putUsers(updates_channeldifference.users, false);
putChats(updates_channeldifference.chats, false);
}
public void lambda$getChannelDifference$313(SparseArray sparseArray) {
for (int i = 0; i < sparseArray.size(); i++) {
int keyAt = sparseArray.keyAt(i);
long[] jArr = (long[]) sparseArray.valueAt(i);
getSendMessagesHelper().processSentMessage((int) jArr[1]);
NotificationCenter notificationCenter = getNotificationCenter();
int i2 = NotificationCenter.messageReceivedByServer;
Integer valueOf = Integer.valueOf((int) jArr[1]);
Integer valueOf2 = Integer.valueOf(keyAt);
Long valueOf3 = Long.valueOf(jArr[0]);
Boolean bool = Boolean.FALSE;
notificationCenter.postNotificationName(i2, new Object[]{valueOf, valueOf2, null, valueOf3, 0L, -1, bool});
getNotificationCenter().postNotificationName(NotificationCenter.messageReceivedByServer2, new Object[]{Integer.valueOf((int) jArr[1]), Integer.valueOf(keyAt), null, Long.valueOf(jArr[0]), 0L, -1, bool});
}
}
public void lambda$getChannelDifference$314(LongSparseArray longSparseArray) {
for (int i = 0; i < longSparseArray.size(); i++) {
updateInterfaceWithMessages(longSparseArray.keyAt(i), (ArrayList) longSparseArray.valueAt(i), 0);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$getChannelDifference$315(ArrayList arrayList) {
getNotificationsController().processNewMessages(arrayList, true, false, (CountDownLatch) null);
}
public void lambda$getChannelDifference$316(ArrayList arrayList, TLRPC.updates_ChannelDifference updates_channeldifference) {
if (!arrayList.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda87(this, arrayList));
}
getMessagesStorage().putMessages(updates_channeldifference.new_messages, true, false, false, getDownloadController().getAutodownloadMask(), 0, 0L);
}
public void lambda$getChannelDifference$317(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$318(long j) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda437(this, j));
}
public void lambda$getChannelDifference$319(long j) {
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$320(org.telegram.tgnet.TLRPC.updates_ChannelDifference r23, long r24, org.telegram.tgnet.TLRPC.Chat r26, androidx.collection.LongSparseArray r27, int r28, long r29) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$getChannelDifference$320(org.telegram.tgnet.TLRPC$updates_ChannelDifference, long, org.telegram.tgnet.TLRPC$Chat, androidx.collection.LongSparseArray, int, long):void");
}
public void lambda$getChannelDifference$321(ArrayList arrayList, long j, TLRPC.updates_ChannelDifference updates_channeldifference, TLRPC.Chat chat, LongSparseArray longSparseArray, int i, long j2) {
if (!arrayList.isEmpty()) {
SparseArray sparseArray = new SparseArray();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC.TL_updateMessageID) it.next();
long[] updateMessageStateAndId = getMessagesStorage().updateMessageStateAndId(tL_updateMessageID.random_id, -j, (Integer) null, tL_updateMessageID.id, 0, false, -1, 0);
if (updateMessageStateAndId != null) {
sparseArray.put(tL_updateMessageID.id, updateMessageStateAndId);
}
}
if (sparseArray.size() != 0) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda164(this, sparseArray));
}
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda165(this, updates_channeldifference, j, chat, longSparseArray, i, j2));
}
public void lambda$getChannelDifference$322(TLRPC.TL_error tL_error, long j) {
checkChannelError(tL_error.text, j);
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.onReceivedChannelDifference, new Object[]{Long.valueOf(j)});
}
public void lambda$getChannelDifference$323(long j, int i, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.Chat chat;
if (tLObject == null) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda461(this, tL_error, j));
this.gettingDifferenceChannels.delete(j);
if (j2 != 0) {
getMessagesStorage().removePendingTask(j2);
return;
}
return;
}
return;
}
TLRPC.updates_ChannelDifference updates_channeldifference = (TLRPC.updates_ChannelDifference) tLObject;
LongSparseArray longSparseArray = new LongSparseArray();
int i2 = 0;
for (int i3 = 0; i3 < updates_channeldifference.users.size(); i3++) {
TLRPC$User tLRPC$User = (TLRPC$User) updates_channeldifference.users.get(i3);
longSparseArray.put(tLRPC$User.id, tLRPC$User);
}
int i4 = 0;
while (true) {
if (i4 >= updates_channeldifference.chats.size()) {
chat = null;
break;
}
TLRPC.Chat chat2 = (TLRPC.Chat) updates_channeldifference.chats.get(i4);
if (chat2.id == j) {
chat = chat2;
break;
}
i4++;
}
ArrayList arrayList = new ArrayList();
if (!updates_channeldifference.other_updates.isEmpty()) {
while (i2 < updates_channeldifference.other_updates.size()) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC$Update) updates_channeldifference.other_updates.get(i2);
if (tL_updateMessageID instanceof TLRPC.TL_updateMessageID) {
arrayList.add(tL_updateMessageID);
updates_channeldifference.other_updates.remove(i2);
i2--;
}
i2++;
}
}
getMessagesStorage().putUsersAndChats(updates_channeldifference.users, updates_channeldifference.chats, true, true);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda459(this, updates_channeldifference));
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda460(this, arrayList, j, updates_channeldifference, chat, longSparseArray, i, j2));
}
public static void lambda$getChannelParticipant$423(Utilities.Callback callback, TLObject tLObject, TLRPC.TL_error tL_error) {
if (callback != null) {
callback.run(tLObject instanceof TLRPC.TL_channels_channelParticipant ? ((TLRPC.TL_channels_channelParticipant) tLObject).participant : null);
}
}
public void lambda$getChannelRecommendations$432(TLObject tLObject, boolean z, long j) {
if (tLObject instanceof TLRPC.messages_Chats) {
ArrayList<TLRPC.Chat> arrayList = ((TLRPC.messages_Chats) tLObject).chats;
putChats(arrayList, false);
ChannelRecommendations channelRecommendations = new ChannelRecommendations();
channelRecommendations.wasPremium = z;
channelRecommendations.chats.addAll(arrayList);
if (tLObject instanceof TLRPC.TL_messages_chatsSlice) {
channelRecommendations.more = Math.max(0, ((TLRPC.messages_Chats) ((TLRPC.TL_messages_chatsSlice) tLObject)).count - arrayList.size());
} else if (!getUserConfig().isPremium() && BuildVars.DEBUG_PRIVATE_VERSION) {
channelRecommendations.more = 90;
}
this.cachedChannelRecommendations.put(Long.valueOf(j), channelRecommendations);
getNotificationCenter().postNotificationName(NotificationCenter.channelRecommendationsLoaded, new Object[]{Long.valueOf(j)});
return;
}
if (tLObject instanceof TLRPC.Users) {
ArrayList<TLRPC$User> arrayList2 = ((TLRPC.Users) tLObject).users;
putUsers(arrayList2, false);
ChannelRecommendations channelRecommendations2 = new ChannelRecommendations();
channelRecommendations2.wasPremium = z;
channelRecommendations2.chats.addAll(arrayList2);
if (tLObject instanceof TLRPC.TL_usersSlice) {
channelRecommendations2.more = Math.max(0, ((TLRPC.Users) ((TLRPC.TL_usersSlice) tLObject)).count - arrayList2.size());
} else if (!getUserConfig().isPremium() && BuildVars.DEBUG_PRIVATE_VERSION) {
channelRecommendations2.more = 90;
}
this.cachedChannelRecommendations.put(Long.valueOf(j), channelRecommendations2);
getNotificationCenter().postNotificationName(NotificationCenter.channelRecommendationsLoaded, new Object[]{Long.valueOf(j)});
}
}
public void lambda$getChannelRecommendations$433(boolean z, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda196(this, tLObject, z, j));
}
public void lambda$getContentSettings$452(TLObject tLObject) {
if (tLObject instanceof TL_account.contentSettings) {
this.contentSettings = (TL_account.contentSettings) tLObject;
this.contentSettingsLoadedTime = System.currentTimeMillis();
}
this.contentSettingsLoading = false;
ArrayList<Utilities.Callback<TL_account.contentSettings>> arrayList = this.contentSettingsCallbacks;
if (arrayList != null) {
Iterator<Utilities.Callback<TL_account.contentSettings>> it = arrayList.iterator();
while (it.hasNext()) {
it.next().run(this.contentSettings);
}
this.contentSettingsCallbacks.clear();
this.contentSettingsCallbacks = null;
}
}
public void lambda$getContentSettings$453(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda152(this, tLObject));
}
public void lambda$getDifference$324(TLRPC.updates_Difference updates_difference, int i, int i2) {
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
resetDialogs(true, getMessagesStorage().getLastSeqValue(), updates_difference.pts, i, i2);
getStoriesController().cleanup();
}
public void lambda$getDifference$325(TLRPC.updates_Difference updates_difference) {
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
putUsers(updates_difference.users, false);
putChats(updates_difference.chats, false);
}
public void lambda$getDifference$326(SparseArray sparseArray) {
for (int i = 0; i < sparseArray.size(); i++) {
int keyAt = sparseArray.keyAt(i);
long[] jArr = (long[]) sparseArray.valueAt(i);
getSendMessagesHelper().processSentMessage((int) jArr[1]);
NotificationCenter notificationCenter = getNotificationCenter();
int i2 = NotificationCenter.messageReceivedByServer;
Integer valueOf = Integer.valueOf((int) jArr[1]);
Integer valueOf2 = Integer.valueOf(keyAt);
Long valueOf3 = Long.valueOf(jArr[0]);
Boolean bool = Boolean.FALSE;
notificationCenter.postNotificationName(i2, new Object[]{valueOf, valueOf2, null, valueOf3, 0L, -1, bool});
getNotificationCenter().postNotificationName(NotificationCenter.messageReceivedByServer2, new Object[]{Integer.valueOf((int) jArr[1]), Integer.valueOf(keyAt), null, Long.valueOf(jArr[0]), 0L, -1, bool});
}
}
public void lambda$getDifference$327(ArrayList arrayList, TLRPC.updates_Difference updates_difference) {
getNotificationsController().processNewMessages(arrayList, !(updates_difference instanceof TLRPC.TL_updates_differenceSlice), false, (CountDownLatch) null);
}
public void lambda$getDifference$328(long j, ArrayList arrayList) {
updateInterfaceWithMessages(j, arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$getDifference$329(long j, ArrayList arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda422(this, j, arrayList));
}
public void lambda$getDifference$330(ArrayList arrayList, TLRPC.updates_Difference updates_difference, LongSparseArray longSparseArray) {
if (!arrayList.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda435(this, arrayList, updates_difference));
}
getMessagesStorage().putMessages(updates_difference.new_messages, true, false, false, getDownloadController().getAutodownloadMask(), 0, 0L);
for (int i = 0; i < longSparseArray.size(); i++) {
long keyAt = longSparseArray.keyAt(i);
ArrayList arrayList2 = (ArrayList) longSparseArray.valueAt(i);
getMediaDataController().loadReplyMessagesForMessages(arrayList2, keyAt, 0, 0L, new MessagesController$.ExternalSyntheticLambda436(this, keyAt, arrayList2), 0, (Timer) null);
}
}
public void lambda$getDifference$331(org.telegram.tgnet.TLRPC.updates_Difference r19, androidx.collection.LongSparseArray r20, androidx.collection.LongSparseArray r21) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$getDifference$331(org.telegram.tgnet.TLRPC$updates_Difference, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray):void");
}
public void lambda$getDifference$332(TLRPC.updates_Difference updates_difference, ArrayList arrayList, LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
getMessagesStorage().putUsersAndChats(updates_difference.users, updates_difference.chats, true, false);
if (!arrayList.isEmpty()) {
SparseArray sparseArray = new SparseArray();
for (int i = 0; i < arrayList.size(); i++) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC.TL_updateMessageID) arrayList.get(i);
long[] updateMessageStateAndId = getMessagesStorage().updateMessageStateAndId(tL_updateMessageID.random_id, 0L, (Integer) null, tL_updateMessageID.id, 0, false, -1, 0);
if (updateMessageStateAndId != null) {
sparseArray.put(tL_updateMessageID.id, updateMessageStateAndId);
}
}
if (sparseArray.size() != 0) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda117(this, sparseArray));
}
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda118(this, updates_difference, longSparseArray, longSparseArray2));
}
public void lambda$getDifference$333(int i, int i2, TLObject tLObject, TLRPC.TL_error tL_error) {
int i3 = 0;
if (tL_error != null) {
this.gettingDifference = false;
getConnectionsManager().setIsUpdating(false);
FileLog.d("received: isUpdating = false");
return;
}
TLRPC.updates_Difference updates_difference = (TLRPC.updates_Difference) tLObject;
if (updates_difference instanceof TLRPC.TL_updates_differenceTooLong) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda132(this, updates_difference, i, i2));
return;
}
if (updates_difference instanceof TLRPC.TL_updates_differenceSlice) {
TLRPC.TL_updates_state tL_updates_state = updates_difference.intermediate_state;
getDifference(tL_updates_state.pts, tL_updates_state.date, tL_updates_state.qts, true);
}
LongSparseArray longSparseArray = new LongSparseArray();
LongSparseArray longSparseArray2 = new LongSparseArray();
for (int i4 = 0; i4 < updates_difference.users.size(); i4++) {
TLRPC$User tLRPC$User = (TLRPC$User) updates_difference.users.get(i4);
longSparseArray.put(tLRPC$User.id, tLRPC$User);
}
for (int i5 = 0; i5 < updates_difference.chats.size(); i5++) {
TLRPC.Chat chat = (TLRPC.Chat) updates_difference.chats.get(i5);
longSparseArray2.put(chat.id, chat);
}
ArrayList arrayList = new ArrayList();
if (!updates_difference.other_updates.isEmpty()) {
while (i3 < updates_difference.other_updates.size()) {
TLRPC.TL_updateMessageID tL_updateMessageID = (TLRPC$Update) updates_difference.other_updates.get(i3);
if (tL_updateMessageID instanceof TLRPC.TL_updateMessageID) {
arrayList.add(tL_updateMessageID);
} else {
if (getUpdateType(tL_updateMessageID) == 2) {
long updateChannelId = getUpdateChannelId(tL_updateMessageID);
int i6 = this.channelsPts.get(updateChannelId);
if (i6 == 0 && (i6 = getMessagesStorage().getChannelPtsSync(updateChannelId)) != 0) {
this.channelsPts.put(updateChannelId, i6);
}
if (i6 != 0) {
if (getUpdatePts(tL_updateMessageID) > i6) {
}
}
}
i3++;
}
updates_difference.other_updates.remove(i3);
i3--;
i3++;
}
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda133(this, updates_difference));
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda134(this, updates_difference, arrayList, longSparseArray, longSparseArray2));
}
public void lambda$getGroupCall$56(TLObject tLObject, long j, Runnable runnable) {
if (tLObject != null) {
TL_phone.groupCall groupcall = (TL_phone.groupCall) tLObject;
putUsers(groupcall.users, false);
putChats(groupcall.chats, false);
ChatObject.Call call = new ChatObject.Call();
call.setCall(getAccountInstance(), j, groupcall);
this.groupCalls.put(groupcall.call.id, call);
this.groupCallsByChatId.put(j, call);
getNotificationCenter().postNotificationName(NotificationCenter.groupCallUpdated, new Object[]{Long.valueOf(j), Long.valueOf(groupcall.call.id), Boolean.FALSE});
if (runnable != null) {
runnable.run();
}
}
this.loadingGroupCalls.remove(Long.valueOf(j));
}
public void lambda$getGroupCall$57(long j, Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda325(this, tLObject, j, runnable));
}
public void lambda$getNewDeleteTask$77(LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
this.gettingNewDeleteTask = true;
getMessagesStorage().getNewTask(longSparseArray, longSparseArray2);
}
public static void lambda$getNextReactionMention$1(Consumer consumer, int i) {
consumer.accept(Integer.valueOf(i));
}
public static void lambda$getNextReactionMention$2(Consumer consumer, int i) {
consumer.accept(Integer.valueOf(i));
}
public static void lambda$getNextReactionMention$3(TLObject tLObject, TLRPC.TL_error tL_error, Consumer consumer) {
ArrayList arrayList;
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
int i = 0;
if (tL_error != null && messages_messages != null && (arrayList = messages_messages.messages) != null && !arrayList.isEmpty()) {
i = ((TLRPC.Message) messages_messages.messages.get(0)).id;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda95(consumer, i));
}
public static void lambda$getNextReactionMention$4(Consumer consumer, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda327(tLObject, tL_error, consumer));
}
public void lambda$getNextReactionMention$5(long r17, long r19, androidx.core.util.Consumer r21, int r22) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$getNextReactionMention$5(long, long, androidx.core.util.Consumer, int):void");
}
public void lambda$getSavedReactionTags$436(TLObject tLObject, long j, TLRPC.messages_SavedReactionTags messages_savedreactiontags, TLRPC.TL_messages_getSavedReactionTags tL_messages_getSavedReactionTags) {
TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags;
if (tLObject instanceof TLRPC.TL_messages_savedReactionsTags) {
tL_messages_savedReactionsTags = (TLRPC.TL_messages_savedReactionsTags) tLObject;
this.reactionTags.put(j, tL_messages_savedReactionsTags);
getNotificationCenter().postNotificationName(NotificationCenter.savedReactionTagsUpdate, new Object[]{Long.valueOf(j)});
} else {
if (!(tLObject instanceof TLRPC.TL_messages_savedReactionsTagsNotModified) || messages_savedreactiontags != null || tL_messages_getSavedReactionTags.hash != 0) {
return;
}
tL_messages_savedReactionsTags = new TLRPC.TL_messages_savedReactionsTags();
this.reactionTags.put(j, tL_messages_savedReactionsTags);
getNotificationCenter().postNotificationName(NotificationCenter.savedReactionTagsUpdate, new Object[]{Long.valueOf(j)});
}
saveSavedReactionsTags(j, tL_messages_savedReactionsTags);
}
public void lambda$getSavedReactionTags$437(long j, TLRPC.messages_SavedReactionTags messages_savedreactiontags, TLRPC.TL_messages_getSavedReactionTags tL_messages_getSavedReactionTags, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda458(this, tLObject, j, messages_savedreactiontags, tL_messages_getSavedReactionTags));
}
public void lambda$getSavedReactionTags$438(TLRPC.messages_SavedReactionTags messages_savedreactiontags, long j) {
if (this.reactionTags == null) {
this.reactionTags = new LongSparseArray();
}
boolean z = messages_savedreactiontags instanceof TLRPC.TL_messages_savedReactionsTags;
if (z) {
this.reactionTags.put(j, (TLRPC.TL_messages_savedReactionsTags) messages_savedreactiontags);
getNotificationCenter().postNotificationName(NotificationCenter.savedReactionTagsUpdate, new Object[]{Long.valueOf(j)});
}
TLRPC.TL_messages_getSavedReactionTags tL_messages_getSavedReactionTags = new TLRPC.TL_messages_getSavedReactionTags();
if (z) {
tL_messages_getSavedReactionTags.hash = messages_savedreactiontags.hash;
}
if (j != 0) {
tL_messages_getSavedReactionTags.flags = 1 | tL_messages_getSavedReactionTags.flags;
tL_messages_getSavedReactionTags.peer = getInputPeer(j);
}
getConnectionsManager().sendRequest(tL_messages_getSavedReactionTags, new MessagesController$.ExternalSyntheticLambda177(this, j, messages_savedreactiontags, tL_messages_getSavedReactionTags));
}
public void lambda$getSavedReactionTags$439(long r8) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$getSavedReactionTags$439(long):void");
}
public void lambda$getSendAsPeers$393(TLRPC.TL_channels_sendAsPeers tL_channels_sendAsPeers) {
putUsers(tL_channels_sendAsPeers.users, false);
putChats(tL_channels_sendAsPeers.chats, false);
}
public void lambda$getSendAsPeers$394(TLRPC.TL_channels_sendAsPeers tL_channels_sendAsPeers, long j, SendAsPeersInfo sendAsPeersInfo) {
if (tL_channels_sendAsPeers == null) {
this.sendAsPeers.remove(j);
return;
}
SendAsPeersInfo.access$602(sendAsPeersInfo, SystemClock.elapsedRealtime());
SendAsPeersInfo.access$402(sendAsPeersInfo, tL_channels_sendAsPeers);
getNotificationCenter().postNotificationName(NotificationCenter.didLoadSendAsPeers, new Object[]{Long.valueOf(j), tL_channels_sendAsPeers});
}
public void lambda$getSendAsPeers$395(long j, SendAsPeersInfo sendAsPeersInfo, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.TL_channels_sendAsPeers tL_channels_sendAsPeers;
if (tLObject != null) {
tL_channels_sendAsPeers = (TLRPC.TL_channels_sendAsPeers) tLObject;
if (!tL_channels_sendAsPeers.peers.isEmpty()) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda91(this, tL_channels_sendAsPeers));
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda92(this, tL_channels_sendAsPeers, j, sendAsPeersInfo));
}
}
tL_channels_sendAsPeers = null;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda92(this, tL_channels_sendAsPeers, j, sendAsPeersInfo));
}
public void lambda$getSponsoredMessages$390(TLRPC.messages_SponsoredMessages messages_sponsoredmessages) {
putUsers(messages_sponsoredmessages.users, false);
putChats(messages_sponsoredmessages.chats, false);
}
public void lambda$getSponsoredMessages$391(ArrayList arrayList, long j, SponsoredMessagesInfo sponsoredMessagesInfo, Integer num) {
if (arrayList == null) {
this.sponsoredMessages.remove(j);
return;
}
sponsoredMessagesInfo.loadTime = SystemClock.elapsedRealtime();
sponsoredMessagesInfo.loading = false;
sponsoredMessagesInfo.messages = arrayList;
sponsoredMessagesInfo.posts_between = num;
getNotificationCenter().postNotificationName(NotificationCenter.didLoadSponsoredMessages, new Object[]{Long.valueOf(j), arrayList});
}
public void lambda$getSponsoredMessages$392(long j, SponsoredMessagesInfo sponsoredMessagesInfo, TLObject tLObject, TLRPC.TL_error tL_error) {
Integer num;
ArrayList arrayList = null;
r2 = null;
Integer num2 = null;
if (tLObject instanceof TLRPC.messages_SponsoredMessages) {
TLRPC.messages_SponsoredMessages messages_sponsoredmessages = (TLRPC.messages_SponsoredMessages) tLObject;
if (!messages_sponsoredmessages.messages.isEmpty()) {
if ((messages_sponsoredmessages instanceof TLRPC.TL_messages_sponsoredMessages) && (messages_sponsoredmessages.flags & 1) > 0) {
num2 = Integer.valueOf(messages_sponsoredmessages.posts_between);
}
ArrayList arrayList2 = new ArrayList();
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda331(this, messages_sponsoredmessages));
LongSparseArray longSparseArray = new LongSparseArray();
LongSparseArray longSparseArray2 = new LongSparseArray();
int i = 0;
for (int i2 = 0; i2 < messages_sponsoredmessages.users.size(); i2++) {
TLRPC$User tLRPC$User = (TLRPC$User) messages_sponsoredmessages.users.get(i2);
longSparseArray.put(tLRPC$User.id, tLRPC$User);
}
for (int i3 = 0; i3 < messages_sponsoredmessages.chats.size(); i3++) {
TLRPC.Chat chat = (TLRPC.Chat) messages_sponsoredmessages.chats.get(i3);
longSparseArray2.put(chat.id, chat);
}
int size = messages_sponsoredmessages.messages.size();
int i4 = -10000000;
while (i < size) {
TLRPC.TL_sponsoredMessage tL_sponsoredMessage = (TLRPC.TL_sponsoredMessage) messages_sponsoredmessages.messages.get(i);
TLRPC.TL_message tL_message = new TLRPC.TL_message();
if (!tL_sponsoredMessage.entities.isEmpty()) {
((TLRPC.Message) tL_message).entities = tL_sponsoredMessage.entities;
((TLRPC.Message) tL_message).flags |= ConnectionsManager.RequestFlagNeedQuickAck;
}
((TLRPC.Message) tL_message).peer_id = getPeer(j);
((TLRPC.Message) tL_message).flags |= 256;
((TLRPC.Message) tL_message).date = getConnectionsManager().getCurrentTime();
int i5 = i4 - 1;
((TLRPC.Message) tL_message).id = i4;
((TLRPC.Message) tL_message).message = tL_sponsoredMessage.message;
TLRPC.MessageMedia messageMedia = tL_sponsoredMessage.media;
if (messageMedia != null) {
((TLRPC.Message) tL_message).flags |= 512;
}
((TLRPC.Message) tL_message).media = messageMedia;
MessageObject messageObject = new MessageObject(this.currentAccount, tL_message, longSparseArray, longSparseArray2, true, true);
messageObject.sponsoredId = tL_sponsoredMessage.random_id;
messageObject.sponsoredTitle = tL_sponsoredMessage.title;
messageObject.sponsoredUrl = tL_sponsoredMessage.url;
messageObject.sponsoredRecommended = tL_sponsoredMessage.recommended;
messageObject.sponsoredPhoto = tL_sponsoredMessage.photo;
messageObject.sponsoredInfo = tL_sponsoredMessage.sponsor_info;
messageObject.sponsoredAdditionalInfo = tL_sponsoredMessage.additional_info;
messageObject.sponsoredButtonText = tL_sponsoredMessage.button_text;
messageObject.sponsoredCanReport = tL_sponsoredMessage.can_report;
messageObject.sponsoredColor = tL_sponsoredMessage.color;
messageObject.sponsoredMedia = tL_sponsoredMessage.media;
messageObject.setType();
messageObject.textLayoutBlocks = new ArrayList();
messageObject.generateThumbs(true);
arrayList2.add(messageObject);
i++;
messages_sponsoredmessages = messages_sponsoredmessages;
i4 = i5;
}
num = num2;
arrayList = arrayList2;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda332(this, arrayList, j, sponsoredMessagesInfo, num));
}
}
num = null;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda332(this, arrayList, j, sponsoredMessagesInfo, num));
}
public static void lambda$hidePeerSettingsBar$69(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public static void lambda$hidePromoDialog$125(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$hidePromoDialog$126() {
this.promoDialogId = 0L;
this.proxyDialogAddress = null;
this.nextPromoInfoCheckTime = getConnectionsManager().getCurrentTime() + 3600;
getGlobalMainSettings().edit().putLong("proxy_dialog", this.promoDialogId).remove("proxyDialogAddress").putInt("nextPromoInfoCheckTime", this.nextPromoInfoCheckTime).commit();
}
public static void lambda$installTheme$112(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public static void lambda$installTheme$113(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$loadAppConfig$29(TLRPC.TL_help_appConfig tL_help_appConfig) {
if (tL_help_appConfig != null) {
TLRPC.JSONValue jSONValue = tL_help_appConfig.config;
if (jSONValue instanceof TLRPC.TL_jsonObject) {
applyAppConfig((TLRPC.TL_jsonObject) jSONValue);
}
}
AndroidUtilities.cancelRunOnUIThread(this.loadAppConfigRunnable);
AndroidUtilities.runOnUIThread(this.loadAppConfigRunnable, 240010L);
}
public void lambda$loadAppConfig$30(TLRPC.TL_help_appConfig tL_help_appConfig) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda399(this, tL_help_appConfig));
}
public void lambda$loadChannelAdmins$59(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof TLRPC.TL_channels_channelParticipants) {
processLoadedAdminsResponse(j, (TLRPC.TL_channels_channelParticipants) tLObject);
}
}
public void lambda$loadChannelParticipants$138(TLRPC.TL_error tL_error, TLObject tLObject, Long l, Utilities.Callback callback) {
if (tL_error == null) {
TLRPC.TL_channels_channelParticipants tL_channels_channelParticipants = (TLRPC.TL_channels_channelParticipants) tLObject;
putUsers(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).users, false);
putChats(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).chats, false);
getMessagesStorage().putUsersAndChats(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).users, ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).chats, true, true);
getMessagesStorage().updateChannelUsers(l.longValue(), ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants);
this.loadedFullParticipants.add(l);
}
this.loadingFullParticipants.remove(l);
if (callback != null) {
callback.run(tLObject instanceof TLRPC.TL_channels_channelParticipants ? (TLRPC.TL_channels_channelParticipants) tLObject : null);
}
}
public void lambda$loadChannelParticipants$139(Long l, Utilities.Callback callback, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda130(this, tL_error, tLObject, l, callback));
}
public void lambda$loadCurrentState$299(TLObject tLObject, TLRPC.TL_error tL_error) {
this.updatingState = false;
if (tL_error != null) {
if (tL_error.code != 401) {
loadCurrentState();
return;
}
return;
}
TLRPC.TL_updates_state tL_updates_state = (TLRPC.TL_updates_state) tLObject;
getMessagesStorage().setLastDateValue(tL_updates_state.date);
getMessagesStorage().setLastPtsValue(tL_updates_state.pts);
getMessagesStorage().setLastSeqValue(tL_updates_state.seq);
getMessagesStorage().setLastQtsValue(tL_updates_state.qts);
for (int i = 0; i < 3; i++) {
processUpdatesQueue(i, 2);
}
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
}
public void lambda$loadDialogs$187(int i, int i2, Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.messages_Dialogs messages_dialogs = (TLRPC.messages_Dialogs) tLObject;
processLoadedDialogs(messages_dialogs, null, null, i, 0, i2, 0, false, false, false);
if (runnable == null || !messages_dialogs.dialogs.isEmpty()) {
return;
}
AndroidUtilities.runOnUIThread(runnable);
}
}
public void lambda$loadFilterPeers$17(HashMap hashMap, TLRPC.messages_Dialogs messages_dialogs, TLRPC.messages_Dialogs messages_dialogs2, ArrayList arrayList, ArrayList arrayList2, ArrayList arrayList3, SparseArray sparseArray, ArrayList arrayList4, HashMap hashMap2, HashSet hashSet, Runnable runnable, HashMap hashMap3, HashMap hashMap4) {
TLRPC.TL_users_getUsers tL_users_getUsers;
int i;
TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs;
TLRPC.TL_messages_getChats tL_messages_getChats;
TLRPC.TL_channels_getChannels tL_channels_getChannels;
ArrayList<TLObject> arrayList5 = new ArrayList<>();
loop0: while (true) {
tL_users_getUsers = null;
for (Map.Entry entry : hashMap.entrySet()) {
if (tL_users_getUsers == null) {
tL_users_getUsers = new TLRPC.TL_users_getUsers();
arrayList5.add(tL_users_getUsers);
}
tL_users_getUsers.id.add(getInputUser((TLRPC.InputPeer) entry.getValue()));
if (tL_users_getUsers.id.size() == 100) {
break;
}
}
sendLoadPeersRequest(tL_users_getUsers, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
}
if (tL_users_getUsers != null) {
i = 100;
sendLoadPeersRequest(tL_users_getUsers, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
} else {
i = 100;
}
TLRPC.TL_messages_getChats tL_messages_getChats2 = null;
TLRPC.TL_channels_getChannels tL_channels_getChannels2 = null;
for (Map.Entry entry2 : hashMap3.entrySet()) {
TLRPC.InputPeer inputPeer = (TLRPC.InputPeer) entry2.getValue();
if (inputPeer.chat_id != 0) {
if (tL_messages_getChats2 == null) {
tL_messages_getChats = new TLRPC.TL_messages_getChats();
arrayList5.add(tL_messages_getChats);
} else {
tL_messages_getChats = tL_messages_getChats2;
}
tL_messages_getChats.id.add((Long) entry2.getKey());
if (tL_messages_getChats.id.size() == i) {
sendLoadPeersRequest(tL_messages_getChats, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
tL_messages_getChats2 = null;
} else {
tL_messages_getChats2 = tL_messages_getChats;
}
} else if (inputPeer.channel_id != 0) {
if (tL_channels_getChannels2 == null) {
TLRPC.TL_channels_getChannels tL_channels_getChannels3 = new TLRPC.TL_channels_getChannels();
arrayList5.add(tL_channels_getChannels3);
tL_channels_getChannels = tL_channels_getChannels3;
} else {
tL_channels_getChannels = tL_channels_getChannels2;
}
tL_channels_getChannels.id.add(getInputChannel(inputPeer));
if (tL_channels_getChannels.id.size() == i) {
sendLoadPeersRequest(tL_channels_getChannels, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
tL_channels_getChannels2 = null;
} else {
tL_channels_getChannels2 = tL_channels_getChannels;
}
}
}
if (tL_messages_getChats2 != null) {
sendLoadPeersRequest(tL_messages_getChats2, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
}
if (tL_channels_getChannels2 != null) {
sendLoadPeersRequest(tL_channels_getChannels2, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
}
loop3: while (true) {
tL_messages_getPeerDialogs = null;
for (Map.Entry entry3 : hashMap4.entrySet()) {
if (tL_messages_getPeerDialogs == null) {
tL_messages_getPeerDialogs = new TLRPC.TL_messages_getPeerDialogs();
arrayList5.add(tL_messages_getPeerDialogs);
}
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = (TLRPC.InputPeer) entry3.getValue();
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer);
if (tL_messages_getPeerDialogs.peers.size() == i) {
break;
}
}
sendLoadPeersRequest(tL_messages_getPeerDialogs, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
}
if (tL_messages_getPeerDialogs != null) {
sendLoadPeersRequest(tL_messages_getPeerDialogs, arrayList5, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap2, hashSet, runnable);
}
}
public void lambda$loadFullChat$61(long j, TLRPC.TL_messages_chatFull tL_messages_chatFull, int i, long j2) {
TLRPC.ChatFull chatFull = (TLRPC.ChatFull) this.fullChats.get(j);
if (chatFull != null) {
tL_messages_chatFull.full_chat.inviterId = chatFull.inviterId;
}
this.fullChats.put(j, tL_messages_chatFull.full_chat);
long j3 = -j;
getTranslateController().updateDialogFull(j3);
applyDialogNotificationsSettings(j3, 0L, tL_messages_chatFull.full_chat.notify_settings);
for (int i2 = 0; i2 < tL_messages_chatFull.full_chat.bot_info.size(); i2++) {
getMediaDataController().putBotInfo(j3, (TL_bots.BotInfo) tL_messages_chatFull.full_chat.bot_info.get(i2));
}
int indexOfKey = this.blockePeers.indexOfKey(j3);
if (tL_messages_chatFull.full_chat.blocked) {
if (indexOfKey < 0) {
this.blockePeers.put(j3, 1);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
} else if (indexOfKey >= 0) {
this.blockePeers.removeAt(indexOfKey);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
this.exportedChats.put(j, tL_messages_chatFull.full_chat.exported_invite);
this.loadingFullChats.remove(Long.valueOf(j));
this.loadedFullChats.put(j, System.currentTimeMillis());
putUsers(tL_messages_chatFull.users, false);
putChats(tL_messages_chatFull.chats, false);
if (tL_messages_chatFull.full_chat.stickerset != null) {
getMediaDataController().getGroupStickerSetById(tL_messages_chatFull.full_chat.stickerset);
}
if (tL_messages_chatFull.full_chat.emojiset != null) {
getMediaDataController().getGroupStickerSetById(tL_messages_chatFull.full_chat.emojiset);
}
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, new Object[]{tL_messages_chatFull.full_chat, Integer.valueOf(i), Boolean.FALSE, Boolean.TRUE});
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j3);
if (dialog != null) {
TLRPC.ChatFull chatFull2 = tL_messages_chatFull.full_chat;
if ((chatFull2.flags & ConnectionsManager.RequestFlagListenAfterCancel) != 0) {
int i3 = dialog.folder_id;
int i4 = chatFull2.folder_id;
if (i3 != i4) {
dialog.folder_id = i4;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
int i5 = dialog.ttl_period;
int i6 = tL_messages_chatFull.full_chat.ttl_period;
if (i5 != i6) {
dialog.ttl_period = i6;
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
boolean z = dialog.view_forum_as_messages;
boolean z2 = tL_messages_chatFull.full_chat.view_forum_as_messages;
if (z != z2) {
dialog.view_forum_as_messages = z2;
getMessagesStorage().setDialogViewThreadAsMessages(j2, tL_messages_chatFull.full_chat.view_forum_as_messages);
}
}
}
public void lambda$loadFullChat$62(TLRPC.TL_error tL_error, long j) {
checkChannelError(tL_error.text, j);
this.loadingFullChats.remove(Long.valueOf(j));
}
public void lambda$loadFullChat$63(long j, long j2, TLRPC.Chat chat, int i, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda41(this, tL_error, j2));
return;
}
TLRPC.TL_messages_chatFull tL_messages_chatFull = (TLRPC.TL_messages_chatFull) tLObject;
getMessagesStorage().putUsersAndChats(tL_messages_chatFull.users, tL_messages_chatFull.chats, true, true);
getMessagesStorage().updateChatInfo(tL_messages_chatFull.full_chat, false);
getStoriesController().updateStoriesFromFullPeer(j, tL_messages_chatFull.full_chat.stories);
ChatThemeController.getInstance(this.currentAccount).saveChatWallpaper(-j2, tL_messages_chatFull.full_chat.wallpaper);
if (ChatObject.isChannel(chat)) {
Integer num = (Integer) this.dialogs_read_inbox_max.get(Long.valueOf(j));
if (num == null) {
num = Integer.valueOf(getMessagesStorage().getDialogReadMax(false, j));
}
this.dialogs_read_inbox_max.put(Long.valueOf(j), Integer.valueOf(Math.max(tL_messages_chatFull.full_chat.read_inbox_max_id, num.intValue())));
if (tL_messages_chatFull.full_chat.read_inbox_max_id > num.intValue()) {
ArrayList<TLRPC$Update> arrayList = new ArrayList<>();
TLRPC.TL_updateReadChannelInbox tL_updateReadChannelInbox = new TLRPC.TL_updateReadChannelInbox();
tL_updateReadChannelInbox.channel_id = j2;
TLRPC.ChatFull chatFull = tL_messages_chatFull.full_chat;
tL_updateReadChannelInbox.max_id = chatFull.read_inbox_max_id;
tL_updateReadChannelInbox.still_unread_count = chatFull.unread_count;
arrayList.add(tL_updateReadChannelInbox);
processUpdateArray(arrayList, null, null, false, 0);
}
Integer num2 = (Integer) this.dialogs_read_outbox_max.get(Long.valueOf(j));
if (num2 == null) {
num2 = Integer.valueOf(getMessagesStorage().getDialogReadMax(true, j));
}
this.dialogs_read_outbox_max.put(Long.valueOf(j), Integer.valueOf(Math.max(tL_messages_chatFull.full_chat.read_outbox_max_id, num2.intValue())));
if (tL_messages_chatFull.full_chat.read_outbox_max_id > num2.intValue()) {
ArrayList<TLRPC$Update> arrayList2 = new ArrayList<>();
TLRPC.TL_updateReadChannelOutbox tL_updateReadChannelOutbox = new TLRPC.TL_updateReadChannelOutbox();
tL_updateReadChannelOutbox.channel_id = j2;
tL_updateReadChannelOutbox.max_id = tL_messages_chatFull.full_chat.read_outbox_max_id;
arrayList2.add(tL_updateReadChannelOutbox);
processUpdateArray(arrayList2, null, null, false, 0);
}
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda40(this, j2, tL_messages_chatFull, i, j));
}
public void lambda$loadFullUser$64(TLRPC.UserFull userFull, TLRPC$User tLRPC$User, int i) {
savePeerSettings(userFull.user.id, userFull.settings, false);
applyDialogNotificationsSettings(tLRPC$User.id, 0L, userFull.notify_settings);
TL_bots.BotInfo botInfo = userFull.bot_info;
if (botInfo instanceof TL_bots.TL_botInfo) {
botInfo.user_id = tLRPC$User.id;
getMediaDataController().putBotInfo(tLRPC$User.id, userFull.bot_info);
}
int indexOfKey = this.blockePeers.indexOfKey(tLRPC$User.id);
if (userFull.blocked) {
if (indexOfKey < 0) {
this.blockePeers.put(tLRPC$User.id, 1);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
} else if (indexOfKey >= 0) {
this.blockePeers.removeAt(indexOfKey);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
this.fullUsers.put(tLRPC$User.id, userFull);
getTranslateController().updateDialogFull(tLRPC$User.id);
StarsController.getInstance(this.currentAccount).invalidateProfileGifts(userFull);
this.loadingFullUsers.remove(Long.valueOf(tLRPC$User.id));
this.loadedFullUsers.put(tLRPC$User.id, System.currentTimeMillis());
String str = tLRPC$User.first_name + tLRPC$User.last_name + UserObject.getPublicUsername(tLRPC$User);
ArrayList<TLRPC$User> arrayList = new ArrayList<>();
arrayList.add(userFull.user);
putUsers(arrayList, false);
getMessagesStorage().putUsersAndChats(arrayList, (List) null, false, true);
if (!str.equals(userFull.user.first_name + userFull.user.last_name + UserObject.getPublicUsername(userFull.user))) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_NAME)});
}
TLRPC.UserProfilePhoto userProfilePhoto = userFull.user.photo;
if (userProfilePhoto != null && userProfilePhoto.has_video) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_AVATAR)});
}
TL_bots.BotInfo botInfo2 = userFull.bot_info;
if (botInfo2 instanceof TL_bots.TL_botInfo) {
botInfo2.user_id = userFull.id;
getNotificationCenter().postNotificationName(NotificationCenter.botInfoDidLoad, new Object[]{userFull.bot_info, Integer.valueOf(i)});
}
getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, new Object[]{Long.valueOf(tLRPC$User.id), userFull});
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(tLRPC$User.id);
if (dialog != null) {
if ((userFull.flags & ConnectionsManager.RequestFlagListenAfterCancel) != 0) {
int i2 = dialog.folder_id;
int i3 = userFull.folder_id;
if (i2 != i3) {
dialog.folder_id = i3;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
if ((userFull.flags & 16384) != 0) {
int i4 = dialog.ttl_period;
int i5 = userFull.ttl_period;
if (i4 != i5) {
dialog.ttl_period = i5;
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
}
}
public void lambda$loadFullUser$65(TLRPC$User tLRPC$User) {
this.loadingFullUsers.remove(Long.valueOf(tLRPC$User.id));
}
public void lambda$loadFullUser$66(long j, Utilities.Callback callback, TLRPC$User tLRPC$User, int i, TLObject tLObject, TLRPC.TL_error tL_error) {
MessagesController$.ExternalSyntheticLambda340 externalSyntheticLambda341;
if (tL_error == null) {
TLRPC.TL_users_userFull tL_users_userFull = (TLRPC.TL_users_userFull) tLObject;
TLRPC.UserFull userFull = tL_users_userFull.full_user;
putUsers(tL_users_userFull.users, false);
putChats(tL_users_userFull.chats, false);
TLRPC.UserFull userFull2 = tL_users_userFull.full_user;
userFull2.user = getUser(Long.valueOf(userFull2.id));
getMessagesStorage().updateUserInfo(userFull, false);
getStoriesController().updateStoriesFromFullPeer(j, userFull.stories);
ChatThemeController chatThemeController = ChatThemeController.getInstance(this.currentAccount);
TLRPC.UserFull userFull3 = tL_users_userFull.full_user;
chatThemeController.saveChatWallpaper(userFull3.id, userFull3.wallpaper);
if (callback != null) {
callback.run(userFull);
}
externalSyntheticLambda341 = new MessagesController$.ExternalSyntheticLambda340(this, userFull, tLRPC$User, i);
} else {
externalSyntheticLambda341 = new MessagesController$.ExternalSyntheticLambda341(this, tLRPC$User);
}
AndroidUtilities.runOnUIThread(externalSyntheticLambda341);
}
public void lambda$loadGlobalNotificationsSettings$188(org.telegram.tgnet.TLObject r12, int r13) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$loadGlobalNotificationsSettings$188(org.telegram.tgnet.TLObject, int):void");
}
public void lambda$loadGlobalNotificationsSettings$189(int i, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda476(this, tLObject, i));
}
public void lambda$loadGlobalNotificationsSettings$190(TLObject tLObject) {
this.loadingNotificationSettings--;
if (tLObject instanceof TL_account.TL_reactionsNotifySettings) {
TL_account.TL_reactionsNotifySettings tL_reactionsNotifySettings = (TL_account.TL_reactionsNotifySettings) tLObject;
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
edit.putBoolean("EnableReactionsMessages", tL_reactionsNotifySettings.messages_notify_from != null);
TL_account.ReactionNotificationsFrom reactionNotificationsFrom = tL_reactionsNotifySettings.messages_notify_from;
if (reactionNotificationsFrom != null) {
edit.putBoolean("EnableReactionsMessagesContacts", reactionNotificationsFrom instanceof TL_account.TL_reactionNotificationsFromContacts);
}
edit.putBoolean("EnableReactionsStories", tL_reactionsNotifySettings.stories_notify_from != null);
TL_account.ReactionNotificationsFrom reactionNotificationsFrom2 = tL_reactionsNotifySettings.stories_notify_from;
if (reactionNotificationsFrom2 != null) {
edit.putBoolean("EnableReactionsStoriesContacts", reactionNotificationsFrom2 instanceof TL_account.TL_reactionNotificationsFromContacts);
}
edit.putBoolean("EnableReactionsPreview", tL_reactionsNotifySettings.show_previews);
getNotificationsController().getNotificationsSettingsFacade().applySoundSettings(tL_reactionsNotifySettings.sound, edit, 0L, 0L, 4, false);
edit.apply();
}
if (this.loadingNotificationSettings == 0) {
getUserConfig().notificationsSettingsLoaded = true;
getUserConfig().saveConfig(false);
}
}
public void lambda$loadGlobalNotificationsSettings$191(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda206(this, tLObject));
}
public void lambda$loadHintDialogs$183(TLObject tLObject) {
TLRPC.TL_help_recentMeUrls tL_help_recentMeUrls = (TLRPC.TL_help_recentMeUrls) tLObject;
putUsers(tL_help_recentMeUrls.users, false);
putChats(tL_help_recentMeUrls.chats, false);
this.hintDialogs.clear();
this.hintDialogs.addAll(tL_help_recentMeUrls.urls);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$loadHintDialogs$184(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda163(this, tLObject));
}
}
public void lambda$loadMessagesInternal$165(long j, long j2, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, long j3, int i11, boolean z, int i12, boolean z2, boolean z3, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
if (messages_messages instanceof TLRPC.TL_messages_messagesNotModified) {
return;
}
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i2, i3, false, i4, i5, i6, i7, i8, i9, false, i10, j3, i11, z, i12, z2, z3, null);
return;
}
if (tL_error == null || !"SHORTCUT_INVALID".equals(tL_error.text)) {
return;
}
processLoadedMessages(new TLRPC.TL_messages_messages(), 0, j, j2, i, i2, i3, false, i4, i5, i6, i7, i8, i9, false, i10, j3, i11, z, i12, z2, z3, null);
}
public void lambda$loadMessagesInternal$166(int i, TLRPC.TL_messages_getSavedHistory tL_messages_getSavedHistory, TLRPC.TL_error tL_error) {
getNotificationCenter().postNotificationName(NotificationCenter.loadingMessagesFailed, new Object[]{Integer.valueOf(i), tL_messages_getSavedHistory, tL_error});
}
public void lambda$loadMessagesInternal$167(long j, int i, int i2, int i3, long j2, int i4, int i5, int i6, int i7, int i8, int i9, int i10, long j3, int i11, boolean z, int i12, boolean z2, boolean z3, TLRPC.TL_messages_getSavedHistory tL_messages_getSavedHistory, TLObject tLObject, TLRPC.TL_error tL_error) {
int i13;
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda339(this, i4, tL_messages_getSavedHistory, tL_error));
return;
}
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
removeDeletedMessagesFromArray(j, messages_messages.messages);
if (messages_messages.messages.size() > i) {
messages_messages.messages.remove(0);
}
if (i3 == 0 || messages_messages.messages.isEmpty()) {
i13 = i2;
} else {
int i14 = ((TLRPC.Message) messages_messages.messages.get(r0.size() - 1)).id;
int size = messages_messages.messages.size() - 1;
while (true) {
if (size < 0) {
break;
}
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(size);
if (message.date > i3) {
i14 = message.id;
break;
}
size--;
}
i13 = i14;
}
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i13, i3, false, i4, i5, i6, i7, i8, i9, false, i10, j3, i11, z, i12, z2, z3, null);
}
public void lambda$loadMessagesInternal$168(int i, TLRPC.TL_messages_getReplies tL_messages_getReplies, TLRPC.TL_error tL_error) {
getNotificationCenter().postNotificationName(NotificationCenter.loadingMessagesFailed, new Object[]{Integer.valueOf(i), tL_messages_getReplies, tL_error});
}
public void lambda$loadMessagesInternal$169(int i, int i2, int i3, int i4, int i5, long j, long j2, int i6, int i7, int i8, int i9, int i10, long j3, int i11, boolean z, int i12, boolean z2, boolean z3, TLRPC.TL_messages_getReplies tL_messages_getReplies, TLObject tLObject, TLRPC.TL_error tL_error) {
int i13;
int i14;
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda253(this, i6, tL_messages_getReplies, tL_error));
return;
}
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
if (messages_messages.messages.size() > i) {
messages_messages.messages.remove(0);
}
if (!messages_messages.messages.isEmpty()) {
if (i3 != 0) {
int i15 = ((TLRPC.Message) messages_messages.messages.get(r0.size() - 1)).id;
int size = messages_messages.messages.size() - 1;
while (true) {
if (size < 0) {
break;
}
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(size);
if (message.date > i3) {
i15 = message.id;
break;
}
size--;
}
i13 = i15;
i14 = 0;
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i13, i3, false, i6, i14, i7, i8, i9, i5, false, i10, j3, i11, z, i12, z2, z3, null);
}
if (i4 != 0) {
if (i5 == 2 && i2 > 0) {
for (int size2 = messages_messages.messages.size() - 1; size2 >= 0; size2--) {
TLRPC.Message message2 = (TLRPC.Message) messages_messages.messages.get(size2);
int i16 = message2.id;
if (i16 > i4 && !message2.out) {
i13 = i2;
i14 = i16;
break;
}
}
}
i13 = i2;
i14 = 0;
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i13, i3, false, i6, i14, i7, i8, i9, i5, false, i10, j3, i11, z, i12, z2, z3, null);
}
}
i13 = i2;
i14 = 0;
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i13, i3, false, i6, i14, i7, i8, i9, i5, false, i10, j3, i11, z, i12, z2, z3, null);
}
public void lambda$loadMessagesInternal$170(int i, int i2, long j, long j2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, long j3, int i11, boolean z, int i12, boolean z2, boolean z3, TLObject tLObject, TLRPC.TL_error tL_error) {
int i13;
if (tLObject != null) {
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
if (messages_messages instanceof TLRPC.TL_messages_messagesNotModified) {
return;
}
if (i2 == 0 || messages_messages.messages.isEmpty()) {
i13 = i;
} else {
int i14 = ((TLRPC.Message) messages_messages.messages.get(r0.size() - 1)).id;
int size = messages_messages.messages.size() - 1;
while (true) {
if (size < 0) {
break;
}
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(size);
if (message.date > i2) {
i14 = message.id;
break;
}
size--;
}
i13 = i14;
}
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i3, i13, i2, false, i4, i5, i6, i7, i8, i9, false, i10, j3, i11, z, i12, z2, z3, null);
}
}
public void lambda$loadMessagesInternal$171(int i, TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs, TLRPC.TL_error tL_error) {
getNotificationCenter().postNotificationName(NotificationCenter.loadingMessagesFailed, new Object[]{Integer.valueOf(i), tL_messages_getPeerDialogs, tL_error});
}
public void lambda$loadMessagesInternal$172(long j, long j2, boolean z, int i, int i2, int i3, int i4, int i5, int i6, long j3, int i7, int i8, int i9, boolean z2, boolean z3, boolean z4, TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda65(this, i5, tL_messages_getPeerDialogs, tL_error));
return;
}
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
if (!tL_messages_peerDialogs.dialogs.isEmpty()) {
TLRPC.Dialog dialog = (TLRPC.Dialog) tL_messages_peerDialogs.dialogs.get(0);
if (dialog.top_message != 0) {
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
((TLRPC.messages_Dialogs) tL_messages_dialogs).chats = tL_messages_peerDialogs.chats;
((TLRPC.messages_Dialogs) tL_messages_dialogs).users = tL_messages_peerDialogs.users;
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs = tL_messages_peerDialogs.dialogs;
((TLRPC.messages_Dialogs) tL_messages_dialogs).messages = tL_messages_peerDialogs.messages;
getMessagesStorage().putDialogs(tL_messages_dialogs, 2);
}
loadMessagesInternal(j, j2, z, i, i2, i3, false, i4, i5, i6, dialog.top_message, 0, j3, i7, i8, dialog.unread_count, i9, z2, dialog.unread_mentions_count, false, z3, z4, null, 0L);
}
}
public void lambda$loadMessagesInternal$173(int i, TLRPC.TL_messages_getHistory tL_messages_getHistory, TLRPC.TL_error tL_error) {
getNotificationCenter().postNotificationName(NotificationCenter.loadingMessagesFailed, new Object[]{Integer.valueOf(i), tL_messages_getHistory, tL_error});
}
public void lambda$loadMessagesInternal$174(long j, int i, int i2, int i3, long j2, int i4, int i5, int i6, int i7, int i8, int i9, int i10, long j3, int i11, boolean z, int i12, boolean z2, boolean z3, TLRPC.TL_messages_getHistory tL_messages_getHistory, TLObject tLObject, TLRPC.TL_error tL_error) {
int i13;
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda61(this, i4, tL_messages_getHistory, tL_error));
return;
}
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
removeDeletedMessagesFromArray(j, messages_messages.messages);
if (messages_messages.messages.size() > i) {
messages_messages.messages.remove(0);
}
if (i3 == 0 || messages_messages.messages.isEmpty()) {
i13 = i2;
} else {
int i14 = ((TLRPC.Message) messages_messages.messages.get(r0.size() - 1)).id;
int size = messages_messages.messages.size() - 1;
while (true) {
if (size < 0) {
break;
}
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(size);
if (message.date > i3) {
i14 = message.id;
break;
}
size--;
}
i13 = i14;
}
processLoadedMessages(messages_messages, messages_messages.messages.size(), j, j2, i, i13, i3, false, i4, i5, i6, i7, i8, i9, false, i10, j3, i11, z, i12, z2, z3, null);
}
public void lambda$loadPeerSettings$73(long j, TLObject tLObject) {
this.loadingPeerSettings.remove(j);
if (tLObject != null) {
TLRPC.TL_messages_peerSettings tL_messages_peerSettings = (TLRPC.TL_messages_peerSettings) tLObject;
TLRPC.PeerSettings peerSettings = tL_messages_peerSettings.settings;
putUsers(tL_messages_peerSettings.users, false);
putChats(tL_messages_peerSettings.chats, false);
savePeerSettings(j, peerSettings, false);
}
}
public void lambda$loadPeerSettings$74(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda322(this, j, tLObject));
}
public void lambda$loadPinnedDialogs$339(int i, ArrayList arrayList, boolean z, TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, LongSparseArray longSparseArray, TLRPC.TL_messages_dialogs tL_messages_dialogs) {
boolean z2;
boolean z3;
boolean z4;
ArrayList arrayList2;
ArrayList arrayList3;
this.loadingPinnedDialogs.delete(i);
applyDialogsNotificationsSettings(arrayList);
ArrayList<TLRPC.Dialog> dialogs = getDialogs(i);
int i2 = z ? 1 : 0;
int i3 = 0;
int i4 = 0;
boolean z5 = false;
while (true) {
z2 = true;
if (i3 >= dialogs.size()) {
break;
}
TLRPC.Dialog dialog = dialogs.get(i3);
if (!(dialog instanceof TLRPC.TL_dialogFolder)) {
if (!DialogObject.isEncryptedDialog(dialog.id)) {
if (!dialog.pinned) {
if (dialog.id != this.promoDialogId) {
break;
}
} else {
i4 = Math.max(dialog.pinnedNum, i4);
dialog.pinned = false;
dialog.pinnedNum = 0;
i2++;
z5 = true;
}
} else {
if (i2 < arrayList.size()) {
arrayList.add(i2, dialog);
} else {
arrayList.add(dialog);
}
i2++;
}
}
i3++;
}
ArrayList arrayList4 = new ArrayList();
if (arrayList.isEmpty()) {
z3 = false;
} else {
putUsers(tL_messages_peerDialogs.users, false);
putChats(tL_messages_peerDialogs.chats, false);
ArrayList arrayList5 = new ArrayList();
ArrayList arrayList6 = new ArrayList();
int size = arrayList.size();
int i5 = 0;
z3 = false;
while (i5 < size) {
TLRPC.Dialog dialog2 = (TLRPC.Dialog) arrayList.get(i5);
dialog2.pinnedNum = (size - i5) + i4;
arrayList4.add(Long.valueOf(dialog2.id));
TLRPC.Dialog dialog3 = (TLRPC.Dialog) this.dialogs_dict.get(dialog2.id);
if (dialog3 != null) {
dialog3.pinned = z2;
dialog3.pinnedNum = dialog2.pinnedNum;
arrayList5.add(Long.valueOf(dialog2.id));
arrayList6.add(Integer.valueOf(dialog2.pinnedNum));
arrayList2 = arrayList6;
} else {
this.dialogs_dict.put(dialog2.id, dialog2);
ArrayList arrayList7 = (ArrayList) longSparseArray.get(dialog2.id);
arrayList2 = arrayList6;
this.dialogMessage.put(dialog2.id, arrayList7);
if (arrayList7 != null) {
int i6 = 0;
while (i6 < arrayList7.size()) {
MessageObject messageObject = (MessageObject) arrayList7.get(i6);
if (messageObject != null) {
arrayList3 = arrayList7;
if (messageObject.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
this.dialogsLoadedTillDate = Math.min(this.dialogsLoadedTillDate, messageObject.messageOwner.date);
long j = messageObject.messageOwner.random_id;
if (j != 0) {
this.dialogMessagesByRandomIds.put(j, messageObject);
}
}
} else {
arrayList3 = arrayList7;
}
i6++;
arrayList7 = arrayList3;
}
}
getTranslateController().checkDialogMessage(dialog2.id);
z3 = true;
}
i5++;
arrayList6 = arrayList2;
z5 = true;
z2 = true;
}
getMessagesStorage().setDialogsPinned(arrayList5, arrayList6);
}
if (z5) {
if (z3) {
this.allDialogs.clear();
int size2 = this.dialogs_dict.size();
for (int i7 = 0; i7 < size2; i7++) {
TLRPC.Dialog dialog4 = (TLRPC.Dialog) this.dialogs_dict.valueAt(i7);
if (this.deletingDialogs.indexOfKey(dialog4.id) < 0) {
this.allDialogs.add(dialog4);
}
}
}
sortDialogs(null);
z4 = false;
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
} else {
z4 = false;
}
getMessagesStorage().unpinAllDialogsExceptNew(arrayList4, i);
getMessagesStorage().putDialogs(tL_messages_dialogs, 1);
getUserConfig().setPinnedDialogsLoaded(i, true);
getUserConfig().saveConfig(z4);
}
public void lambda$loadPinnedDialogs$340(int i, ArrayList arrayList, boolean z, TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs, LongSparseArray longSparseArray, TLRPC.TL_messages_dialogs tL_messages_dialogs) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda126(this, i, arrayList, z, tL_messages_peerDialogs, longSparseArray, tL_messages_dialogs));
}
public void lambda$loadPinnedDialogs$341(int r19, org.telegram.tgnet.TLObject r20, org.telegram.tgnet.TLRPC.TL_error r21) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$loadPinnedDialogs$341(int, org.telegram.tgnet.TLObject, org.telegram.tgnet.TLRPC$TL_error):void");
}
public void lambda$loadRemoteFilters$23() {
Utilities.Callback<Boolean> callback = this.onLoadedRemoteFilters;
if (callback != null) {
callback.run(Boolean.TRUE);
this.onLoadedRemoteFilters = null;
}
}
public void lambda$loadRemoteFilters$24() {
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
}
public void lambda$loadRemoteFilters$25() {
Utilities.Callback<Boolean> callback = this.onLoadedRemoteFilters;
if (callback != null) {
callback.run(Boolean.TRUE);
this.onLoadedRemoteFilters = null;
}
}
public void lambda$loadRemoteFilters$26() {
this.loadingRemoteFilters = false;
Utilities.Callback<Boolean> callback = this.onLoadedRemoteFilters;
if (callback != null) {
callback.run(Boolean.FALSE);
this.onLoadedRemoteFilters = null;
}
}
public void lambda$loadRemoteFilters$27(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof Vector) {
ArrayList arrayList = new ArrayList();
Vector vector = (Vector) tLObject;
for (int i = 0; i < vector.objects.size(); i++) {
arrayList.add((TLRPC.DialogFilter) vector.objects.get(i));
}
getMessagesStorage().checkLoadedRemoteFilters(arrayList, new MessagesController$.ExternalSyntheticLambda366(this));
return;
}
if (!(tLObject instanceof TLRPC.TL_messages_dialogFilters)) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda369(this));
return;
}
TLRPC.TL_messages_dialogFilters tL_messages_dialogFilters = (TLRPC.TL_messages_dialogFilters) tLObject;
boolean z = this.folderTags;
boolean z2 = tL_messages_dialogFilters.tags_enabled;
if (z != z2) {
setFolderTags(z2);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda367(this));
}
getMessagesStorage().checkLoadedRemoteFilters(tL_messages_dialogFilters.filters, new MessagesController$.ExternalSyntheticLambda368(this));
}
public void lambda$loadSignUpNotificationsSettings$194(TLObject tLObject) {
this.loadingNotificationSignUpSettings = false;
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
boolean z = tLObject instanceof TLRPC.TL_boolFalse;
this.enableJoined = z;
edit.putBoolean("EnableContactJoined", z);
edit.commit();
getUserConfig().notificationsSignUpSettingsLoaded = true;
getUserConfig().saveConfig(false);
}
public void lambda$loadSignUpNotificationsSettings$195(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda364(this, tLObject));
}
public void lambda$loadSuggestedFilters$21(TLObject tLObject) {
this.loadingSuggestedFilters = false;
this.suggestedFilters.clear();
if (tLObject instanceof Vector) {
this.suggestedFilters.addAll(((Vector) tLObject).objects);
}
getNotificationCenter().postNotificationName(NotificationCenter.suggestedFiltersLoaded, new Object[0]);
}
public void lambda$loadSuggestedFilters$22(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda378(this, tLObject));
}
public void lambda$loadUnknownChannel$304(long j, TLRPC.Chat chat, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
if (!tL_messages_peerDialogs.dialogs.isEmpty() && !tL_messages_peerDialogs.chats.isEmpty()) {
TLRPC.TL_dialog tL_dialog = (TLRPC.TL_dialog) tL_messages_peerDialogs.dialogs.get(0);
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs.addAll(tL_messages_peerDialogs.dialogs);
((TLRPC.messages_Dialogs) tL_messages_dialogs).messages.addAll(tL_messages_peerDialogs.messages);
((TLRPC.messages_Dialogs) tL_messages_dialogs).users.addAll(tL_messages_peerDialogs.users);
((TLRPC.messages_Dialogs) tL_messages_dialogs).chats.addAll(tL_messages_peerDialogs.chats);
processLoadedDialogs(tL_messages_dialogs, null, null, ((TLRPC.Dialog) tL_dialog).folder_id, 0, 1, this.DIALOGS_LOAD_TYPE_CHANNEL, false, false, false);
}
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
this.gettingUnknownChannels.delete(chat.id);
}
public void lambda$loadUnknownDialog$196(long j, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
if (!tL_messages_peerDialogs.dialogs.isEmpty()) {
TLRPC.TL_dialog tL_dialog = (TLRPC.TL_dialog) tL_messages_peerDialogs.dialogs.get(0);
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs.addAll(tL_messages_peerDialogs.dialogs);
((TLRPC.messages_Dialogs) tL_messages_dialogs).messages.addAll(tL_messages_peerDialogs.messages);
((TLRPC.messages_Dialogs) tL_messages_dialogs).users.addAll(tL_messages_peerDialogs.users);
((TLRPC.messages_Dialogs) tL_messages_dialogs).chats.addAll(tL_messages_peerDialogs.chats);
processLoadedDialogs(tL_messages_dialogs, null, null, ((TLRPC.Dialog) tL_dialog).folder_id, 0, 1, this.DIALOGS_LOAD_TYPE_UNKNOWN, false, false, false);
}
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
this.gettingUnknownDialogs.delete(j2);
}
public void lambda$loadUnreadDialogs$335(TLObject tLObject) {
if (tLObject instanceof Vector) {
Vector vector = (Vector) tLObject;
int size = vector.objects.size();
for (int i = 0; i < size; i++) {
TLRPC.TL_dialogPeer tL_dialogPeer = (TLRPC.DialogPeer) vector.objects.get(i);
if (tL_dialogPeer instanceof TLRPC.TL_dialogPeer) {
TLRPC.Peer peer = tL_dialogPeer.peer;
long j = peer.user_id;
if (j == 0) {
long j2 = peer.chat_id;
j = j2 != 0 ? -j2 : -peer.channel_id;
}
getMessagesStorage().setDialogUnread(j, true);
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog != null && !dialog.unread_mark) {
dialog.unread_mark = true;
if (dialog.unread_count == 0 && !isDialogMuted(j, 0L)) {
this.unreadUnmutedDialogs++;
}
}
}
}
getUserConfig().unreadDialogsLoaded = true;
getUserConfig().saveConfig(false);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE)});
this.loadingUnreadDialogs = false;
}
}
public void lambda$loadUnreadDialogs$336(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda398(this, tLObject));
}
public static void lambda$logDeviceStats$28(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$markAllTopicsAsRead$6() {
getMessagesController().sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
public void lambda$markAllTopicsAsRead$7() {
getMessagesStorage().resetAllUnreadCounters(false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda426(this));
}
public void lambda$markAllTopicsAsRead$8(ArrayList arrayList, long j) {
TLRPC.TL_forumTopic tL_forumTopic;
long j2;
if (arrayList != null) {
int i = 0;
while (i < arrayList.size()) {
TLRPC.TL_forumTopic tL_forumTopic2 = (TLRPC.TL_forumTopic) arrayList.get(i);
MessagesController messagesController = getMessagesController();
int i2 = tL_forumTopic2.top_message;
TLRPC.Message message = tL_forumTopic2.topMessage;
int i3 = i;
messagesController.markDialogAsRead(j, i2, 0, message != null ? message.date : 0, false, isMonoForum(j) ? DialogObject.getPeerDialogId(tL_forumTopic2.from_id) : tL_forumTopic2.id, 0, true, 0);
MessagesStorage messagesStorage = getMessagesStorage();
long j3 = -j;
if (isMonoForum(j)) {
tL_forumTopic = tL_forumTopic2;
j2 = DialogObject.getPeerDialogId(tL_forumTopic.from_id);
} else {
tL_forumTopic = tL_forumTopic2;
j2 = tL_forumTopic.id;
}
messagesStorage.updateRepliesMaxReadId(j3, j2, tL_forumTopic.top_message, 0, true);
i = i3 + 1;
}
}
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda372(this));
}
public void lambda$markAllTopicsAsRead$9(long j, ArrayList arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda109(this, arrayList, j));
}
public void lambda$markDialogAsRead$229(long j, int i, int i2, boolean z) {
LongSparseIntArray longSparseIntArray;
int i3;
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog != null) {
int i4 = dialog.unread_count;
if (i == 0 || i2 >= dialog.top_message) {
dialog.unread_count = 0;
} else {
int max = Math.max(i4 - i, 0);
dialog.unread_count = max;
if (i2 != Integer.MIN_VALUE && max > (i3 = dialog.top_message - i2)) {
dialog.unread_count = i3;
}
}
boolean z2 = dialog.unread_mark;
if (z2) {
dialog.unread_mark = false;
getMessagesStorage().setDialogUnread(dialog.id, false);
}
if ((i4 != 0 || z2) && dialog.unread_count == 0) {
if (!isDialogMuted(j, 0L)) {
this.unreadUnmutedDialogs--;
}
int i5 = 0;
while (true) {
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
if (i5 < dialogFilterArr.length) {
DialogFilter dialogFilter = dialogFilterArr[i5];
if (dialogFilter != null && (dialogFilter.flags & DIALOG_FILTER_FLAG_EXCLUDE_READ) != 0) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
break;
}
i5++;
} else {
break;
}
}
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE)});
}
NotificationsController notificationsController = getNotificationsController();
if (z) {
notificationsController.processReadMessages((LongSparseIntArray) null, j, 0, i2, true);
longSparseIntArray = new LongSparseIntArray(1);
longSparseIntArray.put(j, -1);
} else {
notificationsController.processReadMessages((LongSparseIntArray) null, j, 0, i2, false);
longSparseIntArray = new LongSparseIntArray(1);
longSparseIntArray.put(j, 0);
}
getNotificationsController().processDialogsUpdateRead(longSparseIntArray);
}
public void lambda$markDialogAsRead$230(long j, int i, int i2, boolean z) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda265(this, j, i, i2, z));
}
public void lambda$markDialogAsRead$231(long j, int i, boolean z, int i2, int i3) {
int i4;
getNotificationsController().processReadMessages((LongSparseIntArray) null, j, i, 0, z);
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog != null) {
int i5 = dialog.unread_count;
if (i2 == 0 || i3 <= dialog.top_message) {
dialog.unread_count = 0;
} else {
int max = Math.max(i5 - i2, 0);
dialog.unread_count = max;
if (i3 != Integer.MAX_VALUE && max > (i4 = i3 - dialog.top_message)) {
dialog.unread_count = i4;
}
}
boolean z2 = dialog.unread_mark;
if (z2) {
dialog.unread_mark = false;
getMessagesStorage().setDialogUnread(dialog.id, false);
}
if ((i5 != 0 || z2) && dialog.unread_count == 0) {
if (!isDialogMuted(j, 0L)) {
this.unreadUnmutedDialogs--;
}
int i6 = 0;
while (true) {
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
if (i6 < dialogFilterArr.length) {
DialogFilter dialogFilter = dialogFilterArr[i6];
if (dialogFilter != null && (dialogFilter.flags & DIALOG_FILTER_FLAG_EXCLUDE_READ) != 0) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
break;
}
i6++;
} else {
break;
}
}
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE)});
}
LongSparseIntArray longSparseIntArray = new LongSparseIntArray(1);
longSparseIntArray.put(j, 0);
getNotificationsController().processDialogsUpdateRead(longSparseIntArray);
}
public void lambda$markDialogAsRead$232(long j, int i, boolean z, int i2, int i3) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda393(this, j, i, z, i2, i3));
}
public void lambda$markDialogAsRead$233(long j, long j2, long j3, boolean z, int i, int i2) {
Object obj;
ArrayList<ReadTask> arrayList;
if (j != 0) {
obj = this.threadsReadTasksMap.get(j2 + "_" + j);
} else {
obj = this.readTasksMap.get(j2);
}
ReadTask readTask = (ReadTask) obj;
if (readTask == null) {
readTask = new ReadTask((1) null);
readTask.dialogId = j2;
readTask.replyId = j;
readTask.monoForumPeerId = j3;
readTask.sendRequestTime = SystemClock.elapsedRealtime() + 5000;
if (!z) {
if (j != 0) {
this.threadsReadTasksMap.put(j2 + "_" + j, readTask);
arrayList = this.repliesReadTasks;
} else {
this.readTasksMap.put(j2, readTask);
arrayList = this.readTasks;
}
arrayList.add(readTask);
}
}
readTask.maxDate = i;
readTask.maxId = i2;
if (z) {
completeReadTask(readTask);
}
}
public void lambda$markDialogAsReadNow$228(long j, long j2) {
if (j == 0) {
ReadTask readTask = (ReadTask) this.readTasksMap.get(j2);
if (readTask == null) {
return;
}
completeReadTask(readTask);
this.readTasks.remove(readTask);
this.readTasksMap.remove(j2);
return;
}
String str = j2 + "_" + j;
ReadTask readTask2 = this.threadsReadTasksMap.get(str);
if (readTask2 == null) {
return;
}
completeReadTask(readTask2);
this.repliesReadTasks.remove(readTask2);
this.threadsReadTasksMap.remove(str);
}
public void lambda$markDialogAsUnread$334(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public static void lambda$markMentionMessageAsRead$221(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$markMentionMessageAsRead$222(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedMessages.pts, -1, tL_messages_affectedMessages.pts_count);
}
}
public void lambda$markMessageAsRead2$223(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$markMessageAsRead2$224(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedMessages.pts, -1, tL_messages_affectedMessages.pts_count);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public static void lambda$markMessageContentAsRead$219(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$markMessageContentAsRead$220(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.TL_messages_affectedMessages tL_messages_affectedMessages = (TLRPC.TL_messages_affectedMessages) tLObject;
processNewDifferenceParams(-1, tL_messages_affectedMessages.pts, -1, tL_messages_affectedMessages.pts_count);
}
}
public static void lambda$markReactionsAsRead$389(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$migrateDialogs$201() {
this.migratingDialogs = false;
}
public void lambda$migrateDialogs$202(org.telegram.tgnet.TLRPC.messages_Dialogs r38, int r39) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$migrateDialogs$202(org.telegram.tgnet.TLRPC$messages_Dialogs, int):void");
}
public void lambda$migrateDialogs$203() {
this.migratingDialogs = false;
}
public void lambda$migrateDialogs$204(int i, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda273(this, (TLRPC.messages_Dialogs) tLObject, i));
} else {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda274(this));
}
}
public void lambda$new$0() {
getUserConfig().checkSavedPassword();
}
public int lambda$new$10(TLRPC.Dialog dialog, TLRPC.Dialog dialog2) {
DialogFilter dialogFilter = this.sortingDialogFilter;
int i = dialogFilter == null ? Integer.MIN_VALUE : dialogFilter.pinnedDialogs.get(dialog.id, Integer.MIN_VALUE);
DialogFilter dialogFilter2 = this.sortingDialogFilter;
int i2 = dialogFilter2 == null ? Integer.MIN_VALUE : dialogFilter2.pinnedDialogs.get(dialog2.id, Integer.MIN_VALUE);
boolean z = dialog instanceof TLRPC.TL_dialogFolder;
if (z && !(dialog2 instanceof TLRPC.TL_dialogFolder)) {
return -1;
}
if (!z && (dialog2 instanceof TLRPC.TL_dialogFolder)) {
return 1;
}
if (i == Integer.MIN_VALUE && i2 != Integer.MIN_VALUE) {
return 1;
}
if (i != Integer.MIN_VALUE && i2 == Integer.MIN_VALUE) {
return -1;
}
if (i != Integer.MIN_VALUE) {
if (i > i2) {
return 1;
}
return i < i2 ? -1 : 0;
}
MediaDataController mediaDataController = getMediaDataController();
long lastMessageOrDraftDate = DialogObject.getLastMessageOrDraftDate(dialog, mediaDataController.getDraft(dialog.id, 0L));
long lastMessageOrDraftDate2 = DialogObject.getLastMessageOrDraftDate(dialog2, mediaDataController.getDraft(dialog2.id, 0L));
if (lastMessageOrDraftDate < lastMessageOrDraftDate2) {
return 1;
}
return lastMessageOrDraftDate > lastMessageOrDraftDate2 ? -1 : 0;
}
public int lambda$new$11(TLRPC.Dialog dialog, TLRPC.Dialog dialog2) {
boolean z = dialog instanceof TLRPC.TL_dialogFolder;
if (z && !(dialog2 instanceof TLRPC.TL_dialogFolder)) {
return -1;
}
if (!z && (dialog2 instanceof TLRPC.TL_dialogFolder)) {
return 1;
}
boolean z2 = dialog.pinned;
if (!z2 && dialog2.pinned) {
return 1;
}
if (z2 && !dialog2.pinned) {
return -1;
}
if (z2) {
int i = dialog.pinnedNum;
int i2 = dialog2.pinnedNum;
if (i < i2) {
return 1;
}
return i > i2 ? -1 : 0;
}
MediaDataController mediaDataController = getMediaDataController();
long lastMessageOrDraftDate = DialogObject.getLastMessageOrDraftDate(dialog, mediaDataController.getDraft(dialog.id, 0L));
long lastMessageOrDraftDate2 = DialogObject.getLastMessageOrDraftDate(dialog2, mediaDataController.getDraft(dialog2.id, 0L));
if (lastMessageOrDraftDate < lastMessageOrDraftDate2) {
return 1;
}
return lastMessageOrDraftDate > lastMessageOrDraftDate2 ? -1 : 0;
}
public int lambda$new$12(TLRPC$Update tLRPC$Update, TLRPC$Update tLRPC$Update2) {
int updateQts;
int updateQts2;
int updateType = getUpdateType(tLRPC$Update);
int updateType2 = getUpdateType(tLRPC$Update2);
if (updateType != updateType2) {
return AndroidUtilities.compare(updateType, updateType2);
}
if (updateType != 0) {
if (updateType == 1) {
updateQts = getUpdateQts(tLRPC$Update);
updateQts2 = getUpdateQts(tLRPC$Update2);
return AndroidUtilities.compare(updateQts, updateQts2);
}
if (updateType != 2) {
return 0;
}
long updateChannelId = getUpdateChannelId(tLRPC$Update);
long updateChannelId2 = getUpdateChannelId(tLRPC$Update2);
if (updateChannelId != updateChannelId2) {
return AndroidUtilities.compare(updateChannelId, updateChannelId2);
}
}
updateQts = getUpdatePts(tLRPC$Update);
updateQts2 = getUpdatePts(tLRPC$Update2);
return AndroidUtilities.compare(updateQts, updateQts2);
}
public void lambda$new$13() {
MessagesController messagesController = getMessagesController();
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileUploaded);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileUploadFailed);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileUploadProgressChanged);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileLoaded);
getNotificationCenter().addObserver(messagesController, NotificationCenter.fileLoadFailed);
getNotificationCenter().addObserver(messagesController, NotificationCenter.messageReceivedByServer);
getNotificationCenter().addObserver(messagesController, NotificationCenter.updateMessageMedia);
}
public void lambda$new$14() {
checkPeerColors(false);
}
public void lambda$new$15() {
this.enableJoined = this.notificationsPreferences.getBoolean("EnableContactJoined", true);
this.nextTosCheckTime = this.notificationsPreferences.getInt("nextTosCheckTime", 0);
}
public void lambda$new$34() {
getNotificationCenter().postNotificationName(NotificationCenter.updateTranscriptionLock, new Object[0]);
}
public void lambda$new$456() {
int i;
LongSparseArray longSparseArray = new LongSparseArray();
Iterator<Pair<StarsController.MessageId, AtomicBoolean>> it = this.pendingReportMessageDelivery.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Pair<StarsController.MessageId, AtomicBoolean> next = it.next();
Pair pair = (Pair) longSparseArray.get(((StarsController.MessageId) next.first).did);
if (pair == null) {
long j = ((StarsController.MessageId) next.first).did;
Pair pair2 = new Pair(new HashSet(), (AtomicBoolean) next.second);
longSparseArray.put(j, pair2);
pair = pair2;
}
if (!((AtomicBoolean) next.second).get()) {
((AtomicBoolean) pair.second).set(false);
}
((HashSet) pair.first).add(Integer.valueOf(((StarsController.MessageId) next.first).mid));
}
this.pendingReportMessageDelivery.clear();
for (i = 0; i < longSparseArray.size(); i++) {
Pair pair3 = (Pair) longSparseArray.valueAt(i);
long keyAt = longSparseArray.keyAt(i);
HashSet hashSet = (HashSet) pair3.first;
boolean z = ((AtomicBoolean) pair3.second).get();
TLRPC.TL_reportMessagesDelivery tL_reportMessagesDelivery = new TLRPC.TL_reportMessagesDelivery();
tL_reportMessagesDelivery.peer = getInputPeer(keyAt);
tL_reportMessagesDelivery.id.addAll(hashSet);
tL_reportMessagesDelivery.push = z;
getConnectionsManager().sendRequest(tL_reportMessagesDelivery, null);
}
}
public void lambda$onFolderEmpty$185(int i) {
if (i != 1) {
removeFolder(i);
} else {
this.hasArchivedChats = false;
checkArchiveFolder();
}
}
public static void lambda$openApp$448(boolean[] zArr) {
zArr[0] = true;
}
public void lambda$openApp$449(BaseFragment baseFragment, Browser.Progress progress, boolean[] zArr, TLRPC$User tLRPC$User, String str, boolean z, boolean z2, TL_bots.BotInfo[] botInfoArr) {
BaseFragment baseFragment2;
WebViewRequestProps of;
BotWebViewSheet botWebViewSheet;
BaseFragment safeLastFragment = baseFragment != null ? baseFragment : LaunchActivity.getSafeLastFragment();
if (safeLastFragment == null) {
return;
}
if (progress != null) {
progress.end();
}
if (zArr[0]) {
return;
}
String restrictionReason = getRestrictionReason(tLRPC$User.restriction_reason);
if (!TextUtils.isEmpty(restrictionReason)) {
showCantOpenAlert(safeLastFragment, restrictionReason);
return;
}
if (tLRPC$User.bot_has_main_app) {
if (safeLastFragment.getParentLayout() instanceof ActionBarLayout) {
safeLastFragment = safeLastFragment.getParentLayout().getSheetFragment();
}
BaseFragment baseFragment3 = safeLastFragment;
AndroidUtilities.hideKeyboard(baseFragment3.getFragmentView());
int i = this.currentAccount;
long j = tLRPC$User.id;
baseFragment2 = baseFragment3;
of = WebViewRequestProps.of(i, j, j, (String) null, (String) null, 4, 0, 0L, false, (TLRPC.BotApp) null, false, str, tLRPC$User, 0, z, z2);
LaunchActivity launchActivity = LaunchActivity.instance;
if (launchActivity != null && launchActivity.getBottomSheetTabs() != null && LaunchActivity.instance.getBottomSheetTabs().tryReopenTab(of) != null) {
return;
}
botWebViewSheet = new BotWebViewSheet(baseFragment2.getContext(), baseFragment2.getResourceProvider());
botWebViewSheet.setDefaultFullsize(true);
botWebViewSheet.setNeedsContext(false);
} else {
TL_bots.BotInfo botInfo = botInfoArr[0];
if (botInfo == null || !(botInfo.menu_button instanceof TL_bots.TL_botMenuButton)) {
safeLastFragment.presentFragment((BaseFragment) ChatActivity.of(tLRPC$User.id));
return;
}
if (safeLastFragment.getParentLayout() instanceof ActionBarLayout) {
safeLastFragment = safeLastFragment.getParentLayout().getSheetFragment();
}
BaseFragment baseFragment4 = safeLastFragment;
TL_bots.TL_botMenuButton tL_botMenuButton = botInfoArr[0].menu_button;
AndroidUtilities.hideKeyboard(baseFragment4.getFragmentView());
int i2 = this.currentAccount;
long j2 = tLRPC$User.id;
baseFragment2 = baseFragment4;
of = WebViewRequestProps.of(i2, j2, j2, tL_botMenuButton.text, tL_botMenuButton.url, 2, 0, 0L, false, (TLRPC.BotApp) null, false, str, tLRPC$User, 0, z, z2);
LaunchActivity launchActivity2 = LaunchActivity.instance;
if (launchActivity2 != null && launchActivity2.getBottomSheetTabs() != null && LaunchActivity.instance.getBottomSheetTabs().tryReopenTab(of) != null) {
return;
}
botWebViewSheet = new BotWebViewSheet(baseFragment2.getContext(), baseFragment2.getResourceProvider());
botWebViewSheet.setDefaultFullsize(false);
botWebViewSheet.setNeedsContext(true);
}
botWebViewSheet.setParentActivity(baseFragment2.getParentActivity());
botWebViewSheet.requestWebView(baseFragment2, of);
botWebViewSheet.show();
}
public static void lambda$openApp$450(boolean[] zArr, TL_bots.BotInfo[] botInfoArr, Runnable runnable, TLRPC.UserFull userFull) {
if (zArr[0]) {
return;
}
if (userFull != null) {
botInfoArr[0] = userFull.bot_info;
}
AndroidUtilities.runOnUIThread(runnable);
}
public void lambda$openApp$451(boolean[] zArr, TL_bots.BotInfo[] botInfoArr, TLRPC$User tLRPC$User, int i, Runnable runnable, TL_bots.BotInfo botInfo) {
if (zArr[0]) {
return;
}
botInfoArr[0] = botInfo;
if (botInfo == null) {
TLRPC.UserFull userFull = getUserFull(tLRPC$User.id);
if (userFull == null) {
if (zArr[0]) {
return;
}
loadFullUser(tLRPC$User, i, true, new MessagesController$.ExternalSyntheticLambda136(zArr, botInfoArr, runnable));
return;
}
botInfoArr[0] = userFull.bot_info;
}
runnable.run();
}
public void lambda$openByUserName$406(Browser.Progress progress, AlertDialog[] alertDialogArr, BaseFragment baseFragment, boolean[] zArr, int i, Long l) {
TLRPC$User user;
TLRPC.Chat chat;
boolean z;
MessagesController messagesController;
BaseFragment baseFragment2;
int i2;
try {
if (progress != null) {
progress.end();
} else {
alertDialogArr[0].dismiss();
}
} catch (Exception unused) {
}
alertDialogArr[0] = null;
baseFragment.setVisibleDialog(null);
if (zArr[0]) {
return;
}
if (l == null) {
if (baseFragment.getParentActivity() != null) {
try {
if (baseFragment instanceof ChatActivity) {
((ChatActivity) baseFragment).shakeContent();
}
BulletinFactory.of(baseFragment).createErrorBulletin(LocaleController.getString(R.string.NoUsernameFound)).show();
return;
} catch (Exception e) {
FileLog.e(e);
return;
}
}
return;
}
if (l.longValue() < 0) {
chat = getChat(Long.valueOf(-l.longValue()));
i2 = 1;
z = false;
user = null;
messagesController = this;
baseFragment2 = baseFragment;
} else {
user = getUser(l);
chat = null;
z = false;
messagesController = this;
baseFragment2 = baseFragment;
i2 = i;
}
messagesController.openChatOrProfileWith(user, chat, baseFragment2, i2, z);
}
public static void lambda$openByUserName$407(boolean[] zArr) {
zArr[0] = true;
}
public static void lambda$openByUserName$408(boolean[] zArr, DialogInterface dialogInterface) {
zArr[0] = true;
}
public static void lambda$openByUserName$409(AlertDialog[] alertDialogArr, boolean[] zArr, BaseFragment baseFragment) {
AlertDialog alertDialog = alertDialogArr[0];
if (alertDialog == null) {
return;
}
alertDialog.setOnCancelListener(new MessagesController$.ExternalSyntheticLambda374(zArr));
baseFragment.showDialog(alertDialogArr[0]);
}
public static void lambda$performLogout$295(TLObject tLObject) {
if (tLObject instanceof TLRPC.TL_auth_loggedOut) {
TLRPC.TL_auth_loggedOut tL_auth_loggedOut = (TLRPC.TL_auth_loggedOut) tLObject;
if (tL_auth_loggedOut.future_auth_token != null) {
AuthTokensHelper.addLogOutToken(tL_auth_loggedOut);
}
}
}
public void lambda$performLogout$296(TLObject tLObject, TLRPC.TL_error tL_error) {
getConnectionsManager().cleanup(false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda63(tLObject));
}
public void lambda$pinDialog$338(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$pinMessage$122(int i, TLRPC.Chat chat, TLRPC$User tLRPC$User, boolean z, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
ArrayList arrayList = new ArrayList();
arrayList.add(Integer.valueOf(i));
getMessagesStorage().updatePinnedMessages(chat != null ? -chat.id : tLRPC$User.id, arrayList, !z, -1, 0, false, (HashMap) null);
processUpdates((TLRPC.Updates) tLObject, false);
}
}
public static int lambda$processChannelsUpdatesQueue$300(TLRPC.Updates updates, TLRPC.Updates updates2) {
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
public void lambda$processChatInfo$140(boolean z, long j, boolean z2, boolean z3, TLRPC.ChatFull chatFull, ArrayList arrayList, ArrayList arrayList2, HashMap hashMap, int i, boolean z4) {
if (z && j > 0 && !z2 && System.currentTimeMillis() - this.loadedFullChats.get(j, 0L) > 60000) {
loadFullChat(j, 0, z3);
}
if (chatFull != null) {
if (this.fullChats.get(j) == null) {
this.fullChats.put(j, chatFull);
getTranslateController().updateDialogFull(-j);
}
putUsers(arrayList, z);
if (chatFull.stickerset != null) {
getMediaDataController().getGroupStickerSetById(chatFull.stickerset);
}
if (chatFull.emojiset != null) {
getMediaDataController().getGroupStickerSetById(chatFull.emojiset);
}
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoDidLoad, new Object[]{chatFull, 0, Boolean.valueOf(z2), Boolean.FALSE});
}
if (arrayList2 != null) {
getNotificationCenter().postNotificationName(NotificationCenter.pinnedInfoDidLoad, new Object[]{Long.valueOf(-j), arrayList2, hashMap, Integer.valueOf(i), Boolean.valueOf(z4)});
}
}
public void lambda$processDialogsUpdate$216(org.telegram.tgnet.TLRPC.messages_Dialogs r19, androidx.collection.LongSparseArray r20, androidx.collection.LongSparseArray r21, boolean r22, org.telegram.messenger.support.LongSparseIntArray r23) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processDialogsUpdate$216(org.telegram.tgnet.TLRPC$messages_Dialogs, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, boolean, org.telegram.messenger.support.LongSparseIntArray):void");
}
public void lambda$processDialogsUpdate$217(org.telegram.tgnet.TLRPC.messages_Dialogs r20, boolean r21) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processDialogsUpdate$217(org.telegram.tgnet.TLRPC$messages_Dialogs, boolean):void");
}
public void lambda$processDialogsUpdateRead$211(org.telegram.messenger.support.LongSparseIntArray r14, org.telegram.messenger.support.LongSparseIntArray r15) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processDialogsUpdateRead$211(org.telegram.messenger.support.LongSparseIntArray, org.telegram.messenger.support.LongSparseIntArray):void");
}
public void lambda$processLoadedChannelAdmins$60(long j, LongSparseArray longSparseArray, boolean z) {
this.channelAdmins.put(j, longSparseArray);
if (z) {
this.loadingChannelAdmins.delete(j);
loadChannelAdmins(j, false);
getNotificationCenter().postNotificationName(NotificationCenter.didLoadChatAdmins, new Object[]{Long.valueOf(j)});
}
}
public void lambda$processLoadedDeleteTask$81() {
checkDeletingTask(true);
}
public void lambda$processLoadedDeleteTask$82(LongSparseArray longSparseArray, LongSparseArray longSparseArray2, int i) {
this.gettingNewDeleteTask = false;
if (longSparseArray == null && longSparseArray2 == null) {
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
this.currentDeletingTaskMediaMids = null;
return;
}
this.currentDeletingTaskTime = i;
this.currentDeletingTaskMids = longSparseArray;
this.currentDeletingTaskMediaMids = longSparseArray2;
if (this.currentDeleteTaskRunnable != null) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
this.currentDeleteTaskRunnable = null;
}
if (checkDeletingTask(false)) {
return;
}
this.currentDeleteTaskRunnable = new MessagesController$.ExternalSyntheticLambda52(this);
Utilities.stageQueue.postRunnable(this.currentDeleteTaskRunnable, Math.abs(getConnectionsManager().getCurrentTime() - this.currentDeletingTaskTime) * 1000);
}
public static int lambda$processLoadedDialogFilters$18(DialogFilter dialogFilter, DialogFilter dialogFilter2) {
int i = dialogFilter.order;
int i2 = dialogFilter2.order;
if (i > i2) {
return 1;
}
return i < i2 ? -1 : 0;
}
public void lambda$processLoadedDialogFilters$19(int i, ArrayList arrayList, ArrayList arrayList2, ArrayList arrayList3, TLRPC.messages_Dialogs messages_dialogs, ArrayList arrayList4, LongSparseArray longSparseArray, LongSparseArray longSparseArray2, Runnable runnable) {
int i2;
ArrayList arrayList5;
ArrayList arrayList6;
if (i != 2) {
this.dialogFilters = arrayList;
this.dialogFiltersById.clear();
int size = this.dialogFilters.size();
for (int i3 = 0; i3 < size; i3++) {
DialogFilter dialogFilter = this.dialogFilters.get(i3);
this.dialogFiltersById.put(dialogFilter.id, dialogFilter);
}
Collections.sort(this.dialogFilters, new MessagesController$.ExternalSyntheticLambda407());
putUsers(arrayList2, true);
putChats(arrayList3, true);
this.dialogFiltersLoaded = true;
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
if (i == 0) {
loadRemoteFilters(false);
}
if (messages_dialogs != null && !messages_dialogs.dialogs.isEmpty()) {
applyDialogsNotificationsSettings(messages_dialogs.dialogs);
}
if (arrayList4 != null) {
for (int i4 = 0; i4 < arrayList4.size(); i4++) {
TLRPC.EncryptedChat encryptedChat = (TLRPC.EncryptedChat) arrayList4.get(i4);
if ((encryptedChat instanceof TLRPC.TL_encryptedChat) && AndroidUtilities.getMyLayerVersion(encryptedChat.layer) < SecretChatHelper.CURRENT_SECRET_CHAT_LAYER) {
getSecretChatHelper().sendNotifyLayerMessage(encryptedChat, (TLRPC.Message) null);
}
putEncryptedChat(encryptedChat, true);
}
}
for (int i5 = 0; i5 < longSparseArray.size(); i5++) {
long keyAt = longSparseArray.keyAt(i5);
TLRPC.Dialog dialog = (TLRPC.Dialog) longSparseArray.valueAt(i5);
TLRPC.Dialog dialog2 = (TLRPC.Dialog) this.dialogs_dict.get(keyAt);
if (messages_dialogs != null && messages_dialogs.dialogs.contains(dialog)) {
if (dialog.draft instanceof TLRPC.TL_draftMessage) {
getMediaDataController().saveDraft(dialog.id, 0L, dialog.draft, (TLRPC.Message) null, false);
}
if (dialog2 != null) {
dialog2.notify_settings = dialog.notify_settings;
}
}
ArrayList arrayList7 = (ArrayList) longSparseArray2.get(dialog.id);
long j = 0;
if (dialog2 == null) {
this.dialogs_dict.put(keyAt, dialog);
this.dialogMessage.put(keyAt, arrayList7);
if (arrayList7 != null) {
for (int i6 = 0; i6 < arrayList7.size(); i6++) {
MessageObject messageObject = (MessageObject) arrayList7.get(i6);
if (messageObject != null && messageObject.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.put(messageObject.getId(), messageObject);
long j2 = messageObject.messageOwner.random_id;
if (j2 != 0) {
this.dialogMessagesByRandomIds.put(j2, messageObject);
}
}
}
}
} else {
dialog2.pinned = dialog.pinned;
dialog2.pinnedNum = dialog.pinnedNum;
ArrayList arrayList8 = (ArrayList) this.dialogMessage.get(keyAt);
for (int i7 = 0; arrayList8 != null && i7 < arrayList8.size(); i7++) {
if (arrayList8.get(i7) != null && ((MessageObject) arrayList8.get(i7)).deleted) {
break;
}
}
if (arrayList8 != null && dialog2.top_message <= 0) {
this.dialogs_dict.put(keyAt, dialog);
this.dialogMessage.put(keyAt, arrayList7);
int i8 = 0;
while (i8 < arrayList8.size()) {
MessageObject messageObject2 = (MessageObject) arrayList8.get(i8);
if (messageObject2 == null) {
arrayList6 = arrayList8;
} else {
arrayList6 = arrayList8;
if (messageObject2.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.remove(messageObject2.getId());
}
long j3 = messageObject2.messageOwner.random_id;
if (j3 != 0) {
this.dialogMessagesByRandomIds.remove(j3);
}
}
i8++;
arrayList8 = arrayList6;
}
ArrayList arrayList9 = arrayList8;
if (arrayList7 != null) {
int i9 = 0;
while (i9 < arrayList7.size()) {
MessageObject messageObject3 = (MessageObject) arrayList7.get(i9);
if (messageObject3 == null || messageObject3.messageOwner.peer_id.channel_id != j) {
arrayList5 = arrayList9;
} else {
int i10 = 0;
while (true) {
arrayList5 = arrayList9;
if (i10 >= arrayList9.size()) {
break;
}
MessageObject messageObject4 = (MessageObject) arrayList5.get(i10);
if (messageObject4 != null && messageObject4.getId() == messageObject3.getId()) {
messageObject3.deleted = messageObject4.deleted;
break;
} else {
i10++;
arrayList9 = arrayList5;
}
}
this.dialogMessagesByIds.put(messageObject3.getId(), messageObject3);
long j4 = messageObject3.messageOwner.random_id;
if (j4 != 0) {
this.dialogMessagesByRandomIds.put(j4, messageObject3);
}
}
i9++;
arrayList9 = arrayList5;
j = 0;
}
}
}
if (dialog.top_message < dialog2.top_message) {
if ((arrayList8 == null) == (arrayList7 == null)) {
if (arrayList8 != null) {
if (arrayList7 != null) {
if (arrayList8.size() == arrayList7.size()) {
}
}
}
}
}
this.dialogs_dict.put(keyAt, dialog);
this.dialogMessage.put(keyAt, arrayList7);
if (arrayList8 != null) {
for (int i11 = 0; i11 < arrayList8.size(); i11++) {
MessageObject messageObject5 = (MessageObject) arrayList8.get(i11);
if (messageObject5 != null) {
if (messageObject5.messageOwner.peer_id.channel_id == 0) {
this.dialogMessagesByIds.remove(messageObject5.getId());
}
long j5 = messageObject5.messageOwner.random_id;
if (j5 != 0) {
this.dialogMessagesByRandomIds.remove(j5);
}
}
}
}
if (arrayList7 != null) {
for (int i12 = 0; i12 < arrayList7.size(); i12++) {
MessageObject messageObject6 = (MessageObject) arrayList7.get(i12);
if (messageObject6 != null && messageObject6.messageOwner.peer_id.channel_id == 0) {
int i13 = 0;
while (true) {
if (arrayList8 == null || i13 >= arrayList8.size()) {
break;
}
MessageObject messageObject7 = (MessageObject) arrayList8.get(i13);
if (messageObject7 != null && messageObject7.getId() == messageObject6.getId()) {
messageObject6.deleted = messageObject7.deleted;
break;
}
i13++;
}
this.dialogMessagesByIds.put(messageObject6.getId(), messageObject6);
long j6 = messageObject6.messageOwner.random_id;
if (j6 != 0) {
this.dialogMessagesByRandomIds.put(j6, messageObject6);
}
}
}
}
}
getTranslateController().checkDialogMessage(keyAt);
}
this.allDialogs.clear();
int size2 = this.dialogs_dict.size();
for (int i14 = 0; i14 < size2; i14++) {
TLRPC.Dialog dialog3 = (TLRPC.Dialog) this.dialogs_dict.valueAt(i14);
if (this.deletingDialogs.indexOfKey(dialog3.id) < 0) {
this.allDialogs.add(dialog3);
}
}
sortDialogs(null);
i2 = 0;
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
} else {
i2 = 0;
}
if (i != 0) {
getUserConfig().filtersLoaded = true;
getUserConfig().saveConfig(i2);
this.loadingRemoteFilters = i2;
getNotificationCenter().postNotificationName(NotificationCenter.filterSettingsUpdated, new Object[i2]);
}
lockFiltersInternal();
if (runnable != null) {
runnable.run();
}
}
public void lambda$processLoadedDialogFilters$20(org.telegram.tgnet.TLRPC.messages_Dialogs r20, java.util.ArrayList r21, org.telegram.tgnet.TLRPC.messages_Dialogs r22, int r23, java.util.ArrayList r24, java.util.ArrayList r25, java.util.ArrayList r26, java.lang.Runnable r27) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processLoadedDialogFilters$20(org.telegram.tgnet.TLRPC$messages_Dialogs, java.util.ArrayList, org.telegram.tgnet.TLRPC$messages_Dialogs, int, java.util.ArrayList, java.util.ArrayList, java.util.ArrayList, java.lang.Runnable):void");
}
public void lambda$processLoadedDialogs$205(TLRPC.messages_Dialogs messages_dialogs, ArrayList arrayList, int i, boolean z, long[] jArr, int i2) {
putUsers(messages_dialogs.users, true);
if (arrayList != null) {
for (int i3 = 0; i3 < arrayList.size(); i3++) {
long j = ((TLRPC.UserFull) arrayList.get(i3)).id;
this.fullUsers.put(j, (TLRPC.UserFull) arrayList.get(i3));
getTranslateController().updateDialogFull(j);
}
}
this.loadingDialogs.put(i, false);
if (z) {
this.dialogsEndReached.put(i, false);
this.serverDialogsEndReached.put(i, false);
} else if (jArr[0] == 2147483647L) {
this.dialogsEndReached.put(i, true);
this.serverDialogsEndReached.put(i, true);
} else {
loadDialogs(i, 0, i2, false);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$processLoadedDialogs$206(TLRPC.Chat chat) {
checkChatInviter(chat.id, true);
}
public void lambda$processLoadedDialogs$207(org.telegram.tgnet.TLRPC.Message r25, int r26, org.telegram.tgnet.TLRPC.messages_Dialogs r27, java.util.ArrayList r28, java.util.ArrayList r29, boolean r30, int r31, androidx.collection.LongSparseArray r32, androidx.collection.LongSparseArray r33, androidx.collection.LongSparseArray r34, int r35, boolean r36, int r37, java.util.ArrayList r38) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processLoadedDialogs$207(org.telegram.tgnet.TLRPC$Message, int, org.telegram.tgnet.TLRPC$messages_Dialogs, java.util.ArrayList, java.util.ArrayList, boolean, int, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, int, boolean, int, java.util.ArrayList):void");
}
public void lambda$processLoadedDialogs$208(int r32, int r33, org.telegram.tgnet.TLRPC.messages_Dialogs r34, java.util.ArrayList r35, boolean r36, int r37, java.util.ArrayList r38, int r39, boolean r40, boolean r41) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processLoadedDialogs$208(int, int, org.telegram.tgnet.TLRPC$messages_Dialogs, java.util.ArrayList, boolean, int, java.util.ArrayList, int, boolean, boolean):void");
}
public void lambda$processLoadedMessages$177(long j, long j2, int i, int i2, boolean z, int i3, int i4, int i5, int i6, int i7, int i8, long j3, int i9, int i10, int i11, int i12, boolean z2, boolean z3, Timer timer, long j4) {
loadMessagesInternal(j, j2, false, i, (i2 == 2 && z) ? i3 : i4, i5, false, 0, i6, i2, i7, i8, j3, i9, i3, i10, i11, z, i12, true, z2, z3, timer, j4);
}
public void lambda$processLoadedMessages$178(int i, TLRPC.messages_Messages messages_messages, boolean z, boolean z2, int i2) {
getNotificationCenter().postNotificationName(NotificationCenter.messagesDidLoadWithoutProcess, new Object[]{Integer.valueOf(i), Integer.valueOf(messages_messages.messages.size()), Boolean.valueOf(z), Boolean.valueOf(z2), Integer.valueOf(i2)});
}
public static int lambda$processLoadedMessages$179(MessageObject messageObject, MessageObject messageObject2) {
int i;
int i2;
if (messageObject.messageOwner.date != messageObject2.messageOwner.date || messageObject.getId() < 0 || messageObject2.getId() < 0) {
i = messageObject2.messageOwner.date;
i2 = messageObject.messageOwner.date;
} else {
i = messageObject2.getId();
i2 = messageObject.getId();
}
return i - i2;
}
public static int lambda$processLoadedMessages$180(MessageObject messageObject, MessageObject messageObject2) {
return messageObject2.getId() - messageObject.getId();
}
public void lambda$processLoadedMessages$181(Timer.Task task, boolean z, int i, int i2, boolean z2, boolean z3, int i3, long j, int i4, ArrayList arrayList, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12) {
Timer.done(task);
NotificationCenter notificationCenter = getNotificationCenter();
if (z) {
notificationCenter.postNotificationName(NotificationCenter.messagesDidLoad, new Object[]{Long.valueOf(j), Integer.valueOf(i4), arrayList, Boolean.valueOf(z2), Integer.valueOf(i5), Integer.valueOf(i3), Integer.valueOf(i6), Integer.valueOf(i7), Integer.valueOf(i8), Boolean.valueOf(z3), Integer.valueOf(i), Integer.valueOf(i9), Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12)});
} else {
notificationCenter.postNotificationName(NotificationCenter.messagesDidLoadWithoutProcess, new Object[]{Integer.valueOf(i), Integer.valueOf(i2), Boolean.valueOf(z2), Boolean.valueOf(z3), Integer.valueOf(i3)});
}
}
public void lambda$processLoadedMessages$182(Timer.Task task, Timer timer, TLRPC.messages_Messages messages_messages, boolean z, boolean z2, int i, boolean z3, int i2, int i3, int i4, long j, ArrayList arrayList, long j2, int i5, int i6, boolean z4, int i7, int i8, int i9, int i10, int i11, int i12, ArrayList arrayList2, HashMap hashMap) {
int i13;
int i14;
int i15;
int i16;
MessagesController messagesController;
int i17;
long j3;
Timer.done(task);
Timer.Task start = Timer.start(timer, "processLoadedMessages: post runOnUIThread");
putUsers(messages_messages.users, z);
putChats(messages_messages.chats, z);
if (messages_messages.animatedEmoji != null && z2) {
AnimatedEmojiDrawable.getDocumentFetcher(this.currentAccount).processDocuments(messages_messages.animatedEmoji);
}
if (i == 1) {
i15 = 0;
} else {
if (z3 && i2 == 2) {
i14 = ConnectionsManager.DEFAULT_DATACENTER_ID;
for (int i18 = 0; i18 < messages_messages.messages.size(); i18++) {
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(i18);
if ((!message.out || message.from_scheduled) && (i16 = message.id) > i3 && i16 < i14) {
i14 = i16;
}
}
i13 = i3;
} else {
i13 = i3;
i14 = ConnectionsManager.DEFAULT_DATACENTER_ID;
}
i15 = i14 == Integer.MAX_VALUE ? i13 : i14;
}
if (i == 1 && i4 == 1) {
getNotificationCenter().postNotificationName(NotificationCenter.scheduledMessagesUpdated, new Object[]{Long.valueOf(j), Integer.valueOf(arrayList.size()), Boolean.FALSE});
}
if (DialogObject.isEncryptedDialog(j) || i == 5) {
getNotificationCenter().postNotificationName(NotificationCenter.messagesDidLoad, new Object[]{Long.valueOf(j), Integer.valueOf(i4), arrayList, Boolean.valueOf(z), Integer.valueOf(i15), Integer.valueOf(i7), Integer.valueOf(i8), Integer.valueOf(i9), Integer.valueOf(i2), Boolean.valueOf(z4), Integer.valueOf(i5), Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf(i)});
} else {
getMediaDataController().loadReplyMessagesForMessages(arrayList, j, i, j2, new MessagesController$.ExternalSyntheticLambda462(this, Timer.start(timer, "loadReplyMessagesForMessages"), z2, i5, i6, z, z4, i7, j, i4, arrayList, i15, i8, i9, i2, i10, i11, i12, i), i5, timer);
}
if (arrayList2.isEmpty()) {
messagesController = this;
i17 = i;
j3 = j;
} else {
messagesController = this;
i17 = i;
j3 = j;
messagesController.reloadMessages(arrayList2, j3, i17);
}
if (!hashMap.isEmpty()) {
messagesController.reloadWebPages(j3, hashMap, i17);
}
Timer.done(start);
Timer.finish(timer);
}
public void lambda$processUpdateArray$355(ArrayList arrayList, ArrayList arrayList2) {
putUsers(arrayList, false);
putChats(arrayList2, false);
}
public void lambda$processUpdateArray$356(ArrayList arrayList, ArrayList arrayList2) {
putUsers(arrayList, false);
putChats(arrayList2, false);
}
public void lambda$processUpdateArray$357(TLRPC.TL_updateUserTyping tL_updateUserTyping) {
getNotificationCenter().postNotificationName(NotificationCenter.onEmojiInteractionsReceived, new Object[]{Long.valueOf(tL_updateUserTyping.user_id), tL_updateUserTyping.action});
}
public void lambda$processUpdateArray$358(TLRPC.TL_updateChatUserTyping tL_updateChatUserTyping) {
getNotificationCenter().postNotificationName(NotificationCenter.onEmojiInteractionsReceived, new Object[]{Long.valueOf(-tL_updateChatUserTyping.chat_id), tL_updateChatUserTyping.action});
}
public void lambda$processUpdateArray$359(TLRPC.TL_updatePeerBlocked tL_updatePeerBlocked) {
long peerId = MessageObject.getPeerId(tL_updatePeerBlocked.peer_id);
if (!tL_updatePeerBlocked.blocked) {
this.blockePeers.delete(peerId);
} else if (this.blockePeers.indexOfKey(peerId) < 0) {
this.blockePeers.put(peerId, 1);
}
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
getStoriesController().updateBlockUser(peerId, tL_updatePeerBlocked.blocked_my_stories_from, false);
}
public void lambda$processUpdateArray$360(TLRPC.TL_updatePeerBlocked tL_updatePeerBlocked) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda47(this, tL_updatePeerBlocked));
}
public void lambda$processUpdateArray$361(TLRPC.TL_updateServiceNotification tL_updateServiceNotification) {
getNotificationCenter().postNotificationName(NotificationCenter.needShowAlert, new Object[]{2, tL_updateServiceNotification.message, tL_updateServiceNotification.type});
}
public void lambda$processUpdateArray$362(TLRPC.Message message) {
getSendMessagesHelper().onMessageEdited(message);
}
public void lambda$processUpdateArray$363(TLRPC.TL_updateLangPack tL_updateLangPack) {
LocaleController.getInstance().saveRemoteLocaleStringsForCurrentLocale(tL_updateLangPack.difference, this.currentAccount);
}
public void lambda$processUpdateArray$364(ArrayList arrayList) {
getNotificationsController().processNewMessages(arrayList, true, false, (CountDownLatch) null);
}
public void lambda$processUpdateArray$365(ArrayList arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda235(this, arrayList));
}
public void lambda$processUpdateArray$366(LongSparseArray longSparseArray) {
getNotificationsController().processEditedMessages(longSparseArray);
getTopicsController().processEditedMessages(longSparseArray);
}
public void lambda$processUpdateArray$367(LongSparseArray longSparseArray) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda201(this, longSparseArray));
}
public void lambda$processUpdateArray$368(TLRPC$User tLRPC$User) {
getContactsController().addContactToPhoneBook(tLRPC$User, true);
}
public void lambda$processUpdateArray$369() {
getNotificationsController().deleteNotificationChannelGlobal(0);
}
public void lambda$processUpdateArray$370() {
getNotificationsController().deleteNotificationChannelGlobal(1);
}
public void lambda$processUpdateArray$371() {
getNotificationsController().deleteNotificationChannelGlobal(2);
}
public void lambda$processUpdateArray$372(TLRPC.TL_updateChannel tL_updateChannel) {
getChannelDifference(tL_updateChannel.channel_id, 1, 0L, null);
}
public void lambda$processUpdateArray$373(TLRPC.Chat chat) {
getNotificationCenter().postNotificationName(NotificationCenter.channelRightsUpdated, new Object[]{chat});
}
public void lambda$processUpdateArray$374(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
}
public void lambda$processUpdateArray$375(int r48, java.util.ArrayList r49, java.util.ArrayList r50, androidx.collection.LongSparseArray r51, int r52, org.telegram.messenger.support.LongSparseIntArray r53, androidx.collection.LongSparseArray r54, androidx.collection.LongSparseArray r55, java.util.ArrayList r56, androidx.collection.LongSparseArray r57, androidx.collection.LongSparseArray r58, boolean r59, java.util.ArrayList r60, java.util.ArrayList r61, androidx.collection.LongSparseArray r62, androidx.collection.LongSparseArray r63, androidx.collection.LongSparseArray r64, java.util.ArrayList r65) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processUpdateArray$375(int, java.util.ArrayList, java.util.ArrayList, androidx.collection.LongSparseArray, int, org.telegram.messenger.support.LongSparseIntArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, java.util.ArrayList, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, boolean, java.util.ArrayList, java.util.ArrayList, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, java.util.ArrayList):void");
}
public void lambda$processUpdateArray$376(org.telegram.messenger.support.LongSparseIntArray r22, org.telegram.messenger.support.LongSparseIntArray r23, android.util.SparseIntArray r24, androidx.collection.LongSparseArray r25, androidx.collection.LongSparseArray r26, androidx.collection.LongSparseArray r27, androidx.collection.LongSparseArray r28, androidx.collection.LongSparseArray r29, org.telegram.messenger.support.LongSparseIntArray r30) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$processUpdateArray$376(org.telegram.messenger.support.LongSparseIntArray, org.telegram.messenger.support.LongSparseIntArray, android.util.SparseIntArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, androidx.collection.LongSparseArray, org.telegram.messenger.support.LongSparseIntArray):void");
}
public void lambda$processUpdateArray$377(LongSparseIntArray longSparseIntArray, LongSparseIntArray longSparseIntArray2, SparseIntArray sparseIntArray, LongSparseArray longSparseArray, LongSparseArray longSparseArray2, LongSparseArray longSparseArray3, LongSparseArray longSparseArray4, LongSparseArray longSparseArray5, LongSparseIntArray longSparseIntArray3) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda357(this, longSparseIntArray, longSparseIntArray2, sparseIntArray, longSparseArray, longSparseArray2, longSparseArray3, longSparseArray4, longSparseArray5, longSparseIntArray3));
}
public void lambda$processUpdateArray$378(long j, ArrayList arrayList) {
getMessagesStorage().updateDialogsWithDeletedMessages(j, -j, arrayList, getMessagesStorage().markMessagesAsDeleted(j, arrayList, false, true, 0, 0), false);
}
public void lambda$processUpdateArray$379(long j, ArrayList arrayList, long j2) {
getMessagesStorage().updateDialogsWithDeletedMessages(j, -j, arrayList, getMessagesStorage().markMessagesAsDeleted(j, arrayList, false, true, 5, (int) j2), false);
}
public void lambda$processUpdateArray$380(long j, int i) {
getMessagesStorage().updateDialogsWithDeletedMessages(j, -j, new ArrayList(), getMessagesStorage().markMessagesAsDeleted(j, i, false, true), false);
}
public void lambda$processUpdates$350(boolean z, long j, ArrayList arrayList) {
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_USER_PRINT)});
}
updateInterfaceWithMessages(j, arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$processUpdates$351(boolean z, TLRPC.Updates updates, ArrayList arrayList) {
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_USER_PRINT)});
}
updateInterfaceWithMessages(-updates.chat_id, arrayList, 0);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void lambda$processUpdates$352(ArrayList arrayList) {
getNotificationsController().processNewMessages(arrayList, true, false, (CountDownLatch) null);
}
public void lambda$processUpdates$353(ArrayList arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda155(this, arrayList));
}
public void lambda$processUpdates$354() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_STATUS)});
}
public int lambda$processUpdatesQueue$301(TLRPC.Updates updates, TLRPC.Updates updates2) {
return AndroidUtilities.compare(getUpdateSeq(updates), getUpdateSeq(updates2));
}
public static int lambda$processUpdatesQueue$302(TLRPC.Updates updates, TLRPC.Updates updates2) {
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
public static int lambda$processUpdatesQueue$303(TLRPC.Updates updates, TLRPC.Updates updates2) {
return AndroidUtilities.compare(updates.pts, updates2.pts);
}
public void lambda$processUserInfo$141(boolean z, TLRPC$User tLRPC$User, int i, boolean z2, TLRPC.UserFull userFull, ArrayList arrayList, HashMap hashMap, int i2, boolean z3) {
if (z && System.currentTimeMillis() - this.loadedFullUsers.get(tLRPC$User.id, 0L) > 60000) {
loadFullUser(tLRPC$User, i, z2);
}
if (userFull != null) {
if (this.fullUsers.get(tLRPC$User.id) == null) {
this.fullUsers.put(tLRPC$User.id, userFull);
getTranslateController().updateDialogFull(tLRPC$User.id);
StarsController.getInstance(this.currentAccount).invalidateProfileGifts(userFull);
int indexOfKey = this.blockePeers.indexOfKey(tLRPC$User.id);
if (userFull.blocked) {
if (indexOfKey < 0) {
this.blockePeers.put(tLRPC$User.id, 1);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
} else if (indexOfKey >= 0) {
this.blockePeers.removeAt(indexOfKey);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
}
}
getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, new Object[]{Long.valueOf(tLRPC$User.id), userFull});
}
if (arrayList != null) {
getNotificationCenter().postNotificationName(NotificationCenter.pinnedInfoDidLoad, new Object[]{Long.valueOf(tLRPC$User.id), arrayList, hashMap, Integer.valueOf(i2), Boolean.valueOf(z3)});
}
}
public void lambda$putChat$53(TLRPC.Chat chat) {
getNotificationCenter().postNotificationName(NotificationCenter.channelRightsUpdated, new Object[]{chat});
}
public void lambda$putChat$54(TLRPC.Chat chat) {
getNotificationCenter().postNotificationName(NotificationCenter.chatSwitchedForum, new Object[]{Long.valueOf(chat.id), Boolean.valueOf(chat.forum), Boolean.valueOf(chat.forum_tabs)});
}
public void lambda$putUsers$52() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_STATUS)});
}
public void lambda$registerForPush$297() {
this.registeringForPush = false;
}
public void lambda$registerForPush$298(int i, String str, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof TLRPC.TL_boolTrue) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("account " + this.currentAccount + " registered for push, push type: " + i);
}
getUserConfig().registeredForPush = true;
SharedConfig.pushString = str;
SharedConfig.pushType = i;
getUserConfig().saveConfig(false);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda162(this));
}
public void lambda$reloadDialogsReadValue$58(TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.TL_updateReadChannelOutbox tL_updateReadHistoryOutbox;
TLRPC.TL_updateReadChannelInbox tL_updateReadHistoryInbox;
if (tLObject != null) {
TLRPC.TL_messages_peerDialogs tL_messages_peerDialogs = (TLRPC.TL_messages_peerDialogs) tLObject;
ArrayList<TLRPC$Update> arrayList = new ArrayList<>();
for (int i = 0; i < tL_messages_peerDialogs.dialogs.size(); i++) {
TLRPC.Dialog dialog = (TLRPC.Dialog) tL_messages_peerDialogs.dialogs.get(i);
DialogObject.initDialog(dialog);
Integer num = (Integer) this.dialogs_read_inbox_max.get(Long.valueOf(dialog.id));
if (num == null) {
num = 0;
}
this.dialogs_read_inbox_max.put(Long.valueOf(dialog.id), Integer.valueOf(Math.max(dialog.read_inbox_max_id, num.intValue())));
if (num.intValue() == 0) {
if (dialog.peer.channel_id != 0) {
tL_updateReadHistoryInbox = new TLRPC.TL_updateReadChannelInbox();
tL_updateReadHistoryInbox.channel_id = dialog.peer.channel_id;
tL_updateReadHistoryInbox.max_id = dialog.read_inbox_max_id;
tL_updateReadHistoryInbox.still_unread_count = dialog.unread_count;
} else {
tL_updateReadHistoryInbox = new TLRPC.TL_updateReadHistoryInbox();
((TLRPC.TL_updateReadHistoryInbox) tL_updateReadHistoryInbox).peer = dialog.peer;
((TLRPC.TL_updateReadHistoryInbox) tL_updateReadHistoryInbox).max_id = dialog.read_inbox_max_id;
}
arrayList.add(tL_updateReadHistoryInbox);
}
Integer num2 = (Integer) this.dialogs_read_outbox_max.get(Long.valueOf(dialog.id));
if (num2 == null) {
num2 = 0;
}
this.dialogs_read_outbox_max.put(Long.valueOf(dialog.id), Integer.valueOf(Math.max(dialog.read_outbox_max_id, num2.intValue())));
if (dialog.read_outbox_max_id > num2.intValue()) {
if (dialog.peer.channel_id != 0) {
tL_updateReadHistoryOutbox = new TLRPC.TL_updateReadChannelOutbox();
tL_updateReadHistoryOutbox.channel_id = dialog.peer.channel_id;
tL_updateReadHistoryOutbox.max_id = dialog.read_outbox_max_id;
} else {
tL_updateReadHistoryOutbox = new TLRPC.TL_updateReadHistoryOutbox();
((TLRPC.TL_updateReadHistoryOutbox) tL_updateReadHistoryOutbox).peer = dialog.peer;
((TLRPC.TL_updateReadHistoryOutbox) tL_updateReadHistoryOutbox).max_id = dialog.read_outbox_max_id;
}
arrayList.add(tL_updateReadHistoryOutbox);
}
}
if (arrayList.isEmpty()) {
return;
}
processUpdateArray(arrayList, null, null, false, 0);
}
}
public void lambda$reloadMentionsCountForChannel$209(TLRPC.InputPeer inputPeer, long j, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
if (messages_messages != null) {
int i = messages_messages.count;
if (i == 0) {
i = messages_messages.messages.size();
}
getMessagesStorage().resetMentionsCount(-inputPeer.channel_id, 0L, i);
}
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public void lambda$reloadMentionsCountForChannels$210(ArrayList arrayList) {
for (int i = 0; i < arrayList.size(); i++) {
reloadMentionsCountForChannel(getInputPeer(-((Long) arrayList.get(i)).longValue()), 0L);
}
}
public void lambda$reloadMessages$67(long j, ArrayList arrayList, ArrayList arrayList2) {
ArrayList arrayList3 = (ArrayList) this.reloadingMessages.get(j);
if (arrayList3 != null) {
arrayList3.removeAll(arrayList);
if (arrayList3.isEmpty()) {
this.reloadingMessages.remove(j);
}
}
ArrayList arrayList4 = (ArrayList) this.dialogMessage.get(j);
if (arrayList4 != null) {
for (int i = 0; i < arrayList4.size(); i++) {
MessageObject messageObject = (MessageObject) arrayList4.get(i);
int i2 = 0;
while (true) {
if (i2 < arrayList2.size()) {
MessageObject messageObject2 = (MessageObject) arrayList2.get(i2);
if (messageObject.getId() == messageObject2.getId()) {
arrayList4.set(i, messageObject2);
if (messageObject2.messageOwner.peer_id.channel_id == 0) {
MessageObject messageObject3 = this.dialogMessagesByIds.get(messageObject2.getId());
this.dialogMessagesByIds.remove(messageObject2.getId());
if (messageObject3 != null) {
this.dialogMessagesByIds.put(messageObject3.getId(), messageObject3);
}
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
} else {
i2++;
}
}
}
}
}
getNotificationCenter().postNotificationName(NotificationCenter.replaceMessagesObjects, new Object[]{Long.valueOf(j), arrayList2});
}
public void lambda$reloadMessages$68(long j, boolean z, int i, ArrayList arrayList, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
TLRPC.messages_Messages messages_messages = (TLRPC.messages_Messages) tLObject;
LongSparseArray longSparseArray = new LongSparseArray();
for (int i2 = 0; i2 < messages_messages.users.size(); i2++) {
TLRPC$User tLRPC$User = (TLRPC$User) messages_messages.users.get(i2);
longSparseArray.put(tLRPC$User.id, tLRPC$User);
}
LongSparseArray longSparseArray2 = new LongSparseArray();
for (int i3 = 0; i3 < messages_messages.chats.size(); i3++) {
TLRPC.Chat chat = (TLRPC.Chat) messages_messages.chats.get(i3);
longSparseArray2.put(chat.id, chat);
}
Integer num = (Integer) this.dialogs_read_inbox_max.get(Long.valueOf(j));
if (num == null) {
num = Integer.valueOf(getMessagesStorage().getDialogReadMax(false, j));
this.dialogs_read_inbox_max.put(Long.valueOf(j), num);
}
Integer num2 = (Integer) this.dialogs_read_outbox_max.get(Long.valueOf(j));
if (num2 == null) {
num2 = Integer.valueOf(getMessagesStorage().getDialogReadMax(true, j));
this.dialogs_read_outbox_max.put(Long.valueOf(j), num2);
}
ArrayList arrayList2 = new ArrayList();
int i4 = 0;
while (i4 < messages_messages.messages.size()) {
TLRPC.Message message = (TLRPC.Message) messages_messages.messages.get(i4);
message.dialog_id = j;
if (!z) {
message.unread = (message.out ? num2 : num).intValue() < message.id;
}
Integer num3 = num;
ArrayList arrayList3 = arrayList2;
arrayList3.add(new MessageObject(this.currentAccount, message, longSparseArray, longSparseArray2, true, true));
i4++;
arrayList2 = arrayList3;
num = num3;
}
ImageLoader.saveMessagesThumbs(messages_messages.messages);
getMessagesStorage().putMessages(messages_messages, j, -1, 0, false, i, 0L);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda62(this, j, arrayList, arrayList2));
}
}
public void lambda$reloadReactionsNotifySettings$192(TLObject tLObject) {
if (tLObject instanceof TL_account.TL_reactionsNotifySettings) {
TL_account.TL_reactionsNotifySettings tL_reactionsNotifySettings = (TL_account.TL_reactionsNotifySettings) tLObject;
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
edit.putBoolean("EnableReactionsMessages", tL_reactionsNotifySettings.messages_notify_from != null);
TL_account.ReactionNotificationsFrom reactionNotificationsFrom = tL_reactionsNotifySettings.messages_notify_from;
if (reactionNotificationsFrom != null) {
edit.putBoolean("EnableReactionsMessagesContacts", reactionNotificationsFrom instanceof TL_account.TL_reactionNotificationsFromContacts);
}
edit.putBoolean("EnableReactionsStories", tL_reactionsNotifySettings.stories_notify_from != null);
TL_account.ReactionNotificationsFrom reactionNotificationsFrom2 = tL_reactionsNotifySettings.stories_notify_from;
if (reactionNotificationsFrom2 != null) {
edit.putBoolean("EnableReactionsStoriesContacts", reactionNotificationsFrom2 instanceof TL_account.TL_reactionNotificationsFromContacts);
}
edit.putBoolean("EnableReactionsPreview", tL_reactionsNotifySettings.show_previews);
getNotificationsController().getNotificationsSettingsFacade().applySoundSettings(tL_reactionsNotifySettings.sound, edit, 0L, 0L, 4, false);
edit.apply();
getNotificationCenter().postNotificationName(NotificationCenter.notificationsSettingsUpdated, new Object[0]);
}
}
public void lambda$reloadReactionsNotifySettings$193(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda371(this, tLObject));
}
public void lambda$reloadUser$51(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject instanceof Vector) {
ArrayList arrayList = ((Vector) tLObject).objects;
ArrayList<TLRPC$User> arrayList2 = new ArrayList<>();
for (int i = 0; i < arrayList.size(); i++) {
if (arrayList.get(i) instanceof TLRPC$User) {
arrayList2.add((TLRPC$User) arrayList.get(i));
}
}
getMessagesController().putUsers(arrayList2, false);
}
}
public void lambda$reloadWebPages$175(java.util.HashMap r16, java.lang.String r17, org.telegram.tgnet.TLObject r18, androidx.collection.LongSparseArray r19, long r20, int r22) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$reloadWebPages$175(java.util.HashMap, java.lang.String, org.telegram.tgnet.TLObject, androidx.collection.LongSparseArray, long, int):void");
}
public void lambda$reloadWebPages$176(HashMap hashMap, String str, LongSparseArray longSparseArray, long j, int i, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda26(this, hashMap, str, tLObject, longSparseArray, j, i));
}
public void lambda$removeDialog$124(long j) {
long j2 = -j;
this.channelsPts.delete(j2);
this.shortPollChannels.delete(j2);
this.needShortPollChannels.delete(j2);
this.shortPollOnlines.delete(j2);
this.needShortPollOnlines.delete(j2);
}
public void lambda$removeFolderTemporarily$430(int i, boolean z) {
int i2 = 0;
while (i2 < this.dialogFilters.size()) {
if (this.dialogFilters.get(i2).id == i) {
this.dialogFilters.remove(i2);
i2--;
}
i2++;
}
this.frozenDialogFilters = null;
this.hiddenUndoChats.clear();
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
public void lambda$removeFolderTemporarily$431(boolean z) {
this.frozenDialogFilters = null;
this.hiddenUndoChats.clear();
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
}
public static void lambda$removeSuggestion$35(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public int lambda$renameSavedReactionTag$435(TLRPC.TL_savedReactionTag tL_savedReactionTag, TLRPC.TL_savedReactionTag tL_savedReactionTag2) {
int i = tL_savedReactionTag.count;
int i2 = tL_savedReactionTag2.count;
return i == i2 ? MessagesController$.ExternalSyntheticBackport7.m(getTagLongId(tL_savedReactionTag2.reaction), getTagLongId(tL_savedReactionTag.reaction)) : i2 - i;
}
public void lambda$reorderPinnedDialogs$337(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
}
}
public static void lambda$reportSpam$70(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public static void lambda$reportSpam$71(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public static void lambda$reportSpam$72(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$requestContactToken$426(Utilities.Callback callback) {
callback.run(this.cachedContactToken);
this.requestingContactToken = false;
}
public void lambda$requestContactToken$427(Utilities.Callback callback, long j, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (!(tLObject instanceof TLRPC.TL_exportedContactToken)) {
this.requestingContactToken = false;
} else {
this.cachedContactToken = (TLRPC.TL_exportedContactToken) tLObject;
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda420(this, callback), Math.max(0L, j - (System.currentTimeMillis() - j2)));
}
}
public void lambda$requestIsUserContactBlocked$445(TLObject tLObject, ArrayList arrayList) {
boolean z;
if (tLObject instanceof Vector) {
ArrayList arrayList2 = ((Vector) tLObject).objects;
z = false;
for (int i = 0; i < Math.min(arrayList.size(), arrayList2.size()); i++) {
long longValue = ((Long) arrayList.get(i)).longValue();
if (arrayList2.get(i) instanceof TL_account.RequirementToContact) {
TL_account.RequirementToContact requirementToContact = (TL_account.RequirementToContact) arrayList2.get(i);
if (!UserObject.eq((TL_account.RequirementToContact) this.cachedIsUserContactBlocked.get(longValue), requirementToContact)) {
if (requirementToContact == null || (requirementToContact instanceof TL_account.requirementToContactEmpty)) {
this.cachedIsUserContactBlocked.remove(longValue);
} else {
this.cachedIsUserContactBlocked.put(longValue, requirementToContact);
}
z = true;
}
TLRPC.UserFull userFull = getUserFull(longValue);
if (userFull != null && UserObject.applyRequirementToContact(userFull, requirementToContact)) {
getMessagesStorage().updateUserInfo(userFull, true);
} else if (userFull == null) {
getMessagesStorage().updateUserInfoContactBlocked(longValue, requirementToContact);
}
z = true;
}
}
} else {
z = false;
}
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.userIsPremiumBlockedUpadted, new Object[0]);
}
}
public void lambda$requestIsUserContactBlocked$446(ArrayList arrayList, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda377(this, tLObject, arrayList));
}
public void lambda$resetDialogs$197(int i, int i2, int i3, int i4, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
this.resetDialogsPinned = (TLRPC.TL_messages_peerDialogs) tLObject;
for (int i5 = 0; i5 < this.resetDialogsPinned.dialogs.size(); i5++) {
((TLRPC.Dialog) this.resetDialogsPinned.dialogs.get(i5)).pinned = true;
}
resetDialogs(false, i, i2, i3, i4);
}
}
public void lambda$resetDialogs$198(int i, int i2, int i3, int i4, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
this.resetDialogsAll = (TLRPC.messages_Dialogs) tLObject;
resetDialogs(false, i, i2, i3, i4);
}
}
public void lambda$saveGif$136(Object obj, TLRPC.TL_messages_saveGif tL_messages_saveGif, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null || !FileRefController.isFileRefError(tL_error.text)) {
return;
}
getFileRefController().requestReference(obj, new Object[]{tL_messages_saveGif});
}
public void lambda$saveRecentSticker$137(Object obj, TLRPC.TL_messages_saveRecentSticker tL_messages_saveRecentSticker, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null || !FileRefController.isFileRefError(tL_error.text)) {
return;
}
getFileRefController().requestReference(obj, new Object[]{tL_messages_saveRecentSticker});
}
public void lambda$saveSavedReactionsTags$440(long j, TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags) {
SQLiteDatabase database = getMessagesStorage().getDatabase();
SQLitePreparedStatement sQLitePreparedStatement = null;
try {
try {
database.executeFast("DELETE FROM saved_reaction_tags WHERE topic_id = " + j).stepThis().dispose();
sQLitePreparedStatement = database.executeFast("REPLACE INTO saved_reaction_tags VALUES(?, ?)");
sQLitePreparedStatement.requery();
NativeByteBuffer nativeByteBuffer = new NativeByteBuffer(tL_messages_savedReactionsTags.getObjectSize());
tL_messages_savedReactionsTags.serializeToStream(nativeByteBuffer);
sQLitePreparedStatement.bindLong(1, j);
sQLitePreparedStatement.bindByteBuffer(2, nativeByteBuffer);
sQLitePreparedStatement.step();
} catch (Exception e) {
FileLog.e(e);
if (sQLitePreparedStatement == null) {
return;
}
}
sQLitePreparedStatement.dispose();
} catch (Throwable th) {
if (sQLitePreparedStatement != null) {
sQLitePreparedStatement.dispose();
}
throw th;
}
}
public static void lambda$saveTheme$111(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$saveThemeToServer$114(String str, String str2, Theme.ThemeAccent themeAccent, Theme.ThemeInfo themeInfo) {
if (str == null) {
this.uploadingThemes.remove(str2);
return;
}
this.uploadingThemes.put(str, themeAccent != null ? themeAccent : themeInfo);
if (themeAccent == null) {
themeInfo.uploadingFile = str2;
themeInfo.uploadingThumb = str;
} else {
themeAccent.uploadingFile = str2;
themeAccent.uploadingThumb = str;
}
getFileLoader().uploadFile(str2, false, true, ConnectionsManager.FileTypeFile);
getFileLoader().uploadFile(str, false, true, ConnectionsManager.FileTypePhoto);
}
public void lambda$saveThemeToServer$115(String str, File file, Theme.ThemeAccent themeAccent, Theme.ThemeInfo themeInfo) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda54(this, Theme.createThemePreviewImage(str, file != null ? file.getAbsolutePath() : null, themeAccent), str, themeAccent, themeInfo));
}
public void lambda$saveWallpaperToServer$116(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
getMessagesStorage().removePendingTask(j);
}
public void lambda$scheduleTranscriptionUpdate$33() {
AndroidUtilities.cancelRunOnUIThread(this.notifyTranscriptionAudioCooldownUpdate);
long currentTime = this.transcribeAudioTrialCooldownUntil - getConnectionsManager().getCurrentTime();
if (currentTime > 0) {
AndroidUtilities.runOnUIThread(this.notifyTranscriptionAudioCooldownUpdate, currentTime);
}
}
public void lambda$sendBotStart$270(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
}
public void lambda$sendLoadPeersRequest$16(java.util.ArrayList r12, java.util.ArrayList r13, org.telegram.tgnet.TLRPC.messages_Dialogs r14, org.telegram.tgnet.TLRPC.messages_Dialogs r15, java.util.ArrayList r16, org.telegram.tgnet.TLObject r17, java.util.ArrayList r18, android.util.SparseArray r19, java.util.ArrayList r20, java.util.HashMap r21, java.util.HashSet r22, java.lang.Runnable r23, org.telegram.tgnet.TLObject r24, org.telegram.tgnet.TLRPC.TL_error r25) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$sendLoadPeersRequest$16(java.util.ArrayList, java.util.ArrayList, org.telegram.tgnet.TLRPC$messages_Dialogs, org.telegram.tgnet.TLRPC$messages_Dialogs, java.util.ArrayList, org.telegram.tgnet.TLObject, java.util.ArrayList, android.util.SparseArray, java.util.ArrayList, java.util.HashMap, java.util.HashSet, java.lang.Runnable, org.telegram.tgnet.TLObject, org.telegram.tgnet.TLRPC$TL_error):void");
}
public void lambda$sendTyping$162(int i, long j, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda469(this, i, j, j2));
}
public void lambda$sendTyping$164(int i, long j, long j2, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda153(this, i, j, j2));
}
public void lambda$setBoostsToUnblockRestrictions$89(long j) {
loadFullChat(j, 0, true);
}
public void lambda$setBoostsToUnblockRestrictions$90(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
getMessagesController().processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda202(this, j), 1000L);
}
}
public void lambda$setChannelSlowMode$87(long j) {
loadFullChat(j, 0, true);
}
public void lambda$setChannelSlowMode$88(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
getMessagesController().processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda64(this, j), 1000L);
}
}
public void lambda$setChatReactions$421(long j) {
getNotificationCenter().postNotificationName(NotificationCenter.chatAvailableReactionsUpdated, new Object[]{Long.valueOf(j), 0L});
}
public void lambda$setChatReactions$422(long j, TLRPC.TL_messages_setChatAvailableReactions tL_messages_setChatAvailableReactions, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
TLRPC.ChatFull chatFull = getChatFull(j);
if (chatFull != null) {
if (chatFull instanceof TLRPC.TL_chatFull) {
chatFull.flags |= 262144;
}
if (chatFull instanceof TLRPC.TL_channelFull) {
chatFull.flags |= 1073741824;
}
chatFull.available_reactions = tL_messages_setChatAvailableReactions.available_reactions;
getMessagesStorage().updateChatInfo(chatFull, false);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda171(this, j));
}
}
public static void lambda$setContentSettings$454(TLRPC.TL_error tL_error) {
if (tL_error != null) {
BulletinFactory.showError(tL_error);
}
}
public static void lambda$setContentSettings$455(TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda192(tL_error));
}
public void lambda$setCustomChatReactions$418(Runnable runnable, long j) {
if (runnable != null) {
runnable.run();
}
getNotificationCenter().postNotificationName(NotificationCenter.chatAvailableReactionsUpdated, new Object[]{Long.valueOf(j), 0L});
}
public static void lambda$setCustomChatReactions$419(Utilities.Callback callback, TLRPC.TL_error tL_error) {
if (callback != null) {
callback.run(tL_error);
}
}
public void lambda$setCustomChatReactions$420(long j, TLRPC.TL_messages_setChatAvailableReactions tL_messages_setChatAvailableReactions, Runnable runnable, Utilities.Callback callback, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda167(callback, tL_error));
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
TLRPC.ChatFull chatFull = getChatFull(j);
if (chatFull != null) {
if (chatFull instanceof TLRPC.TL_chatFull) {
chatFull.flags |= 262144;
}
if (chatFull instanceof TLRPC.TL_channelFull) {
chatFull.flags |= 1073741824;
}
chatFull.available_reactions = tL_messages_setChatAvailableReactions.available_reactions;
getMessagesStorage().updateChatInfo(chatFull, false);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda166(this, runnable, j));
}
public void lambda$setDefaultBannedRole$91(long j) {
loadFullChat(j, 0, true);
}
public void lambda$setDefaultBannedRole$92(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_messages_editChatDefaultBannedRights tL_messages_editChatDefaultBannedRights, boolean z) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_messages_editChatDefaultBannedRights, new Object[]{Boolean.valueOf(z)});
}
public void lambda$setDefaultBannedRole$93(long j, BaseFragment baseFragment, TLRPC.TL_messages_editChatDefaultBannedRights tL_messages_editChatDefaultBannedRights, boolean z, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda161(this, tL_error, baseFragment, tL_messages_editChatDefaultBannedRights, z));
} else {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda160(this, j), 1000L);
}
}
public void lambda$setDefaultSendAs$253(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
long j2;
if (tLObject instanceof TLRPC.TL_boolTrue) {
j2 = -j;
if (getChatFull(j2) != null) {
return;
}
} else if (tL_error == null || tL_error.code != 400) {
return;
} else {
j2 = -j;
}
loadFullChat(j2, 0, true);
}
public void lambda$setDialogHistoryTTL$127(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
}
}
public void lambda$setLastCreatedDialogId$50(boolean z, boolean z2, long j) {
ArrayList<Long> arrayList = z ? this.createdScheduledDialogIds : this.createdDialogIds;
if (!z2) {
arrayList.remove(Long.valueOf(j));
} else {
if (arrayList.contains(Long.valueOf(j))) {
return;
}
arrayList.add(Long.valueOf(j));
}
}
public void lambda$setParticipantBannedRole$84(long j) {
loadFullChat(j, 0, true);
}
public void lambda$setParticipantBannedRole$85(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_channels_editBanned tL_channels_editBanned, boolean z) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_channels_editBanned, new Object[]{Boolean.valueOf(z)});
}
public void lambda$setParticipantBannedRole$86(long j, Runnable runnable, BaseFragment baseFragment, TLRPC.TL_channels_editBanned tL_channels_editBanned, boolean z, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda120(this, tL_error, baseFragment, tL_channels_editBanned, z));
return;
}
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda119(this, j), 1000L);
if (runnable != null) {
AndroidUtilities.runOnUIThread(runnable);
}
}
public void lambda$setUserAdminRole$100(long j, Runnable runnable) {
loadFullChat(j, 0, true);
if (runnable != null) {
runnable.run();
}
}
public void lambda$setUserAdminRole$101(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_messages_editChatAdmin tL_messages_editChatAdmin) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_messages_editChatAdmin, new Object[]{Boolean.FALSE});
}
public void lambda$setUserAdminRole$103(long j, Runnable runnable, BaseFragment baseFragment, TLRPC.TL_messages_editChatAdmin tL_messages_editChatAdmin, ErrorDelegate errorDelegate, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda226(this, j, runnable), 1000L);
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda227(this, tL_error, baseFragment, tL_messages_editChatAdmin));
if (errorDelegate != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda228(errorDelegate, tL_error));
}
}
public void lambda$setUserAdminRole$104(TLRPC.TL_messages_editChatAdmin tL_messages_editChatAdmin, RequestDelegate requestDelegate) {
getConnectionsManager().sendRequest(tL_messages_editChatAdmin, requestDelegate);
}
public void lambda$setUserAdminRole$94(long j, Runnable runnable) {
loadFullChat(j, 0, true);
if (runnable != null) {
runnable.run();
}
}
public void lambda$setUserAdminRole$95(TLRPC$User tLRPC$User, TLRPC.Chat chat, ErrorDelegate errorDelegate, TLRPC.TL_error tL_error) {
BaseFragment lastFragment = LaunchActivity.getLastFragment();
if (lastFragment != null && lastFragment.getParentActivity() != null) {
LimitReachedBottomSheet limitReachedBottomSheet = new LimitReachedBottomSheet(lastFragment, lastFragment.getParentActivity(), 11, this.currentAccount, (Theme.ResourcesProvider) null);
ArrayList arrayList = new ArrayList();
arrayList.add(tLRPC$User);
limitReachedBottomSheet.setRestrictedUsers(chat, arrayList, (ArrayList) null, (ArrayList) null, (String) null);
limitReachedBottomSheet.show();
}
errorDelegate.run(tL_error);
}
public void lambda$setUserAdminRole$96(TLRPC.TL_error tL_error, BaseFragment baseFragment, TLRPC.TL_channels_editAdmin tL_channels_editAdmin, boolean z) {
AlertsCreator.processError(this.currentAccount, tL_error, baseFragment, tL_channels_editAdmin, new Object[]{Boolean.valueOf(z)});
}
public void lambda$setUserAdminRole$98(long j, Runnable runnable, TLRPC.Chat chat, TLRPC$User tLRPC$User, ErrorDelegate errorDelegate, BaseFragment baseFragment, TLRPC.TL_channels_editAdmin tL_channels_editAdmin, boolean z, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda266(this, j, runnable), 1000L);
} else {
if ("USER_PRIVACY_RESTRICTED".equals(tL_error.text) && ChatObject.canUserDoAdminAction(chat, 3)) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda267(this, tLRPC$User, chat, errorDelegate, tL_error));
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda268(this, tL_error, baseFragment, tL_channels_editAdmin, z));
if (errorDelegate != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda269(errorDelegate, tL_error));
}
}
}
public void lambda$setUserAdminRole$99(TLRPC.TL_channels_editAdmin tL_channels_editAdmin, RequestDelegate requestDelegate) {
getConnectionsManager().sendRequest(tL_channels_editAdmin, requestDelegate);
}
public static void lambda$startShortPoll$305(Consumer consumer) {
consumer.accept(Boolean.TRUE);
}
public static void lambda$startShortPoll$306(Consumer consumer) {
consumer.accept(Boolean.FALSE);
}
public void lambda$startShortPoll$307(TLRPC.Chat chat, boolean z, int i, Consumer consumer) {
ArrayList arrayList = (ArrayList) this.needShortPollChannels.get(chat.id);
ArrayList arrayList2 = (ArrayList) this.needShortPollOnlines.get(chat.id);
if (z) {
if (arrayList != null) {
arrayList.remove(Integer.valueOf(i));
}
if (arrayList == null || arrayList.isEmpty()) {
this.needShortPollChannels.delete(chat.id);
}
if (chat.megagroup) {
if (arrayList2 != null) {
arrayList2.remove(Integer.valueOf(i));
}
if (arrayList2 == null || arrayList2.isEmpty()) {
this.needShortPollOnlines.delete(chat.id);
return;
}
return;
}
return;
}
if (arrayList == null) {
arrayList = new ArrayList();
this.needShortPollChannels.put(chat.id, arrayList);
}
if (!arrayList.contains(Integer.valueOf(i))) {
arrayList.add(Integer.valueOf(i));
}
if (this.shortPollChannels.indexOfKey(chat.id) < 0) {
if (consumer != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda342(consumer));
}
getChannelDifference(chat.id, 3, 0L, null);
} else if (consumer != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda343(consumer));
}
if (!chat.megagroup || chat.monoforum) {
return;
}
if (arrayList2 == null) {
arrayList2 = new ArrayList();
this.needShortPollOnlines.put(chat.id, arrayList2);
}
if (!arrayList2.contains(Integer.valueOf(i))) {
arrayList2.add(Integer.valueOf(i));
}
if (this.shortPollOnlines.indexOfKey(chat.id) < 0) {
this.shortPollOnlines.put(chat.id, 0);
}
}
public void lambda$toggleChannelForum$262() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChannelForum$263(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda402(this));
}
}
public void lambda$toggleChannelInvitesHistory$264() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChannelInvitesHistory$265(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda344(this));
}
}
public void lambda$toggleChannelSignatures$260() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChannelSignatures$261(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda400(this));
}
}
public void lambda$toggleChatJoinRequest$258() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChatJoinRequest$259(Runnable runnable, Runnable runnable2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda472(this));
if (runnable == null) {
return;
}
} else if (tL_error != null && !"CHAT_NOT_MODIFIED".equals(tL_error.text)) {
if (runnable2 != null) {
runnable2.run();
return;
}
return;
} else if (runnable == null) {
return;
}
runnable.run();
}
public void lambda$toggleChatJoinToSend$256() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChatJoinToSend$257(Runnable runnable, Runnable runnable2, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda205(this));
if (runnable == null) {
return;
}
} else if (tL_error != null && !"CHAT_NOT_MODIFIED".equals(tL_error.text)) {
if (runnable2 != null) {
runnable2.run();
return;
}
return;
} else if (runnable == null) {
return;
}
runnable.run();
}
public void lambda$toggleChatNoForwards$254() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
}
public void lambda$toggleChatNoForwards$255(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
processUpdates((TLRPC.Updates) tLObject, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda172(this));
}
}
public static void lambda$unblockPeer$105(Runnable runnable) {
if (runnable != null) {
runnable.run();
}
}
public static void lambda$unblockPeer$106(Runnable runnable, TLObject tLObject, TLRPC.TL_error tL_error) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda211(runnable));
}
public void lambda$unpinAllMessages$121(TLRPC.Chat chat, TLRPC$User tLRPC$User, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_affectedHistory tL_messages_affectedHistory = (TLRPC.TL_messages_affectedHistory) tLObject;
if (ChatObject.isChannel(chat)) {
processNewChannelDifferenceParams(tL_messages_affectedHistory.pts, tL_messages_affectedHistory.pts_count, chat.id);
} else {
processNewDifferenceParams(-1, tL_messages_affectedHistory.pts, -1, tL_messages_affectedHistory.pts_count);
}
new ArrayList();
getMessagesStorage().updatePinnedMessages(chat != null ? -chat.id : tLRPC$User.id, (ArrayList) null, false, 0, 0, false, (HashMap) null);
}
}
public static void lambda$unregistedPush$294(TLObject tLObject, TLRPC.TL_error tL_error) {
}
public void lambda$updateChannelUserName$268(long j, String str, Runnable runnable) {
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (chat.usernames != null) {
for (int i = 0; i < chat.usernames.size(); i++) {
TLRPC.TL_username tL_username = (TLRPC.TL_username) chat.usernames.get(i);
if (tL_username != null && tL_username.editable) {
tL_username.username = str;
break;
}
}
}
ArrayList arrayList = chat.usernames;
if (arrayList == null || arrayList.size() >= 1) {
if (chat.usernames == null) {
chat.usernames = new ArrayList();
}
TLRPC.TL_username tL_username2 = new TLRPC.TL_username();
tL_username2.username = str;
tL_username2.active = true;
tL_username2.editable = true;
chat.usernames.add(0, tL_username2);
} else {
chat.username = str;
}
ArrayList arrayList2 = new ArrayList();
arrayList2.add(chat);
getMessagesStorage().putUsersAndChats((List) null, arrayList2, true, true);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_CHAT)});
if (runnable != null) {
runnable.run();
}
}
public void lambda$updateChannelUserName$269(long j, String str, Runnable runnable, BaseFragment baseFragment, TLRPC.TL_channels_updateUsername tL_channels_updateUsername, Runnable runnable2, TLObject tLObject, TLRPC.TL_error tL_error) {
if ((tLObject instanceof TLRPC.TL_boolTrue) || (tL_error != null && "USERNAME_NOT_MODIFIED".equals(tL_error.text))) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda170(this, j, str, runnable));
return;
}
AlertsCreator.processError(UserConfig.selectedAccount, tL_error, baseFragment, tL_channels_updateUsername, new Object[0]);
if (runnable2 != null) {
runnable2.run();
}
}
public void lambda$updateChatAbout$266(TLRPC.ChatFull chatFull, String str) {
chatFull.about = str;
getMessagesStorage().updateChatInfo(chatFull, false);
NotificationCenter notificationCenter = getNotificationCenter();
int i = NotificationCenter.chatInfoDidLoad;
Boolean bool = Boolean.FALSE;
notificationCenter.postNotificationName(i, new Object[]{chatFull, 0, bool, bool});
}
public void lambda$updateChatAbout$267(TLRPC.ChatFull chatFull, String str, TLObject tLObject, TLRPC.TL_error tL_error) {
if (!(tLObject instanceof TLRPC.TL_boolTrue) || chatFull == null) {
return;
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda263(this, chatFull, str));
}
public void lambda$updateConfig$36(org.telegram.tgnet.TLRPC.TL_config r13) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$updateConfig$36(org.telegram.tgnet.TLRPC$TL_config):void");
}
public void lambda$updateEmojiStatusUntil$425() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_EMOJI_STATUS)});
updateEmojiStatusUntil();
}
public void lambda$updateInterfaceWithMessages$396(TLRPC.Dialog dialog, int i, long j, int i2) {
if (i2 == -1) {
if (i <= 0 || DialogObject.isEncryptedDialog(j)) {
return;
}
loadUnknownDialog(getInputPeer(j), 0L);
return;
}
if (i2 != 0) {
dialog.folder_id = i2;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
}
public void lambda$updatePrintingStrings$160(LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
this.printingStrings = longSparseArray;
this.printingStringsTypes = longSparseArray2;
}
public int lambda$updateSavedReactionTags$434(TLRPC.TL_savedReactionTag tL_savedReactionTag, TLRPC.TL_savedReactionTag tL_savedReactionTag2) {
int i = tL_savedReactionTag.count;
int i2 = tL_savedReactionTag2.count;
return i == i2 ? MessagesController$.ExternalSyntheticBackport7.m(getTagLongId(tL_savedReactionTag2.reaction), getTagLongId(tL_savedReactionTag.reaction)) : i2 - i;
}
public void lambda$updateTimerProc$142(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_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$143(TLObject tLObject, TLRPC.TL_error tL_error) {
if (tL_error == null) {
this.offlineSent = true;
} else {
long j = this.lastStatusUpdateTime;
if (j != 0) {
this.lastStatusUpdateTime = j + 5000;
}
}
this.statusRequest = 0;
}
public void lambda$updateTimerProc$144(TLRPC.TL_messages_messageViews tL_messages_messageViews, LongSparseArray longSparseArray, LongSparseArray longSparseArray2, LongSparseArray longSparseArray3) {
putUsers(tL_messages_messageViews.users, false);
putChats(tL_messages_messageViews.chats, false);
getNotificationCenter().postNotificationName(NotificationCenter.didUpdateMessagesViews, new Object[]{longSparseArray, longSparseArray2, longSparseArray3, Boolean.FALSE});
}
public void lambda$updateTimerProc$145(long j, TLRPC.TL_messages_getMessagesViews tL_messages_getMessagesViews, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_messages_messageViews tL_messages_messageViews = (TLRPC.TL_messages_messageViews) tLObject;
LongSparseArray longSparseArray = new LongSparseArray();
LongSparseArray longSparseArray2 = new LongSparseArray();
LongSparseArray longSparseArray3 = new LongSparseArray();
SparseIntArray sparseIntArray = (SparseIntArray) longSparseArray.get(j);
SparseIntArray sparseIntArray2 = (SparseIntArray) longSparseArray2.get(j);
SparseArray sparseArray = (SparseArray) longSparseArray3.get(j);
for (int i = 0; i < tL_messages_getMessagesViews.id.size() && i < tL_messages_messageViews.views.size(); i++) {
TLRPC.TL_messageViews tL_messageViews = (TLRPC.TL_messageViews) tL_messages_messageViews.views.get(i);
if ((1 & tL_messageViews.flags) != 0) {
if (sparseIntArray == null) {
sparseIntArray = new SparseIntArray();
longSparseArray.put(j, sparseIntArray);
}
sparseIntArray.put(((Integer) tL_messages_getMessagesViews.id.get(i)).intValue(), tL_messageViews.views);
}
if ((tL_messageViews.flags & 2) != 0) {
if (sparseIntArray2 == null) {
sparseIntArray2 = new SparseIntArray();
longSparseArray2.put(j, sparseIntArray2);
}
sparseIntArray2.put(((Integer) tL_messages_getMessagesViews.id.get(i)).intValue(), tL_messageViews.forwards);
}
if ((tL_messageViews.flags & 4) != 0) {
if (sparseArray == null) {
sparseArray = new SparseArray();
longSparseArray3.put(j, sparseArray);
}
sparseArray.put(((Integer) tL_messages_getMessagesViews.id.get(i)).intValue(), tL_messageViews.replies);
}
}
getMessagesStorage().putUsersAndChats(tL_messages_messageViews.users, tL_messages_messageViews.chats, true, true);
getMessagesStorage().putChannelViews(longSparseArray, longSparseArray2, longSparseArray3, false);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda453(this, tL_messages_messageViews, longSparseArray, longSparseArray2, longSparseArray3));
}
}
public void lambda$updateTimerProc$146(boolean z, TLObject tLObject, TLRPC.TL_error tL_error) {
TLRPC.Poll poll;
if (tL_error == null) {
TLRPC.Updates updates = (TLRPC.Updates) tLObject;
if (z) {
for (int i = 0; i < updates.updates.size(); i++) {
TLRPC.TL_updateMessagePoll tL_updateMessagePoll = (TLRPC$Update) updates.updates.get(i);
if ((tL_updateMessagePoll instanceof TLRPC.TL_updateMessagePoll) && (poll = tL_updateMessagePoll.poll) != null && !poll.closed) {
this.lastViewsCheckTime = System.currentTimeMillis() - 4000;
}
}
}
processUpdates(updates, false);
}
}
public void lambda$updateTimerProc$147(int r19) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.lambda$updateTimerProc$147(int):void");
}
public void lambda$updateTimerProc$148() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_STATUS)});
}
public void lambda$updateTimerProc$149(long j, TLRPC.TL_chatOnlines tL_chatOnlines) {
getNotificationCenter().postNotificationName(NotificationCenter.chatOnlineCountDidLoad, new Object[]{Long.valueOf(j), Integer.valueOf(tL_chatOnlines.onlines)});
}
public void lambda$updateTimerProc$150(long j, TLObject tLObject, TLRPC.TL_error tL_error) {
if (tLObject != null) {
TLRPC.TL_chatOnlines tL_chatOnlines = (TLRPC.TL_chatOnlines) tLObject;
getMessagesStorage().updateChatOnlineCount(j, tL_chatOnlines.onlines);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda174(this, j, tL_chatOnlines));
}
}
public void lambda$updateTimerProc$151() {
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_USER_PRINT)});
}
public void loadMessagesInternal(long j, long j2, boolean z, int i, int i2, int i3, boolean z2, int i4, int i5, int i6, int i7, int i8, long j3, int i9, int i10, int i11, int i12, boolean z3, int i13, boolean z4, boolean z5, boolean z6, Timer timer, long j4) {
Timer timer2;
int i14;
RequestDelegate externalSyntheticLambda411;
ConnectionsManager connectionsManager;
TLObject tLObject;
int i15;
int i16;
int i17;
int i18;
TLRPC.TL_forumTopic findTopic;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("load messages in chat " + j + " topic_id " + j3 + " count " + i + " max_id " + i2 + " cache " + z2 + " mindate = " + i4 + " guid " + i5 + " load_type " + i6 + " last_message_id " + i7 + " mode " + i8 + " index " + i9 + " firstUnread " + i10 + " unread_count " + i11 + " last_date " + i12 + " queryFromServer " + z3 + " isTopic " + z6);
}
if (BuildVars.LOGS_ENABLED && timer == null && i8 == 0) {
timer2 = new Timer("MessageLoaderLogger dialogId=" + j + " index=" + i9 + " count=" + i);
} else {
timer2 = timer;
}
if ((j3 == 0 || z6 || i8 == 8 || i8 == 3 || i8 == 5) && i8 != 2 && (z2 || DialogObject.isEncryptedDialog(j))) {
getMessagesStorage().getMessages(j, j2, z, i, i2, i3, i4, i5, i6, i8, j3, i9, z5, z6, timer2);
return;
}
TLRPC.Chat chat = j < 0 ? getChat(Long.valueOf(-j)) : null;
if (i8 == 5) {
TLRPC.TL_messages_getQuickReplyMessages tL_messages_getQuickReplyMessages = new TLRPC.TL_messages_getQuickReplyMessages();
tL_messages_getQuickReplyMessages.shortcut_id = (int) j3;
tL_messages_getQuickReplyMessages.hash = j4;
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_messages_getQuickReplyMessages, new MessagesController$.ExternalSyntheticLambda408(this, j, j2, i, i2, i3, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6)), i5);
return;
}
if (j3 != 0) {
if (i8 == 3 || ChatObject.isMonoForum(chat)) {
TLRPC.TL_messages_getSavedHistory tL_messages_getSavedHistory = new TLRPC.TL_messages_getSavedHistory();
tL_messages_getSavedHistory.peer = getInputPeer(j3);
if (ChatObject.isMonoForum(chat)) {
tL_messages_getSavedHistory.parent_peer = getInputPeer(j);
}
if (i6 == 4) {
i15 = (-i) + 5;
} else {
if (i6 != 3) {
if (i6 == 1) {
tL_messages_getSavedHistory.add_offset = (-i) - 1;
} else if (i6 == 2 && i2 != 0) {
i15 = (-i) + 6;
} else if (j < 0 && i2 != 0 && ChatObject.isChannel(chat)) {
tL_messages_getSavedHistory.add_offset = -1;
tL_messages_getSavedHistory.limit++;
}
tL_messages_getSavedHistory.limit = i;
tL_messages_getSavedHistory.offset_id = i2;
tL_messages_getSavedHistory.offset_date = i3;
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_messages_getSavedHistory, new MessagesController$.ExternalSyntheticLambda410(this, j, i, i2, i3, j2, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6, tL_messages_getSavedHistory)), i5);
return;
}
i15 = (-i) / 2;
}
tL_messages_getSavedHistory.add_offset = i15;
tL_messages_getSavedHistory.limit = i;
tL_messages_getSavedHistory.offset_id = i2;
tL_messages_getSavedHistory.offset_date = i3;
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_messages_getSavedHistory, new MessagesController$.ExternalSyntheticLambda410(this, j, i, i2, i3, j2, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6, tL_messages_getSavedHistory)), i5);
return;
}
if (z4 && z6 && i6 == 2 && i7 == 0 && (findTopic = this.topicsController.findTopic(-j, j3)) != null) {
loadMessagesInternal(j, j2, z, i, i2, i3, false, i4, i5, i6, findTopic.top_message, i8, j3, i9, i10, findTopic.unread_count, i12, z3, findTopic.unread_mentions_count, false, z5, z6, timer2, 0L);
return;
}
if (i8 != 0) {
return;
}
TLObject tL_messages_getReplies = new TLRPC.TL_messages_getReplies();
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).peer = getInputPeer(j);
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).msg_id = (int) j3;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).offset_date = i3;
if (i6 == 4) {
i16 = i;
i18 = (-i16) + 5;
} else {
i16 = i;
if (i6 == 3) {
i18 = (-i16) / 2;
} else if (i6 == 1) {
i18 = (-i16) - 1;
} else {
if (i6 == 2) {
i17 = i2;
if (i17 != 0) {
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).add_offset = (-i16) + 10;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).limit = i16;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).offset_id = i17;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).hash = j4;
System.currentTimeMillis();
ConnectionsManager connectionsManager2 = getConnectionsManager();
tLObject = tL_messages_getReplies;
externalSyntheticLambda411 = new MessagesController$.ExternalSyntheticLambda409(this, i, i2, i3, i10, i6, j, j2, i5, i7, i11, i12, i8, j3, i9, z3, i13, z5, z6, tL_messages_getReplies);
connectionsManager = connectionsManager2;
}
} else {
i17 = i2;
}
if (j < 0 && i17 != 0 && ChatObject.isChannel(chat)) {
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).add_offset = -1;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).limit++;
}
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).limit = i16;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).offset_id = i17;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).hash = j4;
System.currentTimeMillis();
ConnectionsManager connectionsManager22 = getConnectionsManager();
tLObject = tL_messages_getReplies;
externalSyntheticLambda411 = new MessagesController$.ExternalSyntheticLambda409(this, i, i2, i3, i10, i6, j, j2, i5, i7, i11, i12, i8, j3, i9, z3, i13, z5, z6, tL_messages_getReplies);
connectionsManager = connectionsManager22;
}
}
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).add_offset = i18;
i17 = i2;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).limit = i16;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).offset_id = i17;
((TLRPC.TL_messages_getReplies) tL_messages_getReplies).hash = j4;
System.currentTimeMillis();
ConnectionsManager connectionsManager222 = getConnectionsManager();
tLObject = tL_messages_getReplies;
externalSyntheticLambda411 = new MessagesController$.ExternalSyntheticLambda409(this, i, i2, i3, i10, i6, j, j2, i5, i7, i11, i12, i8, j3, i9, z3, i13, z5, z6, tL_messages_getReplies);
connectionsManager = connectionsManager222;
} else {
if (i8 == 2) {
return;
}
if (i8 != 1) {
if (!ChatObject.isMonoForum(chat) && z4 && ((i6 == 3 || i6 == 2) && i7 == 0)) {
TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.InputPeer inputPeer = getInputPeer(j);
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer;
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer);
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda412(this, j, j2, z, i, i2, i3, i4, i5, i6, j3, i9, i10, i12, z3, z5, z6, tL_messages_getPeerDialogs));
return;
}
TLRPC.TL_messages_getHistory tL_messages_getHistory = new TLRPC.TL_messages_getHistory();
tL_messages_getHistory.peer = getInputPeer(j);
if (i6 == 4) {
i14 = (-i) + 5;
} else {
if (i6 != 3) {
if (i6 == 1) {
tL_messages_getHistory.add_offset = (-i) - 1;
} else if (i6 == 2 && i2 != 0) {
i14 = (-i) + 6;
} else if (j < 0 && i2 != 0 && ChatObject.isChannel(chat)) {
tL_messages_getHistory.add_offset = -1;
tL_messages_getHistory.limit++;
}
tL_messages_getHistory.limit = i;
tL_messages_getHistory.offset_id = i2;
tL_messages_getHistory.offset_date = i3;
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_messages_getHistory, new MessagesController$.ExternalSyntheticLambda413(this, j, i, i2, i3, j2, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6, tL_messages_getHistory)), i5);
return;
}
i14 = (-i) / 2;
}
tL_messages_getHistory.add_offset = i14;
tL_messages_getHistory.limit = i;
tL_messages_getHistory.offset_id = i2;
tL_messages_getHistory.offset_date = i3;
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_messages_getHistory, new MessagesController$.ExternalSyntheticLambda413(this, j, i, i2, i3, j2, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6, tL_messages_getHistory)), i5);
return;
}
TLObject tL_messages_getScheduledHistory = new TLRPC.TL_messages_getScheduledHistory();
((TLRPC.TL_messages_getScheduledHistory) tL_messages_getScheduledHistory).peer = getInputPeer(j);
((TLRPC.TL_messages_getScheduledHistory) tL_messages_getScheduledHistory).hash = j4;
ConnectionsManager connectionsManager3 = getConnectionsManager();
externalSyntheticLambda411 = new MessagesController$.ExternalSyntheticLambda411(this, i2, i3, j, j2, i, i5, i10, i7, i11, i12, i6, i8, j3, i9, z3, i13, z5, z6);
connectionsManager = connectionsManager3;
tLObject = tL_messages_getScheduledHistory;
}
getConnectionsManager().bindRequestToGuid(connectionsManager.sendRequest(tLObject, externalSyntheticLambda411), i5);
}
private void loadPremiumFeaturesPreviewOrder(SparseIntArray sparseIntArray, String str) {
sparseIntArray.clear();
if (str != null) {
String[] split = str.split("_");
for (int i = 0; i < split.length; i++) {
sparseIntArray.put(Integer.parseInt(split[i]), i);
}
}
}
private int messagesMaxDate(ArrayList<MessageObject> arrayList) {
TLRPC.Message message;
int i;
int i2 = Integer.MIN_VALUE;
for (int i3 = 0; arrayList != null && i3 < arrayList.size(); i3++) {
MessageObject messageObject = arrayList.get(i3);
if (messageObject != null && (message = messageObject.messageOwner) != null && (i = message.date) > i2) {
i2 = i;
}
}
return i2;
}
private void migrateDialogs(int i, int i2, long j, long j2, long j3, long j4) {
if (this.migratingDialogs || i == -1) {
return;
}
this.migratingDialogs = true;
TLRPC.TL_messages_getDialogs tL_messages_getDialogs = new TLRPC.TL_messages_getDialogs();
tL_messages_getDialogs.exclude_pinned = true;
tL_messages_getDialogs.limit = 100;
tL_messages_getDialogs.offset_id = i;
tL_messages_getDialogs.offset_date = i2;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("start migrate with id " + i + " date " + LocaleController.getInstance().getFormatterStats().format(i2 * 1000));
}
if (i == 0) {
tL_messages_getDialogs.offset_peer = new TLRPC.TL_inputPeerEmpty();
} else {
if (j3 != 0) {
TLRPC.TL_inputPeerChannel tL_inputPeerChannel = new TLRPC.TL_inputPeerChannel();
tL_messages_getDialogs.offset_peer = tL_inputPeerChannel;
((TLRPC.InputPeer) tL_inputPeerChannel).channel_id = j3;
} else if (j != 0) {
TLRPC.TL_inputPeerUser tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
tL_messages_getDialogs.offset_peer = tL_inputPeerUser;
((TLRPC.InputPeer) tL_inputPeerUser).user_id = j;
} else {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
tL_messages_getDialogs.offset_peer = tL_inputPeerChat;
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = j2;
}
tL_messages_getDialogs.offset_peer.access_hash = j4;
}
getConnectionsManager().sendRequest(tL_messages_getDialogs, new MessagesController$.ExternalSyntheticLambda110(this, i));
}
private void processChannelsUpdatesQueue(long j, int i) {
ArrayList arrayList = (ArrayList) this.updatesQueueChannels.get(j);
if (arrayList == null) {
return;
}
int i2 = this.channelsPts.get(j);
if (arrayList.isEmpty() || i2 == 0) {
this.updatesQueueChannels.remove(j);
return;
}
Collections.sort(arrayList, new MessagesController$.ExternalSyntheticLambda236());
if (i == 2) {
this.channelsPts.put(j, ((TLRPC.Updates) arrayList.get(0)).pts);
}
boolean z = false;
while (arrayList.size() > 0) {
TLRPC.Updates updates = (TLRPC.Updates) arrayList.get(0);
int i3 = updates.pts;
char c = i3 <= i2 ? (char) 2 : updates.pts_count + i2 == i3 ? (char) 0 : (char) 1;
if (c == 0) {
processUpdates(updates, true);
if (arrayList.size() <= 0) {
break;
}
z = true;
arrayList.remove(0);
} else {
if (c == 1) {
long j2 = this.updatesStartWaitTimeChannels.get(j);
if (j2 == 0 || (!z && Math.abs(System.currentTimeMillis() - j2) > 1500)) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN CHANNEL " + j + " UPDATES QUEUE - getChannelDifference ");
}
this.updatesStartWaitTimeChannels.delete(j);
this.updatesQueueChannels.remove(j);
getChannelDifference(j);
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("HOLE IN CHANNEL " + j + " UPDATES QUEUE - will wait more time");
}
if (z) {
this.updatesStartWaitTimeChannels.put(j, System.currentTimeMillis());
return;
}
return;
}
if (arrayList.size() <= 0) {
break;
} else {
arrayList.remove(0);
}
}
}
this.updatesQueueChannels.remove(j);
this.updatesStartWaitTimeChannels.delete(j);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("UPDATES CHANNEL " + j + " QUEUE PROCEED - OK");
}
}
private void processUpdatesQueue(int r9, int r10) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.processUpdatesQueue(int, int):void");
}
private void reloadDialogsReadValue(ArrayList<TLRPC.Dialog> arrayList, long j) {
if (j == 0 && (arrayList == null || arrayList.isEmpty())) {
return;
}
TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs = new TLRPC.TL_messages_getPeerDialogs();
if (arrayList != null) {
for (int i = 0; i < arrayList.size(); i++) {
TLRPC.InputPeer inputPeer = getInputPeer(arrayList.get(i).id);
if (!(inputPeer instanceof TLRPC.TL_inputPeerChannel) || inputPeer.access_hash != 0) {
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer;
long peerDialogId = DialogObject.getPeerDialogId(inputPeer);
Long l = (Long) this.peerDialogsRequested.get(peerDialogId);
if (l == null || System.currentTimeMillis() - l.longValue() > 240000) {
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer);
this.peerDialogsRequested.put(peerDialogId, Long.valueOf(System.currentTimeMillis()));
}
}
}
} else {
TLRPC.InputPeer inputPeer2 = getInputPeer(j);
if ((inputPeer2 instanceof TLRPC.TL_inputPeerChannel) && inputPeer2.access_hash == 0) {
return;
}
TLRPC.TL_inputDialogPeer tL_inputDialogPeer2 = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer2.peer = inputPeer2;
long peerDialogId2 = DialogObject.getPeerDialogId(inputPeer2);
Long l2 = (Long) this.peerDialogsRequested.get(peerDialogId2);
if (l2 == null || System.currentTimeMillis() - l2.longValue() > 240000) {
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer2);
this.peerDialogsRequested.put(peerDialogId2, Long.valueOf(System.currentTimeMillis()));
}
}
if (tL_messages_getPeerDialogs.peers.isEmpty()) {
return;
}
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda189(this));
}
private void reloadMessages(ArrayList<Integer> arrayList, long j, int i) {
TLRPC.TL_channels_getMessages tL_messages_getMessages;
if (arrayList.isEmpty()) {
return;
}
boolean z = i == 1;
ArrayList arrayList2 = new ArrayList();
TLRPC.Chat chat = DialogObject.isChatDialog(j) ? getChat(Long.valueOf(-j)) : null;
if (ChatObject.isChannel(chat)) {
tL_messages_getMessages = new TLRPC.TL_channels_getMessages();
tL_messages_getMessages.channel = getInputChannel(chat);
tL_messages_getMessages.id = arrayList2;
} else {
tL_messages_getMessages = new TLRPC.TL_messages_getMessages();
((TLRPC.TL_messages_getMessages) tL_messages_getMessages).id = arrayList2;
}
TLRPC.TL_channels_getMessages tL_channels_getMessages = tL_messages_getMessages;
ArrayList arrayList3 = (ArrayList) this.reloadingMessages.get(j);
for (int i2 = 0; i2 < arrayList.size(); i2++) {
Integer num = arrayList.get(i2);
if (arrayList3 == null || !arrayList3.contains(num)) {
arrayList2.add(num);
}
}
if (arrayList2.isEmpty()) {
return;
}
if (arrayList3 == null) {
arrayList3 = new ArrayList();
this.reloadingMessages.put(j, arrayList3);
}
arrayList3.addAll(arrayList2);
getConnectionsManager().sendRequest(tL_channels_getMessages, new MessagesController$.ExternalSyntheticLambda395(this, j, z, i, arrayList2));
}
private void removeDialog(TLRPC.Dialog dialog) {
if (dialog == null) {
return;
}
long j = dialog.id;
if (this.dialogsServerOnly.remove(dialog) && DialogObject.isChannel(dialog)) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda375(this, j));
}
this.allDialogs.remove(dialog);
this.dialogsMyChannels.remove(dialog);
this.dialogsMyGroups.remove(dialog);
this.dialogsCanAddUsers.remove(dialog);
this.dialogsChannelsOnly.remove(dialog);
this.dialogsGroupsOnly.remove(dialog);
this.dialogsUsersOnly.remove(dialog);
this.dialogsForBlock.remove(dialog);
this.dialogsForward.remove(dialog);
int i = 0;
while (true) {
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
if (i >= dialogFilterArr.length) {
break;
}
DialogFilter dialogFilter = dialogFilterArr[i];
if (dialogFilter != null) {
dialogFilter.dialogs.remove(dialog);
this.selectedDialogFilter[i].dialogsForward.remove(dialog);
}
i++;
}
this.dialogs_dict.remove(j);
ArrayList<TLRPC.Dialog> arrayList = this.dialogsByFolder.get(dialog.folder_id);
if (arrayList != null) {
arrayList.remove(dialog);
}
}
private void removeFolder(int i) {
long makeFolderDialogId = DialogObject.makeFolderDialogId(i);
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(makeFolderDialogId);
if (dialog == null) {
return;
}
this.dialogs_dict.remove(makeFolderDialogId);
this.allDialogs.remove(dialog);
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.folderBecomeEmpty, new Object[]{Integer.valueOf(i)});
}
public void removePromoDialog() {
TLRPC.Dialog dialog = this.promoDialog;
if (dialog == null) {
return;
}
long j = dialog.id;
if (j < 0) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
if (ChatObject.isNotInChat(chat) || chat.restricted) {
dialog = this.promoDialog;
}
this.promoDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
removeDialog(dialog);
this.promoDialog = null;
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
public void requestIsUserContactBlocked() {
if (this.loadingIsUserContactBlocked.isEmpty()) {
return;
}
TL_account.getRequirementsToContact getrequirementstocontact = new TL_account.getRequirementsToContact();
ArrayList arrayList = new ArrayList();
Iterator<Long> it = this.loadingIsUserContactBlocked.iterator();
while (it.hasNext()) {
Long next = it.next();
TLRPC.InputUser inputUser = getInputUser(next.longValue());
if (inputUser != null) {
getrequirementstocontact.id.add(inputUser);
arrayList.add(next);
}
}
this.loadingIsUserContactBlocked.clear();
if (getrequirementstocontact.id.isEmpty()) {
return;
}
getConnectionsManager().sendRequest(getrequirementstocontact, new MessagesController$.ExternalSyntheticLambda264(this, arrayList));
}
private void resetAppConfig() {
this.getfileExperimentalParams = false;
this.channelRevenueWithdrawalEnabled = false;
this.collectDeviceStats = false;
this.smsjobsStickyNotificationEnabled = false;
this.showAnnualPerMonth = false;
this.canEditFactcheck = false;
this.starsLocked = true;
this.factcheckLengthLimit = ConnectionsManager.RequestFlagDoNotWaitFloodWait;
this.videoIgnoreAltDocuments = false;
this.freezeSinceDate = 0L;
this.freezeUntilDate = 0L;
this.freezeAppealUrl = "t.me/spambot";
this.mainPreferences.edit().remove("starsLocked").remove("getfileExperimentalParams").remove("smsjobsStickyNotificationEnabled").remove("channelRevenueWithdrawalEnabled").remove("showAnnualPerMonth").remove("canEditFactcheck").remove("factcheckLengthLimit").remove("videoIgnoreAltDocuments").remove("freezeSinceDate").remove("freezeUntilDate").remove("freezeAppealUrl").apply();
}
private void resetDialogs(boolean r27, int r28, int r29, int r30, int r31) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.resetDialogs(boolean, int, int, int, int):void");
}
private void savePeerSettings(long j, TLRPC.PeerSettings peerSettings, boolean z) {
StringBuilder sb;
if (peerSettings == null) {
return;
}
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
if (peerSettings.business_bot_id != 0) {
sb = new StringBuilder();
sb.append("dialog_botid");
sb.append(j);
edit.putLong(sb.toString(), peerSettings.business_bot_id);
edit.putString("dialog_boturl" + j, peerSettings.business_bot_manage_url);
edit.putInt("dialog_botflags" + j, (peerSettings.business_bot_paused ? 1 : 0) + (peerSettings.business_bot_can_reply ? 2 : 0));
} else {
sb = new StringBuilder();
sb.append("dialog_botid");
sb.append(j);
edit.remove(sb.toString()).remove("dialog_boturl" + j).remove("dialog_botflags" + j);
}
edit.putLong("dialog_bar_paying_" + j, peerSettings.charge_paid_message_stars);
if (this.notificationsPreferences.getInt("dialog_bar_vis3" + j, 0) == 3) {
edit.apply();
getNotificationCenter().postNotificationName(NotificationCenter.peerSettingsDidLoad, new Object[]{Long.valueOf(j)});
return;
}
boolean z2 = peerSettings.flags == 0;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("peer settings loaded for " + j + " add = " + peerSettings.add_contact + " block = " + peerSettings.block_contact + " spam = " + peerSettings.report_spam + " share = " + peerSettings.share_contact + " geo = " + peerSettings.report_geo + " hide = " + z2 + " distance = " + peerSettings.geo_distance + " invite = " + peerSettings.invite_members);
}
edit.putInt("dialog_bar_vis3" + j, z2 ? 1 : 2);
edit.putBoolean("dialog_bar_share" + j, peerSettings.share_contact);
edit.putBoolean("dialog_bar_report" + j, peerSettings.report_spam);
edit.putBoolean("dialog_bar_add" + j, peerSettings.add_contact);
edit.putBoolean("dialog_bar_block" + j, peerSettings.block_contact);
edit.putBoolean("dialog_bar_exception" + j, peerSettings.need_contacts_exception);
edit.putBoolean("dialog_bar_location" + j, peerSettings.report_geo);
edit.putBoolean("dialog_bar_archived" + j, peerSettings.autoarchived);
edit.putBoolean("dialog_bar_invite" + j, peerSettings.invite_members);
edit.putString("dialog_bar_chat_with_admin_title" + j, peerSettings.request_chat_title);
edit.putBoolean("dialog_bar_chat_with_channel" + j, peerSettings.request_chat_broadcast);
edit.putInt("dialog_bar_chat_with_date" + j, peerSettings.request_chat_date);
if (this.notificationsPreferences.getInt("dialog_bar_distance" + j, -1) != -2) {
if ((peerSettings.flags & 64) != 0) {
edit.putInt("dialog_bar_distance" + j, peerSettings.geo_distance);
} else {
edit.remove("dialog_bar_distance" + j);
}
}
if (j == getUserConfig().getClientUserId()) {
peerSettings.business_bot_id = 1271266957L;
peerSettings.business_bot_manage_url = "https://telegram.org/";
}
edit.apply();
this.userPeerSettings.put(j, peerSettings);
getNotificationCenter().postNotificationName(NotificationCenter.peerSettingsDidLoad, new Object[]{Long.valueOf(j)});
}
private boolean savePremiumFeaturesPreviewOrder(String str, SparseIntArray sparseIntArray, SharedPreferences.Editor editor, ArrayList<TLRPC.JSONValue> arrayList) {
int serverStringToFeatureType;
StringBuilder sb = new StringBuilder();
sparseIntArray.clear();
int i = 0;
while (true) {
if (i >= arrayList.size()) {
break;
}
String str2 = arrayList.get(i) instanceof TLRPC.TL_jsonString ? arrayList.get(i).value : null;
if (str2 != null && (serverStringToFeatureType = PremiumPreviewFragment.serverStringToFeatureType(str2)) >= 0) {
sparseIntArray.put(serverStringToFeatureType, i);
if (sb.length() > 0) {
sb.append('_');
}
sb.append(serverStringToFeatureType);
}
i++;
}
if (sb.length() <= 0) {
editor.remove(str);
return this.mainPreferences.getString(str, null) != null;
}
String sb2 = sb.toString();
boolean z = !sb2.equals(this.mainPreferences.getString(str, null));
editor.putString(str, sb2);
return z;
}
private void saveSavedReactionsTags(long j, TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda345(this, j, tL_messages_savedReactionsTags));
}
private void scheduleTranscriptionUpdate() {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda318(this));
}
private void sendLoadPeersRequest(TLObject tLObject, ArrayList<TLObject> arrayList, TLRPC.messages_Dialogs messages_dialogs, TLRPC.messages_Dialogs messages_dialogs2, ArrayList<TLRPC$User> arrayList2, ArrayList<TLRPC.Chat> arrayList3, ArrayList<DialogFilter> arrayList4, SparseArray<DialogFilter> sparseArray, ArrayList<Integer> arrayList5, HashMap<Integer, HashSet<Long>> hashMap, HashSet<Integer> hashSet, Runnable runnable) {
getConnectionsManager().sendRequest(tLObject, new MessagesController$.ExternalSyntheticLambda456(this, arrayList3, arrayList2, messages_dialogs, messages_dialogs2, arrayList, tLObject, arrayList4, sparseArray, arrayList5, hashMap, hashSet, runnable));
}
private void setUpdatesStartTime(int i, long j) {
if (i == 0) {
this.updatesStartWaitTimeSeq = j;
} else if (i == 1) {
this.updatesStartWaitTimePts = j;
} else if (i == 2) {
this.updatesStartWaitTimeQts = j;
}
}
public static void showCantOpenAlert(BaseFragment baseFragment, String str) {
if (baseFragment == null || baseFragment.getParentActivity() == null) {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(baseFragment.getParentActivity(), baseFragment.getResourceProvider());
builder.setTitle(LocaleController.getString(R.string.DialogNotAvailable));
HashMap hashMap = new HashMap();
int i = Theme.key_dialogTopBackground;
hashMap.put("info1.**", Integer.valueOf(baseFragment.getThemedColor(i)));
hashMap.put("info2.**", Integer.valueOf(baseFragment.getThemedColor(i)));
builder.setTopAnimation(R.raw.not_available, 52, false, baseFragment.getThemedColor(i), hashMap);
builder.setTopAnimationIsNew(true);
builder.setPositiveButton(LocaleController.getString(R.string.Close), (AlertDialog.OnButtonClickListener) null);
builder.setMessage(str);
baseFragment.showDialog(builder.create());
}
public static TLRPC.InputDocument toInputDocument(TLRPC$Document tLRPC$Document) {
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
((TLRPC.InputDocument) tL_inputDocument).file_reference = tLRPC$Document.file_reference;
return tL_inputDocument;
}
public static TLRPC.InputMedia toInputMedia(TLRPC.MessageMedia messageMedia) {
if (messageMedia instanceof TLRPC.TL_messageMediaDocument) {
TLRPC.TL_inputMediaDocument tL_inputMediaDocument = new TLRPC.TL_inputMediaDocument();
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
tL_inputMediaDocument.id = tL_inputDocument;
TLRPC$Document tLRPC$Document = messageMedia.document;
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
((TLRPC.InputDocument) tL_inputDocument).file_reference = tLRPC$Document.file_reference;
return tL_inputMediaDocument;
}
if (!(messageMedia instanceof TLRPC.TL_messageMediaPhoto)) {
return null;
}
TLRPC.TL_inputMediaPhoto tL_inputMediaPhoto = new TLRPC.TL_inputMediaPhoto();
TLRPC.TL_inputPhoto tL_inputPhoto = new TLRPC.TL_inputPhoto();
tL_inputMediaPhoto.id = tL_inputPhoto;
TLRPC.Photo photo = messageMedia.photo;
((TLRPC.InputPhoto) tL_inputPhoto).id = photo.id;
((TLRPC.InputPhoto) tL_inputPhoto).access_hash = photo.access_hash;
((TLRPC.InputPhoto) tL_inputPhoto).file_reference = photo.file_reference;
return tL_inputMediaPhoto;
}
private void updatePrintingStrings() {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.updatePrintingStrings():void");
}
private boolean updatePrintingUsersWithNewMessages(long j, ArrayList<MessageObject> arrayList) {
boolean z;
if (j > 0) {
if (((ConcurrentHashMap) this.printingUsers.get(Long.valueOf(j))) != null) {
this.printingUsers.remove(Long.valueOf(j));
return true;
}
} else if (j < 0) {
ArrayList arrayList2 = new ArrayList();
Iterator<MessageObject> it = arrayList.iterator();
while (it.hasNext()) {
MessageObject next = it.next();
if (next.isFromUser() && !arrayList2.contains(Long.valueOf(next.messageOwner.from_id.user_id))) {
arrayList2.add(Long.valueOf(next.messageOwner.from_id.user_id));
}
}
ConcurrentHashMap concurrentHashMap = (ConcurrentHashMap) this.printingUsers.get(Long.valueOf(j));
if (concurrentHashMap != null) {
ArrayList arrayList3 = null;
z = false;
for (Map.Entry entry : concurrentHashMap.entrySet()) {
Integer num = (Integer) entry.getKey();
ArrayList arrayList4 = (ArrayList) entry.getValue();
int i = 0;
while (i < arrayList4.size()) {
if (arrayList2.contains(Long.valueOf(((PrintingUser) arrayList4.get(i)).userId))) {
arrayList4.remove(i);
i--;
if (arrayList4.isEmpty()) {
if (arrayList3 == null) {
arrayList3 = new ArrayList();
}
arrayList3.add(num);
}
z = true;
}
i++;
}
}
if (arrayList3 != null) {
int size = arrayList3.size();
for (int i2 = 0; i2 < size; i2++) {
concurrentHashMap.remove(arrayList3.get(i2));
}
if (concurrentHashMap.isEmpty()) {
this.printingUsers.remove(Long.valueOf(j));
}
}
} else {
z = false;
}
if (z) {
return true;
}
}
return false;
}
public void addDialogAction(long j, boolean z) {
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog == null) {
return;
}
if (z) {
this.clearingHistoryDialogs.put(j, dialog);
} else {
this.deletingDialogs.put(j, dialog);
this.allDialogs.remove(dialog);
sortDialogs(null);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
public int addDialogToFolder(long j, int i, int i2, long j2) {
ArrayList<Long> arrayList = new ArrayList<>(1);
arrayList.add(Long.valueOf(j));
return addDialogToFolder(arrayList, i, i2, null, j2);
}
public int addDialogToFolder(java.util.ArrayList<java.lang.Long> r22, int r23, int r24, java.util.ArrayList<org.telegram.tgnet.TLRPC.TL_inputFolderPeer> r25, long r26) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.addDialogToFolder(java.util.ArrayList, int, int, java.util.ArrayList, long):int");
}
public void addFilter(DialogFilter dialogFilter, boolean z) {
if (z) {
int size = this.dialogFilters.size();
int i = 254;
for (int i2 = 0; i2 < size; i2++) {
i = Math.min(i, this.dialogFilters.get(i2).order);
}
dialogFilter.order = i - 1;
if (this.dialogFilters.get(0).isDefault()) {
this.dialogFilters.add(1, dialogFilter);
} else {
this.dialogFilters.add(0, dialogFilter);
}
} else {
int size2 = this.dialogFilters.size();
int i3 = 0;
for (int i4 = 0; i4 < size2; i4++) {
i3 = Math.max(i3, this.dialogFilters.get(i4).order);
}
dialogFilter.order = i3 + 1;
this.dialogFilters.add(dialogFilter);
}
this.dialogFiltersById.put(dialogFilter.id, dialogFilter);
if (this.dialogFilters.size() == 1 && SharedConfig.getChatSwipeAction(this.currentAccount) != 5) {
SharedConfig.updateChatListSwipeSetting(5);
}
lockFiltersInternal();
}
public void addOfferToSuggestedMessage(MessageObject messageObject, TLRPC.SuggestedPost suggestedPost) {
MessageObject messageObject2 = messageObject;
if (messageObject2 == null || messageObject2.messageOwner == null) {
return;
}
ArrayList<MessageObject> arrayList = new ArrayList<>(1);
arrayList.add(messageObject2);
SendMessagesHelper sendMessagesHelper = getSendMessagesHelper();
long dialogId = messageObject.getDialogId();
boolean z = !messageObject.isForwarded();
TLRPC.Message message = messageObject2.messageOwner;
if (message.suggested_post == null) {
messageObject2 = null;
}
sendMessagesHelper.sendMessage(arrayList, dialogId, z, false, true, 0, messageObject2, -1, 0L, DialogObject.getPeerDialogId(message.saved_peer_id), MessageSuggestionParams.of(suggestedPost));
}
public void addSupportUser() {
TLRPC.TL_userForeign_old2 tL_userForeign_old2 = new TLRPC.TL_userForeign_old2();
tL_userForeign_old2.phone = "333";
tL_userForeign_old2.id = 333000L;
tL_userForeign_old2.first_name = "Telegram";
tL_userForeign_old2.last_name = "";
tL_userForeign_old2.status = null;
tL_userForeign_old2.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(tL_userForeign_old2, true);
TLRPC.TL_userForeign_old2 tL_userForeign_old22 = new TLRPC.TL_userForeign_old2();
tL_userForeign_old22.phone = "42777";
tL_userForeign_old22.id = 777000L;
tL_userForeign_old22.verified = true;
tL_userForeign_old22.first_name = "Telegram";
tL_userForeign_old22.last_name = "Notifications";
tL_userForeign_old22.status = null;
tL_userForeign_old22.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(tL_userForeign_old22, true);
}
public void addToPollsQueue(long j, ArrayList<MessageObject> arrayList) {
long min;
int i;
SparseArray sparseArray = (SparseArray) this.pollsToCheck.get(j);
if (sparseArray == null) {
sparseArray = new SparseArray();
this.pollsToCheck.put(j, sparseArray);
this.pollsToCheckSize++;
}
int size = sparseArray.size();
for (int i2 = 0; i2 < size; i2++) {
((MessageObject) sparseArray.valueAt(i2)).pollVisibleOnScreen = false;
}
int currentTime = getConnectionsManager().getCurrentTime();
int size2 = arrayList.size();
boolean z = false;
int i3 = ConnectionsManager.DEFAULT_DATACENTER_ID;
for (int i4 = 0; i4 < size2; i4++) {
MessageObject messageObject = arrayList.get(i4);
if (messageObject.type == 17) {
TLRPC.TL_messageMediaPoll tL_messageMediaPoll = messageObject.messageOwner.media;
if (tL_messageMediaPoll instanceof TLRPC.TL_messageMediaPoll) {
TLRPC.Poll poll = tL_messageMediaPoll.poll;
if (!poll.closed && (i = poll.close_date) != 0) {
if (i <= currentTime) {
z = true;
} else {
i3 = Math.min(i3, i - currentTime);
}
}
int id = messageObject.getId();
MessageObject messageObject2 = (MessageObject) sparseArray.get(id);
if (messageObject2 != null) {
messageObject2.pollVisibleOnScreen = true;
} else {
sparseArray.put(id, messageObject);
}
}
}
}
if (z) {
min = 0;
} else if (i3 >= 5) {
return;
} else {
min = Math.min(this.lastViewsCheckTime, System.currentTimeMillis() - ((5 - i3) * 1000));
}
this.lastViewsCheckTime = min;
}
public void addToViewsQueue(MessageObject messageObject) {
if (messageObject == null) {
return;
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda46(this, messageObject));
}
public void addUserToChat(long j, TLRPC$User tLRPC$User, int i, String str, BaseFragment baseFragment, Runnable runnable) {
addUserToChat(j, tLRPC$User, i, str, baseFragment, false, runnable, null);
}
public void addUserToChat(long j, TLRPC$User tLRPC$User, int i, String str, BaseFragment baseFragment, boolean z, Runnable runnable, ErrorDelegate errorDelegate) {
addUserToChat(j, tLRPC$User, i, str, baseFragment, z, runnable, errorDelegate, null);
}
public void addUserToChat(long j, TLRPC$User tLRPC$User, int i, String str, BaseFragment baseFragment, boolean z, Runnable runnable, ErrorDelegate errorDelegate, Utilities.Callback<TLRPC.TL_messages_invitedUsers> callback) {
TLRPC.TL_messages_startBot tL_messages_addChatUser;
if (tLRPC$User == null) {
if (errorDelegate != null) {
errorDelegate.run((TLRPC.TL_error) null);
}
if (callback != null) {
callback.run((Object) null);
return;
}
return;
}
boolean isChannel = ChatObject.isChannel(j, this.currentAccount);
boolean z2 = isChannel && getChat(Long.valueOf(j)).megagroup;
TLRPC.InputUser inputUser = getInputUser(tLRPC$User);
if (str != null && (!isChannel || z2)) {
tL_messages_addChatUser = new TLRPC.TL_messages_startBot();
tL_messages_addChatUser.bot = inputUser;
if (isChannel) {
tL_messages_addChatUser.peer = getInputPeer(-j);
} else {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
tL_messages_addChatUser.peer = tL_inputPeerChat;
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = j;
}
tL_messages_addChatUser.start_param = str;
tL_messages_addChatUser.random_id = Utilities.random.nextLong();
} else if (!isChannel) {
tL_messages_addChatUser = new TLRPC.TL_messages_addChatUser();
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).chat_id = j;
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).fwd_limit = i;
((TLRPC.TL_messages_addChatUser) tL_messages_addChatUser).user_id = inputUser;
} else if (!(inputUser instanceof TLRPC.TL_inputUserSelf)) {
tL_messages_addChatUser = new TLRPC.TL_channels_inviteToChannel();
((TLRPC.TL_channels_inviteToChannel) tL_messages_addChatUser).channel = getInputChannel(j);
((TLRPC.TL_channels_inviteToChannel) tL_messages_addChatUser).users.add(inputUser);
} else if (this.joiningToChannels.contains(Long.valueOf(j))) {
if (errorDelegate != null) {
errorDelegate.run((TLRPC.TL_error) null);
return;
}
return;
} else {
tL_messages_addChatUser = new TLRPC.TL_channels_joinChannel();
((TLRPC.TL_channels_joinChannel) tL_messages_addChatUser).channel = getInputChannel(j);
this.joiningToChannels.add(Long.valueOf(j));
}
TLRPC.TL_messages_startBot tL_messages_startBot = tL_messages_addChatUser;
getConnectionsManager().sendRequest(tL_messages_startBot, new MessagesController$.ExternalSyntheticLambda373(this, isChannel, inputUser, j, tLRPC$User, callback, z, runnable, errorDelegate, baseFragment, tL_messages_startBot, z2));
}
public void addUsersToChannel(long j, ArrayList<TLRPC.InputUser> arrayList, BaseFragment baseFragment) {
if (arrayList == null || arrayList.isEmpty()) {
return;
}
TLRPC.TL_channels_inviteToChannel tL_channels_inviteToChannel = new TLRPC.TL_channels_inviteToChannel();
tL_channels_inviteToChannel.channel = getInputChannel(j);
tL_channels_inviteToChannel.users = arrayList;
getConnectionsManager().sendRequest(tL_channels_inviteToChannel, new MessagesController$.ExternalSyntheticLambda403(this, baseFragment, tL_channels_inviteToChannel, j));
}
public void addUsersToChat(TLRPC.Chat chat, BaseFragment baseFragment, ArrayList<TLRPC$User> arrayList, int i, Consumer consumer, Consumer consumer2, Runnable runnable) {
int size = arrayList.size();
int[] iArr = {0};
TLRPC.TL_messages_invitedUsers tL_messages_invitedUsers = new TLRPC.TL_messages_invitedUsers();
tL_messages_invitedUsers.updates = new TLRPC.TL_updates();
long j = chat.id;
for (int i2 = 0; i2 < size; i2++) {
TLRPC$User tLRPC$User = arrayList.get(i2);
addUserToChat(j, tLRPC$User, i, null, baseFragment, false, new MessagesController$.ExternalSyntheticLambda464(consumer, tLRPC$User), new MessagesController$.ExternalSyntheticLambda465(consumer2, tLRPC$User), new MessagesController$.ExternalSyntheticLambda466(this, tL_messages_invitedUsers, iArr, size, chat, runnable));
putUser(tLRPC$User, false);
}
}
public void approveSuggestedMessage(long j, int i, int i2) {
approveOrRejectSuggestedMessageImpl(j, i, i2, false, null);
}
public void blockPeer(long j) {
TLRPC.Chat chat;
TLRPC$User tLRPC$User = null;
if (j > 0) {
TLRPC$User user = getUser(Long.valueOf(j));
if (user == null) {
return;
}
tLRPC$User = user;
chat = null;
} else {
chat = getChat(Long.valueOf(-j));
if (chat == null) {
return;
}
}
if (this.blockePeers.indexOfKey(j) >= 0) {
return;
}
this.blockePeers.put(j, 1);
if (tLRPC$User != null) {
if (tLRPC$User.bot) {
getMediaDataController().removeInline(j);
} else {
getMediaDataController().removePeer(j);
}
}
int i = this.totalBlockedCount;
if (i >= 0) {
this.totalBlockedCount = i + 1;
}
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
TLRPC.TL_contacts_block tL_contacts_block = new TLRPC.TL_contacts_block();
tL_contacts_block.id = tLRPC$User != null ? getInputPeer(tLRPC$User) : getInputPeer(chat);
getConnectionsManager().sendRequest(tL_contacts_block, new MessagesController$.ExternalSyntheticLambda421());
}
public boolean canAddToForward(TLRPC.Dialog dialog) {
if (dialog == null) {
return false;
}
if (!DialogObject.isEncryptedDialog(dialog.id) && DialogObject.isChannel(dialog)) {
TLRPC.Chat chat = getChat(Long.valueOf(-dialog.id));
if (chat == null || !chat.megagroup) {
if (!ChatObject.hasAdminRights(chat) || !ChatObject.canPost(chat)) {
return false;
}
} else if (chat.gigagroup && !ChatObject.hasAdminRights(chat)) {
return false;
}
}
return true;
}
public void cancelLoadFullChat(long j) {
this.loadingFullChats.remove(Long.valueOf(j));
}
public void cancelLoadFullUser(long j) {
this.loadingFullUsers.remove(Long.valueOf(j));
}
public void lambda$sendTyping$163(int i, long j, long j2) {
LongSparseArray longSparseArray;
LongSparseArray longSparseArray2;
if (i >= 0) {
LongSparseArray[] longSparseArrayArr = this.sendingTypings;
if (i >= longSparseArrayArr.length || (longSparseArray = longSparseArrayArr[i]) == null || (longSparseArray2 = (LongSparseArray) longSparseArray.get(j)) == null) {
return;
}
longSparseArray2.remove(j2);
if (longSparseArray2.size() == 0) {
longSparseArray.remove(j);
}
}
}
public void cancelUploadWallpaper() {
Theme.OverrideWallpaperInfo overrideWallpaperInfo = this.uploadingWallpaperInfo;
if (overrideWallpaperInfo != null) {
if (overrideWallpaperInfo.requestIds != null) {
for (int i = 0; i < this.uploadingWallpaperInfo.requestIds.size(); i++) {
ConnectionsManager.getInstance(this.currentAccount).cancelRequest(((Integer) this.uploadingWallpaperInfo.requestIds.get(i)).intValue(), true);
}
}
FileLoader.getInstance(this.currentAccount).cancelFileUpload(this.uploadingWallpaper, false);
long j = this.uploadingWallpaperInfo.dialogId;
if (j != 0) {
if (j >= 0) {
TLRPC.UserFull userFull = getUserFull(j);
if (userFull != null) {
userFull.wallpaper = this.uploadingWallpaperInfo.prevUserWallpaper;
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.userInfoDidLoad, new Object[]{Long.valueOf(this.uploadingWallpaperInfo.dialogId), userFull});
}
} else {
TLRPC.ChatFull chatFull = getChatFull(-j);
if (chatFull != null) {
chatFull.wallpaper = this.uploadingWallpaperInfo.prevUserWallpaper;
NotificationCenter notificationCenter = NotificationCenter.getInstance(this.currentAccount);
int i2 = NotificationCenter.chatInfoDidLoad;
Boolean bool = Boolean.FALSE;
notificationCenter.postNotificationName(i2, new Object[]{chatFull, 0, bool, bool});
}
}
}
this.uploadingWallpaperInfo = null;
this.uploadingWallpaper = null;
}
}
public void changeChatAvatar(long j, TLRPC.TL_inputChatPhoto tL_inputChatPhoto, TLRPC.InputFile inputFile, TLRPC.InputFile inputFile2, TLRPC.VideoSize videoSize, double d, String str, TLRPC.FileLocation fileLocation, TLRPC.FileLocation fileLocation2, Runnable runnable) {
MessagesController messagesController;
TLRPC.TL_inputChatPhoto tL_inputChatPhoto2;
TLRPC.TL_channels_editPhoto tL_messages_editChatPhoto;
if (tL_inputChatPhoto != null) {
messagesController = this;
tL_inputChatPhoto2 = tL_inputChatPhoto;
} else if (inputFile == null && inputFile2 == null && videoSize == null) {
tL_inputChatPhoto2 = new TLRPC.TL_inputChatPhotoEmpty();
messagesController = this;
} else {
TLRPC.TL_inputChatPhoto tL_inputChatUploadedPhoto = new TLRPC.TL_inputChatUploadedPhoto();
if (inputFile != null) {
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).file = inputFile;
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).flags |= 1;
}
if (inputFile2 != null) {
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).video = inputFile2;
int i = ((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).flags;
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).video_start_ts = d;
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).flags = i | 6;
}
if (videoSize != null) {
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).video_emoji_markup = videoSize;
((TLRPC.TL_inputChatUploadedPhoto) tL_inputChatUploadedPhoto).flags |= 8;
}
messagesController = this;
tL_inputChatPhoto2 = tL_inputChatUploadedPhoto;
}
if (ChatObject.isChannel(j, messagesController.currentAccount)) {
tL_messages_editChatPhoto = new TLRPC.TL_channels_editPhoto();
tL_messages_editChatPhoto.channel = getInputChannel(j);
tL_messages_editChatPhoto.photo = tL_inputChatPhoto2;
} else {
tL_messages_editChatPhoto = new TLRPC.TL_messages_editChatPhoto();
((TLRPC.TL_messages_editChatPhoto) tL_messages_editChatPhoto).chat_id = j;
((TLRPC.TL_messages_editChatPhoto) tL_messages_editChatPhoto).photo = tL_inputChatPhoto2;
}
getConnectionsManager().sendRequest(tL_messages_editChatPhoto, new MessagesController$.ExternalSyntheticLambda66(this, tL_inputChatPhoto, fileLocation, fileLocation2, str, j, runnable), 64);
}
public void changeChatTitle(long j, String str) {
TLRPC.TL_channels_editTitle tL_messages_editChatTitle;
if (ChatObject.isChannel(j, this.currentAccount)) {
tL_messages_editChatTitle = new TLRPC.TL_channels_editTitle();
tL_messages_editChatTitle.channel = getInputChannel(j);
tL_messages_editChatTitle.title = str;
} else {
tL_messages_editChatTitle = new TLRPC.TL_messages_editChatTitle();
((TLRPC.TL_messages_editChatTitle) tL_messages_editChatTitle).chat_id = j;
((TLRPC.TL_messages_editChatTitle) tL_messages_editChatTitle).title = str;
}
getConnectionsManager().sendRequest(tL_messages_editChatTitle, new MessagesController$.ExternalSyntheticLambda446(this), 64);
}
public void checkArchiveFolder() {
if (this.hasArchivedChats || getStoriesController().hasHiddenStories()) {
boolean[] zArr = {false};
ensureFolderDialogExists(1, zArr);
if (zArr[0]) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
} else {
removeFolder(1);
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{0});
}
public boolean checkCanOpenChat(Bundle bundle, BaseFragment baseFragment) {
return checkCanOpenChat(bundle, baseFragment, null);
}
public boolean checkCanOpenChat(Bundle bundle, BaseFragment baseFragment, MessageObject messageObject) {
return checkCanOpenChat(bundle, baseFragment, messageObject, null);
}
public boolean checkCanOpenChat(Bundle bundle, BaseFragment baseFragment, MessageObject messageObject, Browser.Progress progress) {
TLRPC$User tLRPC$User;
TLRPC.Chat chat;
TLRPC.TL_channels_getMessages tL_messages_getMessages;
ArrayList arrayList;
if (bundle != null && baseFragment != null) {
long j = bundle.getLong("user_id", 0L);
long j2 = bundle.getLong("chat_id", 0L);
int i = bundle.getInt("message_id", 0);
AlertDialog alertDialog = null;
if (j != 0) {
tLRPC$User = getUser(Long.valueOf(j));
chat = null;
} else if (j2 != 0) {
chat = getChat(Long.valueOf(j2));
tLRPC$User = null;
} else {
tLRPC$User = null;
chat = null;
}
if (tLRPC$User == null && chat == null) {
return true;
}
String restrictionReason = getRestrictionReason(chat != null ? chat.restriction_reason : tLRPC$User.restriction_reason);
if (restrictionReason != null) {
showCantOpenAlert(baseFragment, restrictionReason);
return false;
}
if (i != 0 && messageObject != null && chat != null && chat.access_hash == 0) {
long dialogId = messageObject.getDialogId();
if (!DialogObject.isEncryptedDialog(dialogId)) {
if (progress != null) {
progress.init();
} else {
alertDialog = new AlertDialog(baseFragment.getParentActivity(), 3);
}
AlertDialog alertDialog2 = alertDialog;
if (dialogId < 0) {
chat = getChat(Long.valueOf(-dialogId));
}
if (dialogId > 0 || !ChatObject.isChannel(chat)) {
tL_messages_getMessages = new TLRPC.TL_messages_getMessages();
arrayList = ((TLRPC.TL_messages_getMessages) tL_messages_getMessages).id;
} else {
TLRPC.Chat chat2 = getChat(Long.valueOf(-dialogId));
tL_messages_getMessages = new TLRPC.TL_channels_getMessages();
tL_messages_getMessages.channel = getInputChannel(chat2);
arrayList = tL_messages_getMessages.id;
}
arrayList.add(Integer.valueOf(messageObject.getId()));
int sendRequest = getConnectionsManager().sendRequest(tL_messages_getMessages, new MessagesController$.ExternalSyntheticLambda84(this, alertDialog2, progress, baseFragment, bundle));
if (alertDialog2 != null) {
alertDialog2.setOnCancelListener(new MessagesController$.ExternalSyntheticLambda85(this, sendRequest, baseFragment));
baseFragment.setVisibleDialog(alertDialog2);
alertDialog2.show();
} else {
progress.onCancel(new MessagesController$.ExternalSyntheticLambda86(this, sendRequest, baseFragment));
progress.init();
}
return false;
}
} else if (i != 0 && messageObject != null && progress != null) {
progress.init();
progress.onCancel(ensureMessagesLoaded(-j2, i, new 2(this, progress, baseFragment, bundle)));
return false;
}
}
return true;
}
public void checkChatInviter(long j, boolean z) {
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (!ChatObject.isChannel(chat) || chat.creator || this.gettingChatInviters.indexOfKey(j) >= 0) {
return;
}
boolean z2 = ChatObject.isMonoForum(chat) ? false : z;
this.gettingChatInviters.put(j, Boolean.TRUE);
TLRPC.TL_channels_getParticipant tL_channels_getParticipant = new TLRPC.TL_channels_getParticipant();
tL_channels_getParticipant.channel = getInputChannel(j);
tL_channels_getParticipant.participant = getInputPeer(getUserConfig().getClientUserId());
getConnectionsManager().sendRequest(tL_channels_getParticipant, new MessagesController$.ExternalSyntheticLambda429(this, chat, z2, j));
}
public void checkChatlistFolderUpdate(int i, boolean z) {
if (i < 0) {
return;
}
ChatlistUpdatesStat chatlistUpdatesStat = this.chatlistFoldersUpdates.get(i);
if (chatlistUpdatesStat != null) {
if (chatlistUpdatesStat.loading) {
return;
}
if (System.currentTimeMillis() - chatlistUpdatesStat.lastRequestTime <= this.chatlistUpdatePeriod * 1000 && !z) {
return;
}
}
if (chatlistUpdatesStat == null) {
chatlistUpdatesStat = new ChatlistUpdatesStat(this);
this.chatlistFoldersUpdates.put(i, chatlistUpdatesStat);
}
chatlistUpdatesStat.loading = false;
TL_chatlists.TL_chatlists_getChatlistUpdates tL_chatlists_getChatlistUpdates = new TL_chatlists.TL_chatlists_getChatlistUpdates();
TL_chatlists.TL_inputChatlistDialogFilter tL_inputChatlistDialogFilter = new TL_chatlists.TL_inputChatlistDialogFilter();
tL_chatlists_getChatlistUpdates.chatlist = tL_inputChatlistDialogFilter;
tL_inputChatlistDialogFilter.filter_id = i;
getConnectionsManager().sendRequest(tL_chatlists_getChatlistUpdates, new MessagesController$.ExternalSyntheticLambda185(this, i, chatlistUpdatesStat));
}
public void checkIfFolderEmpty(int i) {
if (i == 0) {
return;
}
getMessagesStorage().checkIfFolderEmpty(i);
}
public void checkIsInChat(boolean z, TLRPC.Chat chat, TLRPC$User tLRPC$User, IsInChatCheckedCallback isInChatCheckedCallback) {
TLRPC.ChatFull chatFull;
TLRPC.ChatParticipant chatParticipant;
ArrayList arrayList;
TLRPC.ChatParticipant chatParticipant2;
ArrayList arrayList2;
if (chat == null || tLRPC$User == null) {
if (isInChatCheckedCallback != null) {
isInChatCheckedCallback.run(false, (TLRPC.TL_chatAdminRights) null, (String) null);
return;
}
return;
}
if (chat.megagroup || ChatObject.isChannel(chat)) {
if (z && (chatFull = getChatFull(chat.id)) != null) {
TLRPC.ChatParticipants chatParticipants = chatFull.participants;
if (chatParticipants != null && (arrayList = chatParticipants.participants) != null) {
int size = arrayList.size();
for (int i = 0; i < size; i++) {
chatParticipant = (TLRPC.ChatParticipant) chatFull.participants.participants.get(i);
if (chatParticipant != null && chatParticipant.user_id == tLRPC$User.id) {
break;
}
}
}
chatParticipant = null;
if (isInChatCheckedCallback != null && chatParticipant != null) {
TLRPC.ChatParticipants chatParticipants2 = chatFull.participants;
isInChatCheckedCallback.run(true, (chatParticipants2 == null || chatParticipants2.admin_id != tLRPC$User.id) ? null : ChatRightsEditActivity.emptyAdminRights(true), (String) null);
return;
}
}
TLRPC.TL_channels_getParticipant tL_channels_getParticipant = new TLRPC.TL_channels_getParticipant();
tL_channels_getParticipant.channel = getInputChannel(chat.id);
tL_channels_getParticipant.participant = getInputPeer(tLRPC$User);
getConnectionsManager().sendRequest(tL_channels_getParticipant, new MessagesController$.ExternalSyntheticLambda59(isInChatCheckedCallback));
return;
}
TLRPC.ChatFull chatFull2 = getChatFull(chat.id);
if (chatFull2 == null) {
if (isInChatCheckedCallback != null) {
isInChatCheckedCallback.run(false, (TLRPC.TL_chatAdminRights) null, (String) null);
return;
}
return;
}
TLRPC.ChatParticipants chatParticipants3 = chatFull2.participants;
if (chatParticipants3 != null && (arrayList2 = chatParticipants3.participants) != null) {
int size2 = arrayList2.size();
for (int i2 = 0; i2 < size2; i2++) {
chatParticipant2 = (TLRPC.ChatParticipant) chatFull2.participants.participants.get(i2);
if (chatParticipant2 != null && chatParticipant2.user_id == tLRPC$User.id) {
break;
}
}
}
chatParticipant2 = null;
if (isInChatCheckedCallback != null) {
boolean z2 = chatParticipant2 != null;
TLRPC.ChatParticipants chatParticipants4 = chatFull2.participants;
isInChatCheckedCallback.run(z2, (chatParticipants4 == null || chatParticipants4.admin_id != tLRPC$User.id) ? null : ChatRightsEditActivity.emptyAdminRights(true), (String) null);
}
}
protected void checkLastDialogMessage(TLRPC.Dialog dialog, TLRPC.InputPeer inputPeer, long j) {
Exception e;
OutputSerializedData outputSerializedData;
if (DialogObject.isEncryptedDialog(dialog.id) || this.checkingLastMessagesDialogs.indexOfKey(dialog.id) >= 0) {
return;
}
TLRPC.TL_messages_getHistory tL_messages_getHistory = new TLRPC.TL_messages_getHistory();
if (inputPeer == null) {
inputPeer = getInputPeer(dialog.id);
}
tL_messages_getHistory.peer = inputPeer;
if (inputPeer == null) {
return;
}
tL_messages_getHistory.limit = 1;
this.checkingLastMessagesDialogs.put(dialog.id, Boolean.TRUE);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("checkLastDialogMessage for " + dialog.id);
}
if (j == 0) {
try {
outputSerializedData = new NativeByteBuffer(tL_messages_getHistory.peer.getObjectSize() + 60);
} catch (Exception e2) {
e = e2;
outputSerializedData = null;
}
try {
outputSerializedData.writeInt32(14);
outputSerializedData.writeInt64(dialog.id);
outputSerializedData.writeInt32(dialog.top_message);
outputSerializedData.writeInt32(dialog.read_inbox_max_id);
outputSerializedData.writeInt32(dialog.read_outbox_max_id);
outputSerializedData.writeInt32(dialog.unread_count);
outputSerializedData.writeInt32(dialog.last_message_date);
outputSerializedData.writeInt32(dialog.pts);
outputSerializedData.writeInt32(dialog.flags);
outputSerializedData.writeBool(dialog.pinned);
outputSerializedData.writeInt32(dialog.pinnedNum);
outputSerializedData.writeInt32(dialog.unread_mentions_count);
outputSerializedData.writeBool(dialog.unread_mark);
outputSerializedData.writeInt32(dialog.folder_id);
tL_messages_getHistory.peer.serializeToStream(outputSerializedData);
} catch (Exception e3) {
e = e3;
FileLog.e(e);
j = getMessagesStorage().createPendingTask(outputSerializedData);
getConnectionsManager().sendRequest(tL_messages_getHistory, new MessagesController$.ExternalSyntheticLambda254(this, dialog, j));
}
j = getMessagesStorage().createPendingTask(outputSerializedData);
}
getConnectionsManager().sendRequest(tL_messages_getHistory, new MessagesController$.ExternalSyntheticLambda254(this, dialog, j));
}
public void checkPeerColors(boolean z) {
PeerColors peerColors;
if (getUserConfig().getCurrentUser() == null) {
return;
}
if (!this.loadingPeerColors && ((peerColors = this.peerColors) == null || peerColors.needUpdate() || z)) {
this.loadingPeerColors = true;
TLRPC.TL_help_getPeerColors tL_help_getPeerColors = new TLRPC.TL_help_getPeerColors();
PeerColors peerColors2 = this.peerColors;
tL_help_getPeerColors.hash = peerColors2 != null ? peerColors2.hash : 0;
if (peerColors2 != null && peerColors2.needUpdate()) {
tL_help_getPeerColors.hash = 0;
}
getConnectionsManager().sendRequest(tL_help_getPeerColors, new MessagesController$.ExternalSyntheticLambda50(this));
}
if (this.loadingProfilePeerColors) {
return;
}
PeerColors peerColors3 = this.profilePeerColors;
if (peerColors3 == null || peerColors3.needUpdate() || z) {
this.loadingProfilePeerColors = true;
TLRPC.TL_help_getPeerProfileColors tL_help_getPeerProfileColors = new TLRPC.TL_help_getPeerProfileColors();
PeerColors peerColors4 = this.profilePeerColors;
tL_help_getPeerProfileColors.hash = peerColors4 != null ? peerColors4.hash : 0;
if (peerColors4 != null && peerColors4.needUpdate()) {
tL_help_getPeerProfileColors.hash = 0;
}
getConnectionsManager().sendRequest(tL_help_getPeerProfileColors, new MessagesController$.ExternalSyntheticLambda51(this));
}
}
public void checkPromoInfo(boolean z) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda308(this, z));
}
public void checkSensitive(BaseFragment baseFragment, long j, Runnable runnable, Runnable runnable2) {
TLRPC$User user;
ArrayList<TLRPC.RestrictionReason> arrayList = null;
if (j < 0) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
if (chat != null) {
arrayList = chat.restriction_reason;
}
} else if (j >= 0 && (user = getUser(Long.valueOf(j))) != null) {
arrayList = user.restriction_reason;
}
if (!isSensitive(arrayList) || this.sensitiveAgreed.contains(Long.valueOf(j))) {
if (runnable != null) {
runnable.run();
}
} else {
AlertDialog alertDialog = new AlertDialog(baseFragment.getContext(), 3);
alertDialog.showDelayed(200L);
getContentSettings(new MessagesController$.ExternalSyntheticLambda146(this, alertDialog, baseFragment, j, runnable, runnable2));
}
}
public void checkUnreadReactions(long j, long j2, SparseBooleanArray sparseBooleanArray) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda25(this, sparseBooleanArray, j2, j));
}
public void cleanup() {
getContactsController().cleanup();
MediaController.getInstance().cleanup();
getNotificationsController().cleanup();
getSendMessagesHelper().cleanup();
getSecretChatHelper().cleanup();
getLocationController().cleanup();
getMediaDataController().cleanup();
getColorPalette().cleanup();
getTranslateController().cleanup();
getSavedMessagesController().cleanup();
StoriesController storiesController = this.storiesController;
if (storiesController != null) {
storiesController.cleanup();
}
UnconfirmedAuthController unconfirmedAuthController = this.unconfirmedAuthController;
if (unconfirmedAuthController != null) {
unconfirmedAuthController.cleanup();
}
this.showFiltersTooltip = false;
DialogsActivity.dialogsLoaded[this.currentAccount] = false;
this.notificationsPreferences.edit().clear().commit();
this.emojiPreferences.edit().putLong("lastGifLoadTime", 0L).putLong("lastStickersLoadTime", 0L).putLong("lastStickersLoadTimeMask", 0L).putLong("lastStickersLoadTimeFavs", 0L).commit();
this.mainPreferences.edit().remove("archivehint").remove("proximityhint").remove("archivehint_l").remove("gifhint").remove("reminderhint").remove("soundHint").remove("dcDomainName2").remove("webFileDatacenterId").remove("themehint").remove("showFiltersTooltip").remove("transcribeButtonPressed").commit();
SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("shortcut_widget", 0);
SharedPreferences.Editor editor = null;
ArrayList arrayList = null;
ArrayList arrayList2 = null;
AppWidgetManager appWidgetManager = null;
for (Map.Entry<String, ?> entry : sharedPreferences.getAll().entrySet()) {
String key = entry.getKey();
if (key.startsWith("account") && ((Integer) entry.getValue()).intValue() == this.currentAccount) {
Integer parseInt = Utilities.parseInt(key);
int intValue = parseInt.intValue();
if (editor == null) {
editor = sharedPreferences.edit();
appWidgetManager = AppWidgetManager.getInstance(ApplicationLoader.applicationContext);
}
editor.putBoolean("deleted" + intValue, true);
if (sharedPreferences.getInt("type" + intValue, 0) == 0) {
if (arrayList == null) {
arrayList = new ArrayList();
}
arrayList.add(parseInt);
} else {
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
arrayList2.add(parseInt);
}
}
}
if (editor != null) {
editor.commit();
}
if (arrayList != null) {
int size = arrayList.size();
for (int i = 0; i < size; i++) {
ChatsWidgetProvider.updateWidget(ApplicationLoader.applicationContext, appWidgetManager, ((Integer) arrayList.get(i)).intValue());
}
}
if (arrayList2 != null) {
int size2 = arrayList2.size();
for (int i2 = 0; i2 < size2; i2++) {
ContactsWidgetProvider.updateWidget(ApplicationLoader.applicationContext, appWidgetManager, ((Integer) arrayList2.get(i2)).intValue());
}
}
this.lastScheduledServerQueryTime.clear();
this.lastQuickReplyServerQueryTime.clear();
this.lastSavedServerQueryTime.clear();
this.lastServerQueryTime.clear();
this.reloadingWebpages.clear();
this.reloadingWebpagesPending.clear();
this.reloadingScheduledWebpages.clear();
this.reloadingScheduledWebpagesPending.clear();
this.reloadingSavedWebpages.clear();
this.reloadingSavedWebpagesPending.clear();
this.sponsoredMessages.clear();
this.sendAsPeers.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.activeVoiceChatsMap.clear();
this.loadingGroupCalls.clear();
this.groupCallsByChatId.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.dialogsLoadedTillDate = ConnectionsManager.DEFAULT_DATACENTER_ID;
this.dialogsCanAddUsers.clear();
this.dialogsMyChannels.clear();
this.dialogsMyGroups.clear();
this.dialogsChannelsOnly.clear();
this.dialogsGroupsOnly.clear();
this.dialogsUsersOnly.clear();
this.dialogsForBlock.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;
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
dialogFilterArr[1] = null;
dialogFilterArr[0] = null;
this.dialogFilters.clear();
this.dialogFiltersById.clear();
this.loadingSuggestedFilters = false;
this.loadingRemoteFilters = false;
this.suggestedFilters.clear();
this.dialogFiltersLoaded = false;
this.ignoreSetOnline = false;
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda28(this));
this.createdDialogMainThreadIds.clear();
this.visibleDialogMainThreadIds.clear();
this.visibleScheduledDialogMainThreadIds.clear();
this.blockePeers.clear();
int i3 = 0;
while (true) {
LongSparseArray[] longSparseArrayArr = this.sendingTypings;
if (i3 >= longSparseArrayArr.length) {
break;
}
LongSparseArray longSparseArray = longSparseArrayArr[i3];
if (longSparseArray != null) {
longSparseArray.clear();
}
i3++;
}
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.checkingTosUpdate = false;
this.nextTosCheckTime = 0;
this.nextPromoInfoCheckTime = 0;
this.checkingPromoInfo = false;
this.loadingUnreadDialogs = false;
this.currentDeletingTaskTime = 0;
this.currentDeletingTaskMids = null;
this.currentDeletingTaskMediaMids = null;
this.gettingNewDeleteTask = false;
this.loadingBlockedPeers = 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.uploadingWallpaperInfo = null;
this.uploadingThemes.clear();
this.gettingChatInviters.clear();
this.statusRequest = 0;
this.statusSettingState = 0;
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda29(this));
if (this.currentDeleteTaskRunnable != null) {
Utilities.stageQueue.cancelRunnable(this.currentDeleteTaskRunnable);
this.currentDeleteTaskRunnable = null;
}
addSupportUser();
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda30(this));
}
public void clearFullUsers() {
this.loadedFullUsers.clear();
this.loadedFullChats.clear();
}
public void clearQueryTime() {
this.lastServerQueryTime.clear();
this.lastScheduledServerQueryTime.clear();
this.lastQuickReplyServerQueryTime.clear();
this.lastSavedServerQueryTime.clear();
}
public void clearSendAsPeers() {
this.sendAsPeers.clear();
}
protected void completeDialogsReset(TLRPC.messages_Dialogs messages_dialogs, int i, int i2, int i3, int i4, int i5, LongSparseArray longSparseArray, LongSparseArray longSparseArray2, TLRPC.Message message) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda470(this, i3, i4, i5, messages_dialogs, longSparseArray, longSparseArray2));
}
public void convertToGigaGroup(Context context, TLRPC.Chat chat, BaseFragment baseFragment, MessagesStorage.BooleanCallback booleanCallback) {
TLRPC.TL_channels_convertToGigagroup tL_channels_convertToGigagroup = new TLRPC.TL_channels_convertToGigagroup();
tL_channels_convertToGigagroup.channel = getInputChannel(chat);
AlertDialog alertDialog = context != null ? new AlertDialog(context, 3) : null;
int sendRequest = getConnectionsManager().sendRequest(tL_channels_convertToGigagroup, new MessagesController$.ExternalSyntheticLambda175(this, context, alertDialog, booleanCallback, baseFragment, tL_channels_convertToGigagroup));
if (alertDialog != null) {
alertDialog.setOnCancelListener(new MessagesController$.ExternalSyntheticLambda176(this, sendRequest));
try {
alertDialog.showDelayed(400L);
} catch (Exception unused) {
}
}
}
public void convertToMegaGroup(Context context, long j, BaseFragment baseFragment, MessagesStorage.LongCallback longCallback) {
convertToMegaGroup(context, j, baseFragment, longCallback, null);
}
public void convertToMegaGroup(Context context, long j, BaseFragment baseFragment, MessagesStorage.LongCallback longCallback, Runnable runnable) {
TLRPC.TL_messages_migrateChat tL_messages_migrateChat = new TLRPC.TL_messages_migrateChat();
tL_messages_migrateChat.chat_id = j;
AlertDialog alertDialog = context != null ? new AlertDialog(context, 3) : null;
int sendRequest = getConnectionsManager().sendRequest(tL_messages_migrateChat, new MessagesController$.ExternalSyntheticLambda31(this, context, alertDialog, longCallback, j, runnable, baseFragment, tL_messages_migrateChat));
if (alertDialog != null) {
alertDialog.setOnCancelListener(new MessagesController$.ExternalSyntheticLambda32(this, sendRequest));
try {
alertDialog.show();
} catch (Exception unused) {
}
}
}
public int createChat(String str, ArrayList<Long> arrayList, String str2, int i, boolean z, Location location, String str3, int i2, BaseFragment baseFragment) {
if (i == 0 && !z) {
TLRPC.TL_messages_createChat tL_messages_createChat = new TLRPC.TL_messages_createChat();
tL_messages_createChat.title = str;
if (i2 >= 0) {
tL_messages_createChat.ttl_period = i2;
tL_messages_createChat.flags |= 1;
}
for (int i3 = 0; i3 < arrayList.size(); i3++) {
TLRPC$User user = getUser(arrayList.get(i3));
if (user != null) {
tL_messages_createChat.users.add(getInputUser(user));
}
}
return getConnectionsManager().sendRequest(tL_messages_createChat, new MessagesController$.ExternalSyntheticLambda104(this, baseFragment, tL_messages_createChat), 2);
}
if (!z && i != 2 && i != 4 && i != 5) {
return 0;
}
TLRPC.TL_channels_createChannel tL_channels_createChannel = new TLRPC.TL_channels_createChannel();
tL_channels_createChannel.title = str;
if (str2 == null) {
str2 = "";
}
tL_channels_createChannel.about = str2;
tL_channels_createChannel.for_import = z;
if (z || i == 4 || i == 5) {
tL_channels_createChannel.megagroup = true;
} else {
tL_channels_createChannel.broadcast = true;
}
tL_channels_createChannel.forum = i == 5;
if (location != null) {
TLRPC.TL_inputGeoPoint tL_inputGeoPoint = new TLRPC.TL_inputGeoPoint();
tL_channels_createChannel.geo_point = tL_inputGeoPoint;
((TLRPC.InputGeoPoint) tL_inputGeoPoint).lat = location.getLatitude();
tL_channels_createChannel.geo_point._long = location.getLongitude();
tL_channels_createChannel.address = str3;
tL_channels_createChannel.flags |= 4;
}
return getConnectionsManager().sendRequest(tL_channels_createChannel, new MessagesController$.ExternalSyntheticLambda105(this, baseFragment, tL_channels_createChannel), 2);
}
public long createDeleteShowOnceTask(long j, int i) {
NativeByteBuffer nativeByteBuffer;
try {
nativeByteBuffer = new NativeByteBuffer(16);
} catch (Exception e) {
e = e;
nativeByteBuffer = null;
}
try {
nativeByteBuffer.writeInt32(102);
nativeByteBuffer.writeInt64(j);
nativeByteBuffer.writeInt32(i);
} catch (Exception e2) {
e = e2;
FileLog.e(e);
return getMessagesStorage().createPendingTask(nativeByteBuffer);
}
return getMessagesStorage().createPendingTask(nativeByteBuffer);
}
public void deleteDialog(long j, int i) {
deleteDialog(j, i, false);
}
protected void deleteDialog(long r32, int r34, int r35, int r36, boolean r37, org.telegram.tgnet.TLRPC.InputPeer r38, long r39) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.deleteDialog(long, int, int, int, boolean, org.telegram.tgnet.TLRPC$InputPeer, long):void");
}
public void deleteDialog(long j, int i, boolean z) {
deleteDialog(j, 1, i, 0, z, null, 0L);
}
public void deleteMessages(ArrayList<Integer> arrayList, ArrayList<Long> arrayList2, TLRPC.EncryptedChat encryptedChat, long j, int i, boolean z, int i2) {
deleteMessages(arrayList, arrayList2, encryptedChat, j, z, i2, false, 0L, null, i);
}
public void deleteMessages(ArrayList<Integer> arrayList, ArrayList<Long> arrayList2, TLRPC.EncryptedChat encryptedChat, long j, int i, boolean z, int i2, boolean z2) {
deleteMessages(arrayList, arrayList2, encryptedChat, j, z, i2, z2, 0L, null, i);
}
public void deleteMessages(ArrayList<Integer> arrayList, ArrayList<Long> arrayList2, TLRPC.EncryptedChat encryptedChat, long j, boolean z, int i, boolean z2, long j2, TLObject tLObject, int i2) {
deleteMessages(arrayList, arrayList2, encryptedChat, j, z, i, z2, j2, tLObject, i2, false, 0);
}
public void deleteMessages(java.util.ArrayList<java.lang.Integer> r28, java.util.ArrayList<java.lang.Long> r29, org.telegram.tgnet.TLRPC.EncryptedChat r30, long r31, boolean r33, int r34, boolean r35, long r36, org.telegram.tgnet.TLObject r38, int r39, boolean r40, int r41) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.deleteMessages(java.util.ArrayList, java.util.ArrayList, org.telegram.tgnet.TLRPC$EncryptedChat, long, boolean, int, boolean, long, org.telegram.tgnet.TLObject, int, boolean, int):void");
}
protected void deleteMessagesByPush(long j, ArrayList<Integer> arrayList, long j2) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda438(this, arrayList, j2, j));
}
public void deleteMessagesRange(long j, long j2, int i, int i2, boolean z, Runnable runnable) {
TLRPC.TL_messages_deleteHistory tL_messages_deleteHistory = new TLRPC.TL_messages_deleteHistory();
tL_messages_deleteHistory.peer = getInputPeer(j);
tL_messages_deleteHistory.flags = 12;
tL_messages_deleteHistory.min_date = i;
tL_messages_deleteHistory.max_date = i2;
tL_messages_deleteHistory.revoke = z;
getConnectionsManager().sendRequest(tL_messages_deleteHistory, new MessagesController$.ExternalSyntheticLambda448(this, j, i, i2, j2, z, runnable));
}
public void deleteParticipantFromChat(long j, TLRPC.InputPeer inputPeer) {
deleteParticipantFromChat(j, inputPeer, false, false);
}
public void deleteParticipantFromChat(long j, TLRPC.InputPeer inputPeer, boolean z, boolean z2) {
deleteParticipantFromChat(j, inputPeer, z, z2, (Runnable) null);
}
public void deleteParticipantFromChat(long j, TLRPC.InputPeer inputPeer, boolean z, boolean z2, Runnable runnable) {
TLRPC.TL_channels_deleteChannel tL_channels_deleteChannel;
TLRPC.TL_channels_deleteChannel tL_channels_leaveChannel;
if (inputPeer == null) {
return;
}
TLRPC.Chat chat = getChat(Long.valueOf(j));
boolean z3 = (inputPeer instanceof TLRPC.TL_inputPeerUser) && UserObject.isUserSelf(getMessagesController().getUser(Long.valueOf(inputPeer.user_id)));
boolean isChannel = ChatObject.isChannel(chat);
if (isChannel) {
if (z3) {
if (chat.creator && z) {
tL_channels_leaveChannel = new TLRPC.TL_channels_deleteChannel();
tL_channels_leaveChannel.channel = getInputChannel(chat);
} else {
tL_channels_leaveChannel = new TLRPC.TL_channels_leaveChannel();
((TLRPC.TL_channels_leaveChannel) tL_channels_leaveChannel).channel = getInputChannel(chat);
}
tL_channels_deleteChannel = tL_channels_leaveChannel;
} else {
tL_channels_deleteChannel = new TLRPC.TL_channels_editBanned();
((TLRPC.TL_channels_editBanned) tL_channels_deleteChannel).channel = getInputChannel(chat);
((TLRPC.TL_channels_editBanned) tL_channels_deleteChannel).participant = inputPeer;
TLRPC.TL_chatBannedRights tL_chatBannedRights = new TLRPC.TL_chatBannedRights();
((TLRPC.TL_channels_editBanned) tL_channels_deleteChannel).banned_rights = tL_chatBannedRights;
tL_chatBannedRights.view_messages = true;
tL_chatBannedRights.send_media = true;
tL_chatBannedRights.send_messages = true;
tL_chatBannedRights.send_stickers = true;
tL_chatBannedRights.send_gifs = true;
tL_chatBannedRights.send_games = true;
tL_chatBannedRights.send_inline = true;
tL_chatBannedRights.embed_links = true;
tL_chatBannedRights.pin_messages = true;
tL_chatBannedRights.send_polls = true;
tL_chatBannedRights.invite_users = true;
tL_chatBannedRights.change_info = true;
}
} else if (z) {
TLRPC.TL_messages_deleteChat tL_messages_deleteChat = new TLRPC.TL_messages_deleteChat();
tL_messages_deleteChat.chat_id = j;
getConnectionsManager().sendRequest(tL_messages_deleteChat, new MessagesController$.ExternalSyntheticLambda112());
return;
} else {
TLRPC.TL_channels_deleteChannel tL_messages_deleteChatUser = new TLRPC.TL_messages_deleteChatUser();
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).chat_id = j;
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).user_id = getInputUser(inputPeer);
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).revoke_history = true;
tL_channels_deleteChannel = tL_messages_deleteChatUser;
}
if (z3) {
deleteDialog(-j, 0, z2);
}
getConnectionsManager().sendRequest(tL_channels_deleteChannel, new MessagesController$.ExternalSyntheticLambda113(this, isChannel, z3, j, runnable), 64);
}
public void deleteParticipantFromChat(long j, TLRPC$User tLRPC$User) {
deleteParticipantFromChat(j, tLRPC$User, (TLRPC.Chat) null, false, false);
}
public void deleteParticipantFromChat(long j, TLRPC$User tLRPC$User, TLRPC.Chat chat, boolean z, boolean z2) {
TLRPC.TL_channels_deleteChannel tL_messages_deleteChatUser;
if (tLRPC$User == null && chat == null) {
return;
}
TLRPC.InputPeer inputPeer = tLRPC$User != null ? getInputPeer(tLRPC$User) : getInputPeer(chat);
TLRPC.Chat chat2 = getChat(Long.valueOf(j));
boolean isChannel = ChatObject.isChannel(chat2);
if (isChannel) {
if (!UserObject.isUserSelf(tLRPC$User)) {
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).participant = inputPeer;
TLRPC.TL_chatBannedRights tL_chatBannedRights = new TLRPC.TL_chatBannedRights();
((TLRPC.TL_channels_editBanned) tL_channels_editBanned).banned_rights = tL_chatBannedRights;
tL_chatBannedRights.view_messages = true;
tL_chatBannedRights.send_media = true;
tL_chatBannedRights.send_messages = true;
tL_chatBannedRights.send_stickers = true;
tL_chatBannedRights.send_gifs = true;
tL_chatBannedRights.send_games = true;
tL_chatBannedRights.send_inline = true;
tL_chatBannedRights.embed_links = true;
tL_chatBannedRights.pin_messages = true;
tL_chatBannedRights.send_polls = true;
tL_chatBannedRights.invite_users = true;
tL_chatBannedRights.change_info = true;
tL_messages_deleteChatUser = tL_channels_editBanned;
} else if (chat2.creator && z) {
tL_messages_deleteChatUser = new TLRPC.TL_channels_deleteChannel();
tL_messages_deleteChatUser.channel = getInputChannel(chat2);
} else {
tL_messages_deleteChatUser = new TLRPC.TL_channels_leaveChannel();
((TLRPC.TL_channels_leaveChannel) tL_messages_deleteChatUser).channel = getInputChannel(chat2);
}
} else if (z) {
TLRPC.TL_messages_deleteChat tL_messages_deleteChat = new TLRPC.TL_messages_deleteChat();
tL_messages_deleteChat.chat_id = j;
getConnectionsManager().sendRequest(tL_messages_deleteChat, new MessagesController$.ExternalSyntheticLambda19());
return;
} else {
tL_messages_deleteChatUser = new TLRPC.TL_messages_deleteChatUser();
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).chat_id = j;
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).user_id = getInputUser(tLRPC$User);
((TLRPC.TL_messages_deleteChatUser) tL_messages_deleteChatUser).revoke_history = true;
}
if (UserObject.isUserSelf(tLRPC$User)) {
deleteDialog(-j, 0, z2);
}
getConnectionsManager().sendRequest(tL_messages_deleteChatUser, new MessagesController$.ExternalSyntheticLambda20(this, isChannel, tLRPC$User, j), 64);
}
public void deleteSavedDialog(long j) {
deleteSavedDialog(j, 0, null);
}
protected void deleteSavedDialog(long j, int i, TLRPC.InputPeer inputPeer) {
long peerDialogId = DialogObject.getPeerDialogId(inputPeer);
int[] iArr = {i};
MessagesController$.ExternalSyntheticLambda310 externalSyntheticLambda310 = new MessagesController$.ExternalSyntheticLambda310(this, peerDialogId, j, inputPeer, i, iArr);
if (iArr[0] > 0 || peerDialogId != 0) {
externalSyntheticLambda310.run();
} else {
getMessagesStorage().getSavedDialogMaxMessageId(j, new MessagesController$.ExternalSyntheticLambda311(iArr, externalSyntheticLambda310));
}
}
public void deleteSavedDialog(long j, TLRPC.InputPeer inputPeer) {
deleteSavedDialog(j, 0, inputPeer);
}
public void deleteUserChannelHistory(TLRPC.Chat chat, TLRPC$User tLRPC$User, TLRPC.Chat chat2, int i) {
long j = tLRPC$User != null ? tLRPC$User.id : chat2 != null ? chat2.id : 0L;
if (i == 0) {
getMessagesStorage().deleteUserChatHistory(-chat.id, j);
}
TLRPC.TL_channels_deleteParticipantHistory tL_channels_deleteParticipantHistory = new TLRPC.TL_channels_deleteParticipantHistory();
tL_channels_deleteParticipantHistory.channel = getInputChannel(chat);
tL_channels_deleteParticipantHistory.participant = tLRPC$User != null ? getInputPeer(tLRPC$User) : getInputPeer(chat2);
getConnectionsManager().sendRequest(tL_channels_deleteParticipantHistory, new MessagesController$.ExternalSyntheticLambda457(this, chat, tLRPC$User, chat2));
}
public void deleteUserPhoto(TLRPC.InputPhoto inputPhoto) {
TLRPC.Photo photo;
long clientUserId = getUserConfig().getClientUserId();
if (inputPhoto != null) {
TLRPC.TL_photos_deletePhotos tL_photos_deletePhotos = new TLRPC.TL_photos_deletePhotos();
tL_photos_deletePhotos.id.add(inputPhoto);
getDialogPhotos(clientUserId).removePhoto(inputPhoto.id);
getConnectionsManager().sendRequest(tL_photos_deletePhotos, null);
return;
}
DialogPhotos dialogPhotos = getDialogPhotos(clientUserId);
if (dialogPhotos != null && dialogPhotos.photos.size() > 0 && (photo = (TLRPC.Photo) dialogPhotos.photos.get(0)) != null) {
dialogPhotos.removePhoto(photo.id);
}
TLRPC.TL_photos_updateProfilePhoto tL_photos_updateProfilePhoto = new TLRPC.TL_photos_updateProfilePhoto();
tL_photos_updateProfilePhoto.id = new TLRPC.TL_inputPhotoEmpty();
TLRPC$User user = getUser(Long.valueOf(getUserConfig().getClientUserId()));
if (user == null) {
user = getUserConfig().getCurrentUser();
}
if (user == null) {
return;
}
if (user.photo != null) {
getMessagesStorage().clearUserPhoto(user.id, user.photo.photo_id);
}
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged, new Object[0]);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_ALL)});
getConnectionsManager().sendRequest(tL_photos_updateProfilePhoto, new MessagesController$.ExternalSyntheticLambda147(this, clientUserId));
}
public void didAddedNewTask(int i, long j, SparseArray<ArrayList<Integer>> sparseArray) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda449(this, i));
if (sparseArray != null) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda450(this, j, sparseArray));
}
}
public boolean didPressTranscribeButtonEnough() {
return this.transcribeButtonPressed >= 2;
}
@Override
public void didReceivedNotification(int i, int i2, Object... objArr) {
MessageObject messageObject;
TLRPC.InputFile inputFile;
Theme.ThemeInfo themeInfo;
TLRPC.InputFile inputFile2;
Theme.ThemeAccent themeAccent;
TLRPC.TL_theme tL_theme;
TLRPC.TL_inputThemeSettings tL_inputThemeSettings = null;
if (i == NotificationCenter.fileUploaded) {
String str = (String) objArr[0];
TLRPC.InputFile inputFile3 = (TLRPC.InputFile) objArr[1];
String str2 = this.uploadingAvatar;
if (str2 == null || !str2.equals(str)) {
String str3 = this.uploadingWallpaper;
if (str3 == null || !str3.equals(str)) {
Object obj = this.uploadingThemes.get(str);
if (obj instanceof Theme.ThemeInfo) {
themeInfo = (Theme.ThemeInfo) obj;
if (str.equals(themeInfo.uploadingThumb)) {
themeInfo.uploadedThumb = inputFile3;
themeInfo.uploadingThumb = null;
} else if (str.equals(themeInfo.uploadingFile)) {
themeInfo.uploadedFile = inputFile3;
themeInfo.uploadingFile = null;
}
inputFile = themeInfo.uploadedThumb;
inputFile2 = themeInfo.uploadedFile;
themeAccent = null;
} else if (obj instanceof Theme.ThemeAccent) {
Theme.ThemeAccent themeAccent2 = (Theme.ThemeAccent) obj;
if (str.equals(themeAccent2.uploadingThumb)) {
themeAccent2.uploadedThumb = inputFile3;
themeAccent2.uploadingThumb = null;
} else if (str.equals(themeAccent2.uploadingFile)) {
themeAccent2.uploadedFile = inputFile3;
themeAccent2.uploadingFile = null;
}
Theme.ThemeInfo themeInfo2 = themeAccent2.parentTheme;
TLRPC.InputFile inputFile4 = themeAccent2.uploadedThumb;
TLRPC.InputFile inputFile5 = themeAccent2.uploadedFile;
themeInfo = themeInfo2;
inputFile = inputFile4;
inputFile2 = inputFile5;
themeAccent = themeAccent2;
} else {
inputFile = null;
themeInfo = null;
inputFile2 = null;
themeAccent = null;
}
this.uploadingThemes.remove(str);
if (inputFile2 != null && inputFile != null) {
new File(str);
TL_account.uploadTheme uploadtheme = new TL_account.uploadTheme();
uploadtheme.mime_type = "application/x-tgtheme-android";
uploadtheme.file_name = "theme.attheme";
uploadtheme.file = inputFile2;
inputFile2.name = "theme.attheme";
uploadtheme.thumb = inputFile;
inputFile.name = "theme-preview.jpg";
uploadtheme.flags |= 1;
if (themeAccent != null) {
themeAccent.uploadedFile = null;
themeAccent.uploadedThumb = null;
tL_theme = themeAccent.info;
tL_inputThemeSettings = new TLRPC.TL_inputThemeSettings();
tL_inputThemeSettings.base_theme = Theme.getBaseThemeByKey(themeInfo.name);
tL_inputThemeSettings.accent_color = themeAccent.accentColor;
int i3 = themeAccent.accentColor2;
if (i3 != 0) {
tL_inputThemeSettings.flags |= 8;
tL_inputThemeSettings.outbox_accent_color = i3;
}
int i4 = themeAccent.myMessagesAccentColor;
if (i4 != 0) {
tL_inputThemeSettings.message_colors.add(Integer.valueOf(i4));
tL_inputThemeSettings.flags |= 1;
int i5 = themeAccent.myMessagesGradientAccentColor1;
if (i5 != 0) {
tL_inputThemeSettings.message_colors.add(Integer.valueOf(i5));
int i6 = themeAccent.myMessagesGradientAccentColor2;
if (i6 != 0) {
tL_inputThemeSettings.message_colors.add(Integer.valueOf(i6));
int i7 = themeAccent.myMessagesGradientAccentColor3;
if (i7 != 0) {
tL_inputThemeSettings.message_colors.add(Integer.valueOf(i7));
}
}
}
tL_inputThemeSettings.message_colors_animated = themeAccent.myMessagesAnimated;
}
tL_inputThemeSettings.flags |= 2;
tL_inputThemeSettings.wallpaper_settings = new TLRPC.TL_wallPaperSettings();
if (TextUtils.isEmpty(themeAccent.patternSlug)) {
TLRPC.TL_inputWallPaperNoFile tL_inputWallPaperNoFile = new TLRPC.TL_inputWallPaperNoFile();
tL_inputWallPaperNoFile.id = 0L;
tL_inputThemeSettings.wallpaper = tL_inputWallPaperNoFile;
} else {
TLRPC.TL_inputWallPaperSlug tL_inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
tL_inputWallPaperSlug.slug = themeAccent.patternSlug;
tL_inputThemeSettings.wallpaper = tL_inputWallPaperSlug;
TLRPC.WallPaperSettings wallPaperSettings = tL_inputThemeSettings.wallpaper_settings;
wallPaperSettings.intensity = (int) (themeAccent.patternIntensity * 100.0f);
wallPaperSettings.flags |= 8;
}
TLRPC.WallPaperSettings wallPaperSettings2 = tL_inputThemeSettings.wallpaper_settings;
wallPaperSettings2.motion = themeAccent.patternMotion;
long j = themeAccent.backgroundOverrideColor;
if (j != 0) {
wallPaperSettings2.background_color = (int) j;
wallPaperSettings2.flags |= 1;
}
long j2 = themeAccent.backgroundGradientOverrideColor1;
if (j2 != 0) {
wallPaperSettings2.second_background_color = (int) j2;
wallPaperSettings2.flags |= 16;
wallPaperSettings2.rotation = AndroidUtilities.getWallpaperRotation(themeAccent.backgroundRotation, true);
}
long j3 = themeAccent.backgroundGradientOverrideColor2;
if (j3 != 0) {
TLRPC.WallPaperSettings wallPaperSettings3 = tL_inputThemeSettings.wallpaper_settings;
wallPaperSettings3.third_background_color = (int) j3;
wallPaperSettings3.flags |= 32;
}
long j4 = themeAccent.backgroundGradientOverrideColor3;
if (j4 != 0) {
TLRPC.WallPaperSettings wallPaperSettings4 = tL_inputThemeSettings.wallpaper_settings;
wallPaperSettings4.fourth_background_color = (int) j4;
wallPaperSettings4.flags |= 64;
}
} else {
themeInfo.uploadedFile = null;
themeInfo.uploadedThumb = null;
tL_theme = themeInfo.info;
}
getConnectionsManager().sendRequest(uploadtheme, new MessagesController$.ExternalSyntheticLambda391(this, tL_theme, themeInfo, tL_inputThemeSettings, themeAccent));
}
} else {
TL_account.uploadWallPaper uploadwallpaper = new TL_account.uploadWallPaper();
uploadwallpaper.file = inputFile3;
uploadwallpaper.mime_type = "image/jpeg";
Theme.OverrideWallpaperInfo overrideWallpaperInfo = this.uploadingWallpaperInfo;
String str4 = this.uploadingWallpaper;
TLRPC.TL_wallPaperSettings tL_wallPaperSettings = new TLRPC.TL_wallPaperSettings();
((TLRPC.WallPaperSettings) tL_wallPaperSettings).blur = overrideWallpaperInfo.isBlurred;
((TLRPC.WallPaperSettings) tL_wallPaperSettings).motion = overrideWallpaperInfo.isMotion;
uploadwallpaper.settings = tL_wallPaperSettings;
Theme.OverrideWallpaperInfo overrideWallpaperInfo2 = this.uploadingWallpaperInfo;
overrideWallpaperInfo2.uploadingProgress = 1.0f;
overrideWallpaperInfo2.requestIds = new ArrayList();
this.uploadingWallpaperInfo.requestIds.add(Integer.valueOf(getConnectionsManager().sendRequest(uploadwallpaper, new MessagesController$.ExternalSyntheticLambda390(this, overrideWallpaperInfo, tL_wallPaperSettings, str4))));
}
} else {
TLRPC.TL_photos_uploadProfilePhoto tL_photos_uploadProfilePhoto = new TLRPC.TL_photos_uploadProfilePhoto();
tL_photos_uploadProfilePhoto.file = inputFile3;
tL_photos_uploadProfilePhoto.flags |= 1;
getConnectionsManager().sendRequest(tL_photos_uploadProfilePhoto, new MessagesController$.ExternalSyntheticLambda389(this));
}
} else if (i == NotificationCenter.fileUploadFailed) {
String str5 = (String) objArr[0];
String str6 = this.uploadingAvatar;
if (str6 == null || !str6.equals(str5)) {
String str7 = this.uploadingWallpaper;
if (str7 == null || !str7.equals(str5)) {
Object remove = this.uploadingThemes.remove(str5);
if (remove instanceof Theme.ThemeInfo) {
Theme.ThemeInfo themeInfo3 = (Theme.ThemeInfo) remove;
themeInfo3.uploadedFile = null;
themeInfo3.uploadedThumb = null;
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, new Object[]{themeInfo3, null});
} else if (remove instanceof Theme.ThemeAccent) {
Theme.ThemeAccent themeAccent3 = (Theme.ThemeAccent) remove;
themeAccent3.uploadingThumb = null;
getNotificationCenter().postNotificationName(NotificationCenter.themeUploadError, new Object[]{themeAccent3.parentTheme, themeAccent3});
}
} else {
this.uploadingWallpaper = null;
this.uploadingWallpaperInfo = null;
}
} else {
this.uploadingAvatar = null;
}
}
if (i == NotificationCenter.fileUploadProgressChanged) {
String str8 = (String) objArr[0];
String str9 = this.uploadingWallpaper;
if (str9 == null || !str9.equals(str8)) {
return;
}
this.uploadingWallpaperInfo.uploadingProgress = ((Long) objArr[1]).longValue() / ((Long) objArr[2]).longValue();
return;
}
if (i != NotificationCenter.messageReceivedByServer) {
if (i != NotificationCenter.updateMessageMedia) {
if (i == NotificationCenter.currentUserPremiumStatusChanged) {
loadAppConfig(false);
getContactsController().reloadContactsStatusesMaybe(true);
if ((!this.storyQualityFull || getUserConfig().isPremium()) && !getUserConfig().isPremium()) {
return;
}
getNotificationCenter().postNotificationName(NotificationCenter.storyQualityUpdate, new Object[0]);
return;
}
return;
}
TLRPC.Message message = (TLRPC.Message) objArr[0];
if (message.peer_id.channel_id != 0 || (messageObject = this.dialogMessagesByIds.get(message.id)) == null) {
return;
}
messageObject.messageOwner.media = MessageObject.getMedia(message);
if (MessageObject.getMedia(message).ttl_seconds != 0) {
if ((MessageObject.getMedia(message).photo instanceof TLRPC.TL_photoEmpty) || (MessageObject.getMedia(message).document instanceof TLRPC.TL_documentEmpty)) {
messageObject.setType();
getNotificationCenter().postNotificationName(NotificationCenter.notificationsSettingsUpdated, new Object[0]);
return;
}
return;
}
return;
}
if (((Boolean) objArr[6]).booleanValue()) {
return;
}
Integer num = (Integer) objArr[0];
Integer num2 = (Integer) objArr[1];
Long l = (Long) objArr[3];
ArrayList arrayList = (ArrayList) this.dialogMessage.get(l.longValue());
for (int i8 = 0; arrayList != null && i8 < arrayList.size(); i8++) {
MessageObject messageObject2 = (MessageObject) arrayList.get(i8);
if (messageObject2 != null && (messageObject2.getId() == num.intValue() || messageObject2.messageOwner.local_id == num.intValue())) {
messageObject2.messageOwner.id = num2.intValue();
messageObject2.messageOwner.send_state = 0;
}
MessageObject messageObject3 = this.dialogMessagesByIds.get(num.intValue());
if (messageObject3 != null) {
this.dialogMessagesByIds.remove(num.intValue());
this.dialogMessagesByIds.put(num2.intValue(), messageObject3);
}
}
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(l.longValue());
if (dialog != null && dialog.top_message == num.intValue()) {
dialog.top_message = num2.intValue();
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
if (DialogObject.isChatDialog(l.longValue())) {
TLRPC.ChatFull chatFull = (TLRPC.ChatFull) this.fullChats.get(-l.longValue());
TLRPC.Chat chat = getChat(Long.valueOf(-l.longValue()));
if (chat == null || ChatObject.hasAdminRights(chat) || chatFull == null || chatFull.slowmode_seconds == 0) {
return;
}
chatFull.slowmode_next_send_date = getConnectionsManager().getCurrentTime() + chatFull.slowmode_seconds;
chatFull.flags |= 262144;
getMessagesStorage().updateChatInfo(chatFull, false);
}
}
public void disableAds(boolean z) {
TLRPC.UserFull userFull = getUserFull(getUserConfig().getClientUserId());
if (userFull == null) {
return;
}
userFull.sponsored_enabled = false;
getMessagesStorage().updateUserInfo(userFull, false);
if (z) {
TL_account.toggleSponsoredMessages togglesponsoredmessages = new TL_account.toggleSponsoredMessages();
togglesponsoredmessages.enabled = false;
getConnectionsManager().sendRequest(togglesponsoredmessages, null);
}
}
public void lambda$checkDeletingTask$78(long j, long j2, int i) {
getMessagesStorage().removePendingTask(j);
ArrayList arrayList = new ArrayList();
arrayList.add(Integer.valueOf(i));
getMessagesStorage().emptyMessagesMedia(j2, arrayList);
}
public TLRPC.TL_dialogFolder ensureFolderDialogExists(int i, boolean[] zArr) {
if (i == 0) {
return null;
}
long makeFolderDialogId = DialogObject.makeFolderDialogId(i);
TLRPC.TL_dialogFolder tL_dialogFolder = (TLRPC.Dialog) this.dialogs_dict.get(makeFolderDialogId);
if (tL_dialogFolder instanceof TLRPC.TL_dialogFolder) {
if (zArr != null) {
zArr[0] = false;
}
return tL_dialogFolder;
}
if (zArr != null) {
zArr[0] = true;
}
TLRPC.Dialog tL_dialogFolder2 = new TLRPC.TL_dialogFolder();
tL_dialogFolder2.id = makeFolderDialogId;
tL_dialogFolder2.peer = new TLRPC.TL_peerUser();
TLRPC.TL_folder tL_folder = new TLRPC.TL_folder();
((TLRPC.TL_dialogFolder) tL_dialogFolder2).folder = tL_folder;
tL_folder.id = i;
tL_folder.title = LocaleController.getString(R.string.ArchivedChats);
tL_dialogFolder2.pinned = true;
int i2 = 0;
for (int i3 = 0; i3 < this.allDialogs.size(); i3++) {
TLRPC.Dialog dialog = this.allDialogs.get(i3);
if (!dialog.pinned) {
if (dialog.id != this.promoDialogId) {
break;
}
} else {
i2 = Math.max(dialog.pinnedNum, i2);
}
}
tL_dialogFolder2.pinnedNum = i2 + 1;
TLRPC.TL_messages_dialogs tL_messages_dialogs = new TLRPC.TL_messages_dialogs();
((TLRPC.messages_Dialogs) tL_messages_dialogs).dialogs.add(tL_dialogFolder2);
getMessagesStorage().putDialogs(tL_messages_dialogs, 1);
this.dialogs_dict.put(makeFolderDialogId, tL_dialogFolder2);
this.allDialogs.add(0, tL_dialogFolder2);
return tL_dialogFolder2;
}
public Runnable ensureMessagesLoaded(long j, int i, MessagesLoadedCallback messagesLoadedCallback) {
int i2;
int i3;
Timer timer;
long j2;
long j3;
boolean z;
int i4;
boolean z2;
int i5;
int i6;
int i7;
int i8;
long j4;
int i9;
int i10;
int i11;
int i12;
boolean z3;
int i13;
boolean z4;
boolean z5;
boolean z6;
MessagesController messagesController;
long j5;
int i14;
SharedPreferences notificationsSettings = getNotificationsSettings(this.currentAccount);
if (i == 0) {
i2 = notificationsSettings.getInt("diditem" + j, 0);
} else {
i2 = i;
}
int generateClassGuid = ConnectionsManager.generateClassGuid();
long j6 = DialogObject.isChatDialog(j) ? -j : 0L;
if (j6 != 0 && getMessagesController().getChat(Long.valueOf(j6)) == null) {
boolean[] zArr = new boolean[1];
Runnable[] runnableArr = new Runnable[1];
MessagesStorage messagesStorage = getMessagesStorage();
messagesStorage.getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda319(this, zArr, messagesStorage, j6, runnableArr, j, i2, messagesLoadedCallback));
return new MessagesController$.ExternalSyntheticLambda320(zArr, runnableArr);
}
int i15 = AndroidUtilities.isTablet() ? 30 : 20;
3 r8 = new 3(this, generateClassGuid, i15, i2, j, messagesLoadedCallback);
getNotificationCenter().addObserver(r8, NotificationCenter.messagesDidLoadWithoutProcess);
getNotificationCenter().addObserver(r8, NotificationCenter.loadingMessagesFailed);
if (i2 != 0) {
timer = null;
j2 = 0;
j3 = 0;
z = true;
i4 = 0;
z2 = true;
i5 = 0;
i6 = 3;
i7 = 0;
i8 = 0;
j4 = 0;
i9 = -1;
i10 = 0;
i11 = 0;
i12 = 0;
z3 = false;
i13 = 0;
z4 = true;
z5 = false;
z6 = false;
messagesController = this;
j5 = j;
i14 = i15;
i3 = generateClassGuid;
} else {
i3 = generateClassGuid;
timer = null;
j2 = 0;
j3 = 0;
z = true;
i4 = 0;
z2 = true;
i5 = 0;
i6 = 2;
i7 = 0;
i8 = 0;
j4 = 0;
i9 = -1;
i10 = 0;
i11 = 0;
i12 = 0;
z3 = false;
i13 = 0;
z4 = true;
z5 = false;
z6 = false;
messagesController = this;
j5 = j;
i14 = i15;
}
messagesController.loadMessagesInternal(j5, j3, z, i14, i2, i4, z2, i5, i3, i6, i7, i8, j4, i9, i10, i11, i12, z3, i13, z4, z5, z6, timer, j2);
return new MessagesController$.ExternalSyntheticLambda321(this, i3);
}
public ArrayList<TLRPC.TL_messages_stickerSet> filterPremiumStickers(ArrayList<TLRPC.TL_messages_stickerSet> arrayList) {
if (!premiumFeaturesBlocked()) {
return arrayList;
}
int i = 0;
while (i < arrayList.size()) {
TLRPC.TL_messages_stickerSet filterPremiumStickers = getInstance(this.currentAccount).filterPremiumStickers(arrayList.get(i));
if (filterPremiumStickers == null) {
arrayList.remove(i);
i--;
} else {
arrayList.set(i, filterPremiumStickers);
}
i++;
}
return arrayList;
}
public TLRPC.TL_messages_stickerSet filterPremiumStickers(TLRPC.TL_messages_stickerSet tL_messages_stickerSet) {
TLRPC.TL_messages_stickerSet tL_messages_stickerSet2;
Exception e;
if (!premiumFeaturesBlocked() || tL_messages_stickerSet == null) {
return tL_messages_stickerSet;
}
int i = 0;
for (int i2 = 0; i2 < ((TLRPC.messages_StickerSet) tL_messages_stickerSet).documents.size(); i2++) {
try {
} catch (Exception e2) {
tL_messages_stickerSet2 = tL_messages_stickerSet;
e = e2;
}
if (MessageObject.isPremiumSticker((TLRPC$Document) ((TLRPC.messages_StickerSet) tL_messages_stickerSet).documents.get(i2))) {
NativeByteBuffer nativeByteBuffer = new NativeByteBuffer(tL_messages_stickerSet.getObjectSize());
tL_messages_stickerSet.serializeToStream(nativeByteBuffer);
nativeByteBuffer.position(0);
tL_messages_stickerSet2 = new TLRPC.TL_messages_stickerSet();
nativeByteBuffer.readInt32(true);
tL_messages_stickerSet2.readParams(nativeByteBuffer, true);
nativeByteBuffer.reuse();
while (i < ((TLRPC.messages_StickerSet) tL_messages_stickerSet2).documents.size()) {
try {
if (MessageObject.isPremiumSticker((TLRPC$Document) ((TLRPC.messages_StickerSet) tL_messages_stickerSet2).documents.get(i))) {
((TLRPC.messages_StickerSet) tL_messages_stickerSet2).documents.remove(i);
((TLRPC.messages_StickerSet) tL_messages_stickerSet2).packs.remove(i);
i--;
if (((TLRPC.messages_StickerSet) tL_messages_stickerSet2).documents.isEmpty()) {
return null;
}
}
i++;
} catch (Exception e3) {
e = e3;
e.printStackTrace();
return tL_messages_stickerSet2;
}
}
return tL_messages_stickerSet2;
}
}
return tL_messages_stickerSet;
}
public void forceNoReload(long j, int i) {
LongSparseArray longSparseArray;
if (i == 1) {
longSparseArray = this.lastScheduledServerQueryTime;
} else if (i != 0) {
return;
} else {
longSparseArray = this.lastServerQueryTime;
}
longSparseArray.put(j, Long.valueOf(SystemClock.elapsedRealtime()));
}
public void forceResetDialogs() {
resetDialogs(true, getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
getNotificationsController().deleteAllNotificationChannels();
}
public void generateJoinMessage(long j, boolean z) {
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (chat == null || !ChatObject.isChannel(j, this.currentAccount)) {
return;
}
if ((ChatObject.isNotInChat(chat) && !z) || chat.creator || ChatObject.isMonoForum(chat)) {
return;
}
TLRPC.TL_messageService tL_messageService = new TLRPC.TL_messageService();
((TLRPC.Message) tL_messageService).flags = 256;
int newMessageId = getUserConfig().getNewMessageId();
((TLRPC.Message) tL_messageService).id = newMessageId;
((TLRPC.Message) tL_messageService).local_id = newMessageId;
((TLRPC.Message) tL_messageService).date = (!(chat instanceof TLRPC.TL_channel) || z) ? getConnectionsManager().getCurrentTime() : chat.date;
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Message) tL_messageService).from_id = tL_peerUser;
((TLRPC.Peer) tL_peerUser).user_id = getUserConfig().getClientUserId();
TLRPC.TL_peerChannel tL_peerChannel = new TLRPC.TL_peerChannel();
((TLRPC.Message) tL_messageService).peer_id = tL_peerChannel;
((TLRPC.Peer) tL_peerChannel).channel_id = j;
((TLRPC.Message) tL_messageService).dialog_id = -j;
((TLRPC.Message) tL_messageService).post = true;
TLRPC.TL_messageActionChatAddUser tL_messageActionChatAddUser = new TLRPC.TL_messageActionChatAddUser();
((TLRPC.Message) tL_messageService).action = tL_messageActionChatAddUser;
((TLRPC.MessageAction) tL_messageActionChatAddUser).users.add(Long.valueOf(getUserConfig().getClientUserId()));
getUserConfig().saveConfig(false);
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
arrayList2.add(tL_messageService);
arrayList.add(new MessageObject(this.currentAccount, tL_messageService, true, false));
getMessagesStorage().putMessages(arrayList2, true, true, false, 0, 0, 0L);
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda195(this, j, arrayList));
}
public int getAboutLimit() {
return getUserConfig().isPremium() ? this.aboutLengthLimitPremium : this.aboutLengthLimitDefault;
}
public ArrayList<Long> getActiveGroupCalls() {
return new ArrayList<>(this.activeVoiceChatsMap.keySet());
}
public TLRPC.ChannelParticipant getAdminInChannel(long j, long j2) {
LongSparseArray longSparseArray = (LongSparseArray) this.channelAdmins.get(j2);
if (longSparseArray == null) {
return null;
}
return (TLRPC.ChannelParticipant) longSparseArray.get(j);
}
public String getAdminRank(long j, long j2) {
TLRPC.ChannelParticipant channelParticipant;
if (j == j2) {
return "";
}
LongSparseArray longSparseArray = (LongSparseArray) this.channelAdmins.get(j);
if (longSparseArray == null || (channelParticipant = (TLRPC.ChannelParticipant) longSparseArray.get(j2)) == null) {
return null;
}
String str = channelParticipant.rank;
return str != null ? str : "";
}
public ArrayList<TLRPC.Dialog> getAllDialogs() {
return this.allDialogs;
}
public int getAllFoldersDialogsCount() {
int i = 0;
for (int i2 = 0; i2 < this.dialogsByFolder.size(); i2++) {
SparseArray<ArrayList<TLRPC.Dialog>> sparseArray = this.dialogsByFolder;
ArrayList<TLRPC.Dialog> arrayList = sparseArray.get(sparseArray.keyAt(i2));
if (arrayList != null) {
i += arrayList.size();
}
}
return i;
}
public TLRPC.messages_AvailableEffects getAvailableEffects() {
if (!this.loadingAvailableEffects) {
this.loadingAvailableEffects = true;
this.effectsFetcher.fetch(this.currentAccount, 0, new MessagesController$.ExternalSyntheticLambda455(this));
}
return this.availableEffects;
}
public void getBlockedPeers(boolean z) {
if (!getUserConfig().isClientActivated() || this.loadingBlockedPeers) {
return;
}
this.loadingBlockedPeers = true;
TLRPC.TL_contacts_getBlocked tL_contacts_getBlocked = new TLRPC.TL_contacts_getBlocked();
tL_contacts_getBlocked.offset = z ? 0 : this.blockePeers.size();
tL_contacts_getBlocked.limit = z ? 20 : 100;
getConnectionsManager().sendRequest(tL_contacts_getBlocked, new MessagesController$.ExternalSyntheticLambda250(this, z, tL_contacts_getBlocked));
}
public ChannelBoostsController getBoostsController() {
ChannelBoostsController channelBoostsController = this.channelBoostsControler;
if (channelBoostsController != null) {
return channelBoostsController;
}
synchronized (lockObjects[this.currentAccount]) {
try {
ChannelBoostsController channelBoostsController2 = this.channelBoostsControler;
if (channelBoostsController2 != null) {
return channelBoostsController2;
}
ChannelBoostsController channelBoostsController3 = new ChannelBoostsController(this.currentAccount);
this.channelBoostsControler = channelBoostsController3;
return channelBoostsController3;
} catch (Throwable th) {
throw th;
}
}
}
public CacheByChatsController getCacheByChatsController() {
return this.cacheByChatsController;
}
public ChannelRecommendations getCachedChannelRecommendations(long j) {
HashMap<Long, ChannelRecommendations> hashMap = this.cachedChannelRecommendations;
if (hashMap == null) {
return null;
}
return hashMap.get(Long.valueOf(j));
}
public TLRPC.TL_exportedContactToken getCachedContactToken() {
if (this.cachedContactToken == null || r0.expires <= System.currentTimeMillis() / 1000) {
return null;
}
return this.cachedContactToken;
}
public int getCaptionMaxLengthLimit() {
return getUserConfig().isPremium() ? this.captionLengthLimitPremium : this.captionLengthLimitDefault;
}
protected void getChannelDifference(long r17, int r19, long r20, org.telegram.tgnet.TLRPC.InputChannel r22) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.getChannelDifference(long, int, long, org.telegram.tgnet.TLRPC$InputChannel):void");
}
public void getChannelParticipant(TLRPC.Chat chat, TLRPC$User tLRPC$User, Utilities.Callback<TLRPC.ChannelParticipant> callback) {
if (chat == null || tLRPC$User == null) {
if (callback != null) {
callback.run((Object) null);
}
} else {
TLRPC.TL_channels_getParticipant tL_channels_getParticipant = new TLRPC.TL_channels_getParticipant();
tL_channels_getParticipant.channel = getInputChannel(chat.id);
tL_channels_getParticipant.participant = getInputPeer(tLRPC$User);
getConnectionsManager().sendRequest(tL_channels_getParticipant, new MessagesController$.ExternalSyntheticLambda358(callback));
}
}
public ChannelRecommendations getChannelRecommendations(long j) {
ChannelRecommendations channelRecommendations;
TL_bots.getBotRecommendations getbotrecommendations;
if (this.cachedChannelRecommendations == null) {
this.cachedChannelRecommendations = new HashMap<>();
}
boolean isPremium = getUserConfig().isPremium();
if (this.cachedChannelRecommendations.containsKey(Long.valueOf(j))) {
channelRecommendations = this.cachedChannelRecommendations.get(Long.valueOf(j));
if (channelRecommendations == null || channelRecommendations.wasPremium == isPremium) {
return channelRecommendations;
}
} else {
channelRecommendations = null;
}
if (j > 0) {
getbotrecommendations = new TL_bots.getBotRecommendations();
TLRPC.InputUser inputUser = getInputUser(j);
getbotrecommendations.bot = inputUser;
if (inputUser == null) {
return null;
}
} else {
TL_bots.getBotRecommendations tL_channels_getChannelRecommendations = new TLRPC.TL_channels_getChannelRecommendations();
if (j != 0) {
((TLRPC.TL_channels_getChannelRecommendations) tL_channels_getChannelRecommendations).flags |= 1;
TLRPC.InputChannel inputChannel = getInputChannel(-j);
((TLRPC.TL_channels_getChannelRecommendations) tL_channels_getChannelRecommendations).channel = inputChannel;
if (inputChannel == null) {
return null;
}
}
getbotrecommendations = tL_channels_getChannelRecommendations;
}
this.cachedChannelRecommendations.put(Long.valueOf(j), null);
getConnectionsManager().sendRequest(getbotrecommendations, new MessagesController$.ExternalSyntheticLambda417(this, isPremium, j));
return channelRecommendations;
}
public TLRPC.Chat getChat(Long l) {
return (TLRPC.Chat) this.chats.get(l);
}
public TLRPC.TL_chatAdminRights getChatAdminRightsCached(TLRPC.Chat chat, TLRPC$User tLRPC$User) {
TLRPC.ChatParticipants chatParticipants;
ArrayList arrayList;
TLRPC.ChannelParticipant channelParticipant;
if (chat != null && tLRPC$User != null) {
if (UserObject.isUserSelf(tLRPC$User)) {
return chat.admin_rights;
}
TLRPC.ChatFull chatFull = getChatFull(chat.id);
if (chatFull != null && (chatParticipants = chatFull.participants) != null && (arrayList = chatParticipants.participants) != null) {
for (int i = 0; i < arrayList.size(); i++) {
TLRPC.TL_chatChannelParticipant tL_chatChannelParticipant = (TLRPC.ChatParticipant) arrayList.get(i);
if (tL_chatChannelParticipant != null && ((TLRPC.ChatParticipant) tL_chatChannelParticipant).user_id == tLRPC$User.id) {
if (!(tL_chatChannelParticipant instanceof TLRPC.TL_chatChannelParticipant) || (channelParticipant = tL_chatChannelParticipant.channelParticipant) == null) {
return null;
}
return channelParticipant.admin_rights;
}
}
}
}
return null;
}
public TLRPC.ChatFull getChatFull(long j) {
return (TLRPC.ChatFull) this.fullChats.get(j);
}
public int getChatMaxUniqReactions(long j) {
TLRPC.ChatFull chatFull = getInstance(this.currentAccount).getChatFull(-j);
return (chatFull == null || (!(chatFull instanceof TLRPC.TL_chatFull) ? (chatFull.flags2 & 8192) != 0 : (chatFull.flags & 1048576) != 0)) ? this.reactionsUniqMax : chatFull.reactions_limit;
}
public int getChatPendingRequestsOnClosed(long j) {
return this.mainPreferences.getInt("chatPendingRequests" + j, 0);
}
public int getChatReactionsCount() {
if (getUserConfig().isPremium()) {
return this.reactionsInChatMax;
}
return 1;
}
public TL_chatlists.TL_chatlists_chatlistUpdates getChatlistFolderUpdates(int i) {
ChatlistUpdatesStat chatlistUpdatesStat = this.chatlistFoldersUpdates.get(i);
if (chatlistUpdatesStat == null) {
return null;
}
return chatlistUpdatesStat.lastValue;
}
public ConcurrentHashMap<Long, TLRPC.Chat> getChats() {
return this.chats;
}
public CommonChatsList getCommonChats(long j) {
return getCommonChats(j, true);
}
public CommonChatsList getCommonChats(long j, boolean z) {
CommonChatsList commonChatsList = this.commonChats.get(j);
if (commonChatsList != null || !z) {
return commonChatsList;
}
android.util.LongSparseArray<CommonChatsList> longSparseArray = this.commonChats;
CommonChatsList commonChatsList2 = new CommonChatsList(this.currentAccount, j);
longSparseArray.put(j, commonChatsList2);
return commonChatsList2;
}
public TL_account.contentSettings getContentSettings() {
return this.contentSettings;
}
public void getContentSettings(Utilities.Callback<TL_account.contentSettings> callback) {
if (this.contentSettings != null && System.currentTimeMillis() - this.contentSettingsLoadedTime < 3600000) {
if (callback != null) {
callback.run(this.contentSettings);
return;
}
return;
}
if (this.contentSettingsCallbacks == null) {
this.contentSettingsCallbacks = new ArrayList<>();
}
if (callback != null) {
this.contentSettingsCallbacks.add(callback);
}
if (this.contentSettingsLoading) {
return;
}
this.contentSettingsLoading = true;
getConnectionsManager().sendRequest(new TL_account.getContentSettings(), new MessagesController$.ExternalSyntheticLambda125(this));
}
public TLRPC.Dialog getDialog(long j) {
return (TLRPC.Dialog) this.dialogs_dict.get(j);
}
public ArrayList<DialogFilter> getDialogFilters() {
ArrayList<DialogFilter> arrayList = this.frozenDialogFilters;
return arrayList != null ? arrayList : this.dialogFilters;
}
public DialogPhotos getDialogPhotos(long j) {
DialogPhotos dialogPhotos = (DialogPhotos) this.dialogPhotos.get(j);
if (dialogPhotos != null) {
return dialogPhotos;
}
LongSparseArray longSparseArray = this.dialogPhotos;
DialogPhotos dialogPhotos2 = new DialogPhotos(this, j);
longSparseArray.put(j, dialogPhotos2);
return dialogPhotos2;
}
public int getDialogUnreadCount(TLRPC.Dialog dialog) {
if (dialog == null) {
return 0;
}
int i = dialog.unread_count;
TLRPC.Chat chat = getChat(Long.valueOf(-dialog.id));
return chat != null ? (chat.forum || chat.monoforum) ? this.topicsController.getForumUnreadCount(-dialog.id)[0] : i : i;
}
public ArrayList<TLRPC.Dialog> getDialogs(int i) {
ArrayList<TLRPC.Dialog> arrayList = this.dialogsByFolder.get(i);
return arrayList == null ? new ArrayList<>() : arrayList;
}
public void getDifference() {
getDifference(getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue(), false);
}
public void getDifference(int i, int i2, int i3, boolean z) {
registerForPush(SharedConfig.pushType, SharedConfig.pushString);
if (getMessagesStorage().getLastPtsValue() == 0) {
loadCurrentState();
return;
}
if (z || !this.gettingDifference) {
this.gettingDifference = true;
TLRPC.TL_updates_getDifference tL_updates_getDifference = new TLRPC.TL_updates_getDifference();
tL_updates_getDifference.pts = i;
tL_updates_getDifference.date = i2;
tL_updates_getDifference.qts = i3;
if (this.getDifferenceFirstSync) {
tL_updates_getDifference.flags |= 1;
tL_updates_getDifference.pts_total_limit = ApplicationLoader.isConnectedOrConnectingToWiFi() ? 5000 : 1000;
this.getDifferenceFirstSync = false;
}
if (tL_updates_getDifference.date == 0) {
tL_updates_getDifference.date = getConnectionsManager().getCurrentTime();
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("start getDifference with date = " + i2 + " pts = " + i + " qts = " + i3);
FileLog.d("getDifference: isUpdating = true");
}
getConnectionsManager().setIsUpdating(true);
getConnectionsManager().sendRequest(tL_updates_getDifference, new MessagesController$.ExternalSyntheticLambda404(this, i2, i3));
}
}
public TLRPC.TL_availableEffect getEffect(long j) {
getAvailableEffects();
if (this.availableEffects == null) {
return null;
}
for (int i = 0; i < this.availableEffects.effects.size(); i++) {
if (((TLRPC.TL_availableEffect) this.availableEffects.effects.get(i)).id == j) {
return (TLRPC.TL_availableEffect) this.availableEffects.effects.get(i);
}
}
return null;
}
public TLRPC$Document getEffectDocument(long j) {
if (this.availableEffects == null) {
return null;
}
for (int i = 0; i < this.availableEffects.documents.size(); i++) {
if (((TLRPC$Document) this.availableEffects.documents.get(i)).id == j) {
return (TLRPC$Document) this.availableEffects.documents.get(i);
}
}
return null;
}
public TLRPC.EncryptedChat getEncryptedChat(Integer num) {
return (TLRPC.EncryptedChat) this.encryptedChats.get(num);
}
public TLRPC.EncryptedChat getEncryptedChatDB(int i, boolean z) {
TLRPC.EncryptedChat encryptedChat = (TLRPC.EncryptedChat) this.encryptedChats.get(Integer.valueOf(i));
if (encryptedChat != null) {
if (!z) {
return encryptedChat;
}
if (!(encryptedChat instanceof TLRPC.TL_encryptedChatWaiting) && !(encryptedChat instanceof TLRPC.TL_encryptedChatRequested)) {
return encryptedChat;
}
}
CountDownLatch countDownLatch = new CountDownLatch(1);
ArrayList arrayList = new ArrayList();
getMessagesStorage().getEncryptedChat(i, countDownLatch, arrayList);
try {
countDownLatch.await();
} catch (Exception e) {
FileLog.e(e);
}
if (arrayList.size() != 2) {
return encryptedChat;
}
TLRPC.EncryptedChat encryptedChat2 = (TLRPC.EncryptedChat) arrayList.get(0);
TLRPC$User tLRPC$User = (TLRPC$User) arrayList.get(1);
putEncryptedChat(encryptedChat2, false);
putUser(tLRPC$User, true);
return encryptedChat2;
}
public TLRPC.TL_chatInviteExported getExportedInvite(long j) {
return (TLRPC.TL_chatInviteExported) this.exportedChats.get(j);
}
public int getFilterIdByDialogsType(int i) {
if (i != 7 && i != 8) {
return 0;
}
DialogFilter dialogFilter = this.selectedDialogFilter[i - 7];
if (dialogFilter == null) {
return -1;
}
return dialogFilter.id;
}
public long getForumLastTopicId(long j) {
return this.mainPreferences.getLong("forumlasttopic" + j, 1L);
}
public String getFullName(long j) {
if (j > 0) {
TLRPC$User user = getUser(Long.valueOf(j));
if (user != null) {
return ContactsController.formatName(user.first_name, user.last_name);
}
return null;
}
TLRPC.Chat chat = getChat(Long.valueOf(-j));
if (chat != null) {
return chat.title;
}
return null;
}
public ChatObject.Call getGroupCall(long j, boolean z) {
return getGroupCall(j, z, null);
}
public ChatObject.Call getGroupCall(long j, boolean z, Runnable runnable) {
TLRPC.InputGroupCall inputGroupCall;
TLRPC.ChatFull chatFull = getChatFull(j);
if (chatFull == null || (inputGroupCall = chatFull.call) == null) {
return null;
}
ChatObject.Call call = (ChatObject.Call) this.groupCalls.get(inputGroupCall.id);
if (call == null && z && !this.loadingGroupCalls.contains(Long.valueOf(j))) {
this.loadingGroupCalls.add(Long.valueOf(j));
if (chatFull.call != null) {
TL_phone.getGroupCall getgroupcall = new TL_phone.getGroupCall();
getgroupcall.call = chatFull.call;
getgroupcall.limit = 20;
getConnectionsManager().sendRequest(getgroupcall, new MessagesController$.ExternalSyntheticLambda156(this, j, runnable));
}
}
if (call == null || !(call.call instanceof TLRPC.TL_groupCallDiscarded)) {
return call;
}
return null;
}
public TLRPC.InputChannel getInputChannel(long j) {
return getInputChannel(getChat(Long.valueOf(j)));
}
public TLRPC.InputDocument getInputDocument(TLRPC$Document tLRPC$Document) {
if (tLRPC$Document == null) {
return null;
}
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
byte[] bArr = tLRPC$Document.file_reference;
((TLRPC.InputDocument) tL_inputDocument).file_reference = bArr;
if (bArr == null) {
((TLRPC.InputDocument) tL_inputDocument).file_reference = new byte[0];
}
return tL_inputDocument;
}
public TLRPC.InputPeer getInputPeer(long j) {
TLRPC.TL_inputPeerChannel tL_inputPeerUser;
long j2;
if (j == getUserConfig().getClientUserId()) {
return new TLRPC.TL_inputPeerSelf();
}
if (j >= 0) {
TLRPC$User user = getUser(Long.valueOf(j));
tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
((TLRPC.InputPeer) tL_inputPeerUser).user_id = j;
if (user != null) {
j2 = user.access_hash;
}
return tL_inputPeerUser;
}
long j3 = -j;
TLRPC.Chat chat = getChat(Long.valueOf(j3));
if (!ChatObject.isChannel(chat)) {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = j3;
return tL_inputPeerChat;
}
tL_inputPeerUser = new TLRPC.TL_inputPeerChannel();
((TLRPC.InputPeer) tL_inputPeerUser).channel_id = j3;
j2 = chat.access_hash;
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = j2;
return tL_inputPeerUser;
}
public TLRPC.InputPeer getInputPeer(TLRPC.Peer peer) {
TLRPC.TL_inputPeerChannel tL_inputPeerUser;
long j;
if (peer instanceof TLRPC.TL_peerChat) {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = peer.chat_id;
return tL_inputPeerChat;
}
if (peer instanceof TLRPC.TL_peerChannel) {
tL_inputPeerUser = new TLRPC.TL_inputPeerChannel();
long j2 = peer.channel_id;
((TLRPC.InputPeer) tL_inputPeerUser).channel_id = j2;
TLRPC.Chat chat = getChat(Long.valueOf(j2));
if (chat == null) {
return tL_inputPeerUser;
}
j = chat.access_hash;
} else {
tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
long j3 = peer.user_id;
((TLRPC.InputPeer) tL_inputPeerUser).user_id = j3;
TLRPC$User user = getUser(Long.valueOf(j3));
if (user == null) {
return tL_inputPeerUser;
}
j = user.access_hash;
}
((TLRPC.InputPeer) tL_inputPeerUser).access_hash = j;
return tL_inputPeerUser;
}
public TLRPC.InputUser getInputUser(long j) {
return getInputUser(getUser(Long.valueOf(j)));
}
public TLRPC.InputUser getInputUser(TLRPC.InputPeer inputPeer) {
if (inputPeer == null) {
return new TLRPC.TL_inputUserEmpty();
}
if (inputPeer instanceof TLRPC.TL_inputPeerSelf) {
return new TLRPC.TL_inputUserSelf();
}
TLRPC.TL_inputUser tL_inputUser = new TLRPC.TL_inputUser();
((TLRPC.InputUser) tL_inputUser).user_id = inputPeer.user_id;
((TLRPC.InputUser) tL_inputUser).access_hash = inputPeer.access_hash;
return tL_inputUser;
}
public TLRPC.InputUser getInputUser(TLRPC$User tLRPC$User) {
if (tLRPC$User == null) {
return new TLRPC.TL_inputUserEmpty();
}
if (tLRPC$User.id == getUserConfig().getClientUserId()) {
return new TLRPC.TL_inputUserSelf();
}
TLRPC.TL_inputUser tL_inputUser = new TLRPC.TL_inputUser();
((TLRPC.InputUser) tL_inputUser).user_id = tLRPC$User.id;
((TLRPC.InputUser) tL_inputUser).access_hash = tLRPC$User.access_hash;
return tL_inputUser;
}
public SharedPreferences getMainSettings() {
return this.mainPreferences;
}
public int getMaxUserReactionsCount() {
return getUserConfig().isPremium() ? this.reactionsUserMaxPremium : this.reactionsUserMaxDefault;
}
public TLRPC.Chat getMonoForumLinkedChat(long j) {
TLRPC.Chat chat;
TLRPC.Chat chat2;
TLRPC.Chat chat3 = getChat(Long.valueOf(j));
if (chat3 != null && (chat2 = getChat(Long.valueOf(chat3.linked_monoforum_id))) != null) {
return chat2;
}
Long l = (Long) this.monoForumLinkedChannels.get(Long.valueOf(j));
if (l == null || (chat = getChat(l)) == null) {
return null;
}
return chat;
}
public String getMutedString(long j, long j2) {
if (!getMessagesController().isDialogMuted(j, j2)) {
return LocaleController.getString(R.string.NotificationsUnmuted);
}
int i = this.notificationsPreferences.getInt("notifyuntil_" + NotificationsController.getSharedPrefKey(j, j2), 0);
return i >= getConnectionsManager().getCurrentTime() ? LocaleController.formatString("NotificationsMutedForHint", R.string.NotificationsMutedForHint, LocaleController.formatTTLString(i)) : LocaleController.getString(R.string.NotificationsMuted);
}
public void getNewDeleteTask(LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda45(this, longSparseArray, longSparseArray2));
}
public void getNextReactionMention(long j, long j2, int i, Consumer consumer) {
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda83(this, j2, j, consumer, i));
}
public Long getPaidReactionsDialogId() {
if (this.paidReactionsPrivacy == null && !this.loadingArePaidReactionsAnonymous) {
this.loadingArePaidReactionsAnonymous = true;
getConnectionsManager().sendRequest(new TLRPC.TL_messages_getPaidReactionPrivacy(), null);
}
return this.paidReactionsPrivacy;
}
public TLRPC.Peer getPeer(long j) {
if (j >= 0) {
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Peer) tL_peerUser).user_id = j;
return tL_peerUser;
}
long j2 = -j;
TLRPC.Chat chat = getChat(Long.valueOf(j2));
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 = j2;
return tL_peerChannel;
}
TLRPC.TL_peerChat tL_peerChat = new TLRPC.TL_peerChat();
((TLRPC.Peer) tL_peerChat).chat_id = j2;
return tL_peerChat;
}
public String getPeerName(long j) {
return getPeerName(j, false);
}
public String getPeerName(long j, boolean z) {
String str;
if (j >= 0) {
TLRPC$User user = getUser(Long.valueOf(j));
str = z ? UserObject.getFirstName(user, true) : UserObject.getUserName(user);
} else {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
str = chat == null ? "" : chat.title;
}
return AndroidUtilities.removeRTL(AndroidUtilities.removeDiacritics(str));
}
public TLRPC.PeerSettings getPeerSettings(long j) {
TLRPC.PeerSettings peerSettings;
TLRPC.UserFull userFull = getUserFull(j);
return (userFull == null || (peerSettings = userFull.settings) == null) ? (TLRPC.PeerSettings) this.userPeerSettings.get(j) : peerSettings;
}
public CharSequence getPrintingString(long j, long j2, boolean z) {
LongSparseArray longSparseArray;
TLRPC$User user;
TLRPC.UserStatus userStatus;
if ((!z || !DialogObject.isUserDialog(j) || (user = getUser(Long.valueOf(j))) == null || (userStatus = user.status) == null || userStatus.expires >= 0) && (longSparseArray = (LongSparseArray) this.printingStrings.get(j)) != null) {
return (CharSequence) longSparseArray.get(j2);
}
return null;
}
public Integer getPrintingStringType(long j, long j2) {
LongSparseArray longSparseArray = (LongSparseArray) this.printingStringsTypes.get(j);
if (longSparseArray == null) {
return null;
}
return (Integer) longSparseArray.get(j2);
}
public String getRestrictionReason(ArrayList<TLRPC.RestrictionReason> arrayList) {
if (arrayList.isEmpty()) {
return null;
}
int size = arrayList.size();
for (int i = 0; i < size; i++) {
TLRPC.RestrictionReason restrictionReason = arrayList.get(i);
Set<String> set = this.ignoreRestrictionReasons;
if ((set == null || !set.contains(restrictionReason.reason)) && !"sensitive".equals(restrictionReason.reason) && ("all".equals(restrictionReason.platform) || !(ApplicationLoader.isStandaloneBuild() || BuildVars.isBetaApp() || !"android".equals(restrictionReason.platform)))) {
return restrictionReason.text;
}
}
return null;
}
public SavedMessagesController getSavedMessagesController() {
SavedMessagesController savedMessagesController = this.savedMessagesController;
if (savedMessagesController != null) {
return savedMessagesController;
}
synchronized (lockObjects[this.currentAccount]) {
try {
SavedMessagesController savedMessagesController2 = this.savedMessagesController;
if (savedMessagesController2 != null) {
return savedMessagesController2;
}
SavedMessagesController savedMessagesController3 = new SavedMessagesController(this.currentAccount);
this.savedMessagesController = savedMessagesController3;
return savedMessagesController3;
} catch (Throwable th) {
throw th;
}
}
}
public TLRPC.TL_messages_savedReactionsTags getSavedReactionTags(long j) {
return getSavedReactionTags(j, false);
}
public TLRPC.TL_messages_savedReactionsTags getSavedReactionTags(long j, boolean z) {
HashSet<Long> hashSet = this.loadingReactionTags;
if (hashSet != null && hashSet.contains(Long.valueOf(j)) && !z) {
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null) {
return null;
}
return (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(j);
}
if (this.loadingReactionTags == null) {
this.loadingReactionTags = new HashSet<>();
}
this.loadingReactionTags.add(Long.valueOf(j));
getMessagesStorage().getStorageQueue().postRunnable(new MessagesController$.ExternalSyntheticLambda302(this, j));
return null;
}
public int getSavedTagCount(long j, ReactionsLayoutInBubble.VisibleReaction visibleReaction) {
TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags;
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null || (tL_messages_savedReactionsTags = (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(j)) == null) {
return 0;
}
for (int i = 0; i < ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.size(); i++) {
if (visibleReaction.isSame(((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).reaction)) {
return ((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).count;
}
}
return 0;
}
public String getSavedTagName(TLRPC.Reaction reaction) {
TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags;
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null || (tL_messages_savedReactionsTags = (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(0L)) == null) {
return null;
}
for (int i = 0; i < ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.size(); i++) {
if (ReactionsLayoutInBubble.reactionsEqual(reaction, ((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).reaction)) {
return ((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).title;
}
}
return null;
}
public String getSavedTagName(ReactionsLayoutInBubble.VisibleReaction visibleReaction) {
TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags;
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null || (tL_messages_savedReactionsTags = (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(0L)) == null) {
return null;
}
for (int i = 0; i < ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.size(); i++) {
if (visibleReaction.isSame(((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).reaction)) {
return ((TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i)).title;
}
}
return null;
}
public TLRPC.TL_channels_sendAsPeers getSendAsPeers(long j) {
SendAsPeersInfo sendAsPeersInfo = (SendAsPeersInfo) this.sendAsPeers.get(j);
if (sendAsPeersInfo != null && (SendAsPeersInfo.access$500(sendAsPeersInfo) || Math.abs(SystemClock.elapsedRealtime() - SendAsPeersInfo.access$600(sendAsPeersInfo)) <= 300000)) {
return SendAsPeersInfo.access$400(sendAsPeersInfo);
}
TLRPC.Chat chat = getChat(Long.valueOf(-j));
if (chat != null && ChatObject.canSendAsPeers(chat)) {
SendAsPeersInfo sendAsPeersInfo2 = new SendAsPeersInfo(this, (1) null);
SendAsPeersInfo.access$502(sendAsPeersInfo2, true);
this.sendAsPeers.put(j, sendAsPeersInfo2);
TLRPC.TL_channels_getSendAs tL_channels_getSendAs = new TLRPC.TL_channels_getSendAs();
tL_channels_getSendAs.peer = getInputPeer(j);
getConnectionsManager().sendRequest(tL_channels_getSendAs, new MessagesController$.ExternalSyntheticLambda257(this, j, sendAsPeersInfo2));
}
return null;
}
public TLRPC.Peer getSendAsSelectedPeer(long j) {
TLRPC.Peer peer;
TLRPC.ChatFull chatFull = getChatFull(-j);
if (chatFull != null && (peer = chatFull.default_send_as) != null) {
return peer;
}
TLRPC.TL_peerUser tL_peerUser = new TLRPC.TL_peerUser();
((TLRPC.Peer) tL_peerUser).user_id = getAccountInstance().getUserConfig().clientUserId;
return tL_peerUser;
}
public long getSendPaidMessagesStars(long j) {
if (j > 0) {
if (j == getUserConfig().getClientUserId()) {
return 0L;
}
TLRPC.UserFull userFull = getUserFull(j);
if (userFull != null) {
return userFull.send_paid_messages_stars;
}
TLRPC$User user = getUser(Long.valueOf(j));
if (user != null && user.send_paid_messages_stars > 0) {
return DialogObject.getMessagesStarsPrice(isUserContactBlocked(user.id));
}
} else if (j < 0) {
long j2 = -j;
TLRPC.Chat chat = getChat(Long.valueOf(j2));
if (ChatObject.hasAdminRights(chat)) {
return 0L;
}
if (ChatObject.isMonoForum(chat) && ChatObject.canManageMonoForum(this.currentAccount, chat)) {
return 0L;
}
TLRPC.ChatFull chatFull = getChatFull(j2);
if (chatFull != null) {
return chatFull.send_paid_messages_stars;
}
if (chat != null) {
return chat.send_paid_messages_stars;
}
}
return 0L;
}
public SponsoredMessagesInfo getSponsoredMessages(long j) {
SponsoredMessagesInfo sponsoredMessagesInfo = (SponsoredMessagesInfo) this.sponsoredMessages.get(j);
if (sponsoredMessagesInfo != null && (sponsoredMessagesInfo.loading || Math.abs(SystemClock.elapsedRealtime() - sponsoredMessagesInfo.loadTime) <= 300000)) {
return sponsoredMessagesInfo;
}
if (j >= 0 ? !UserObject.isBot(getUser(Long.valueOf(j))) : !ChatObject.isChannel(getChat(Long.valueOf(-j)))) {
return null;
}
SponsoredMessagesInfo sponsoredMessagesInfo2 = new SponsoredMessagesInfo(this);
sponsoredMessagesInfo2.loading = true;
this.sponsoredMessages.put(j, sponsoredMessagesInfo2);
TLRPC.TL_messages_getSponsoredMessages tL_messages_getSponsoredMessages = new TLRPC.TL_messages_getSponsoredMessages();
tL_messages_getSponsoredMessages.peer = getInputPeer(j);
getConnectionsManager().sendRequest(tL_messages_getSponsoredMessages, new MessagesController$.ExternalSyntheticLambda169(this, j, sponsoredMessagesInfo2));
return null;
}
public StoriesController getStoriesController() {
StoriesController storiesController = this.storiesController;
if (storiesController != null) {
return storiesController;
}
synchronized (lockObjects[this.currentAccount]) {
try {
StoriesController storiesController2 = this.storiesController;
if (storiesController2 != null) {
return storiesController2;
}
StoriesController storiesController3 = new StoriesController(this.currentAccount);
this.storiesController = storiesController3;
return storiesController3;
} catch (Throwable th) {
throw th;
}
}
}
public TopicsController getTopicsController() {
return this.topicsController;
}
public int getTotalDialogsCount() {
ArrayList<TLRPC.Dialog> arrayList = this.dialogsByFolder.get(0);
if (arrayList != null) {
return arrayList.size();
}
return 0;
}
public TranslateController getTranslateController() {
return this.translateController;
}
public UnconfirmedAuthController getUnconfirmedAuthController() {
UnconfirmedAuthController unconfirmedAuthController = this.unconfirmedAuthController;
if (unconfirmedAuthController != null) {
return unconfirmedAuthController;
}
synchronized (lockObjects[this.currentAccount]) {
try {
UnconfirmedAuthController unconfirmedAuthController2 = this.unconfirmedAuthController;
if (unconfirmedAuthController2 != null) {
return unconfirmedAuthController2;
}
UnconfirmedAuthController unconfirmedAuthController3 = new UnconfirmedAuthController(this.currentAccount);
this.unconfirmedAuthController = unconfirmedAuthController3;
return unconfirmedAuthController3;
} catch (Throwable th) {
throw th;
}
}
}
public long getUpdatesStartTime(int i) {
if (i == 0) {
return this.updatesStartWaitTimeSeq;
}
if (i == 1) {
return this.updatesStartWaitTimePts;
}
if (i == 2) {
return this.updatesStartWaitTimeQts;
}
return 0L;
}
public TLRPC$User getUser(Long l) {
return l.longValue() == 0 ? UserConfig.getInstance(this.currentAccount).getCurrentUser() : (TLRPC$User) this.users.get(l);
}
public TLRPC$User getUser(String str) {
TLObject userOrChat = getUserOrChat(str);
if (userOrChat instanceof TLRPC$User) {
return (TLRPC$User) userOrChat;
}
return null;
}
public TLRPC.UserFull getUserFull(long j) {
return (TLRPC.UserFull) this.fullUsers.get(j);
}
public UserNameResolver getUserNameResolver() {
if (this.userNameResolver == null) {
this.userNameResolver = new UserNameResolver(this.currentAccount);
}
return this.userNameResolver;
}
public TLObject getUserOrChat(long j) {
ConcurrentHashMap<Long, TLRPC$User> concurrentHashMap;
if (this.users.containsKey(Long.valueOf(j))) {
concurrentHashMap = this.users;
} else {
j = -j;
if (!this.chats.containsKey(Long.valueOf(j))) {
return null;
}
concurrentHashMap = this.chats;
}
return (TLObject) concurrentHashMap.get(Long.valueOf(j));
}
public TLObject getUserOrChat(String str) {
if (str == null || str.length() == 0) {
return null;
}
return (TLObject) this.objectsByUsernames.get(str.toLowerCase());
}
public ConcurrentHashMap<Long, TLRPC$User> getUsers() {
return this.users;
}
public boolean hasAvailableEffects() {
TLRPC.messages_AvailableEffects messages_availableeffects = this.availableEffects;
return (messages_availableeffects == null || messages_availableeffects.effects.isEmpty()) ? false : true;
}
public boolean hasHiddenArchive() {
return SharedConfig.archiveHidden && this.dialogs_dict.get(DialogObject.makeFolderDialogId(1)) != null;
}
public void hidePeerSettingsBar(long j, TLRPC$User tLRPC$User, TLRPC.Chat chat) {
if (tLRPC$User == null && chat == null) {
return;
}
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
edit.putInt("dialog_bar_vis3" + j, 3);
edit.remove("dialog_bar_invite" + j);
edit.commit();
if (DialogObject.isEncryptedDialog(j)) {
return;
}
TLRPC.TL_messages_hidePeerSettingsBar tL_messages_hidePeerSettingsBar = new TLRPC.TL_messages_hidePeerSettingsBar();
tL_messages_hidePeerSettingsBar.peer = getInputPeer(tLRPC$User != null ? tLRPC$User.id : -chat.id);
getConnectionsManager().sendRequest(tL_messages_hidePeerSettingsBar, new MessagesController$.ExternalSyntheticLambda218());
}
public void hidePromoDialog() {
if (this.promoDialog == null) {
return;
}
TLRPC.TL_help_hidePromoData tL_help_hidePromoData = new TLRPC.TL_help_hidePromoData();
tL_help_hidePromoData.peer = getInputPeer(this.promoDialog.id);
getConnectionsManager().sendRequest(tL_help_hidePromoData, new MessagesController$.ExternalSyntheticLambda414());
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda415(this));
removePromoDialog();
}
public void incrementMoveCaptionHint() {
getMainSettings().edit().putInt("movecaptionhint", getMainSettings().getInt("movecaptionhint", 0) + 1).apply();
}
public void installTheme(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent, boolean z) {
TLRPC.TL_theme tL_theme = themeAccent != null ? themeAccent.info : themeInfo.info;
String str = themeAccent != null ? themeAccent.patternSlug : themeInfo.slug;
boolean z2 = themeAccent == null && themeInfo.isBlured;
boolean z3 = themeAccent != null ? themeAccent.patternMotion : themeInfo.isMotion;
TL_account.installTheme installtheme = new TL_account.installTheme();
installtheme.dark = z;
if (tL_theme != null) {
installtheme.format = "android";
TLRPC.TL_inputTheme tL_inputTheme = new TLRPC.TL_inputTheme();
tL_inputTheme.id = tL_theme.id;
tL_inputTheme.access_hash = tL_theme.access_hash;
installtheme.theme = tL_inputTheme;
installtheme.flags |= 2;
}
getConnectionsManager().sendRequest(installtheme, new MessagesController$.ExternalSyntheticLambda15());
if (TextUtils.isEmpty(str)) {
return;
}
TL_account.installWallPaper installwallpaper = new TL_account.installWallPaper();
TLRPC.TL_inputWallPaperSlug tL_inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
tL_inputWallPaperSlug.slug = str;
installwallpaper.wallpaper = tL_inputWallPaperSlug;
TLRPC.TL_wallPaperSettings tL_wallPaperSettings = new TLRPC.TL_wallPaperSettings();
installwallpaper.settings = tL_wallPaperSettings;
((TLRPC.WallPaperSettings) tL_wallPaperSettings).blur = z2;
((TLRPC.WallPaperSettings) tL_wallPaperSettings).motion = z3;
getConnectionsManager().sendRequest(installwallpaper, new MessagesController$.ExternalSyntheticLambda16());
}
public void invalidateChatlistFolderUpdate(int i) {
this.chatlistFoldersUpdates.remove(i);
getNotificationCenter().postNotificationName(NotificationCenter.chatlistFolderUpdate, new Object[]{Integer.valueOf(i)});
}
public void invalidateContentSettings() {
this.contentSettings = null;
this.contentSettingsLoadedTime = 0L;
}
public void invalidateUserPremiumBlocked(long j, int i) {
if (this.loadingFullUsers.contains(Long.valueOf(j))) {
return;
}
int indexOfKey = this.loadedFullUsers.indexOfKey(j);
if (indexOfKey >= 0) {
this.loadedFullUsers.removeAt(indexOfKey);
}
loadFullUser(getUser(Long.valueOf(j)), i, true);
}
public boolean isChannelAdminsLoaded(long j) {
return this.channelAdmins.get(j) != null;
}
public boolean isChatNoForwards(long j) {
return isChatNoForwards(getChat(Long.valueOf(j)));
}
public boolean isChatNoForwards(TLRPC.Chat chat) {
TLRPC.Chat chat2;
if (chat == null) {
return false;
}
TLRPC.InputChannel inputChannel = chat.migrated_to;
return (inputChannel == null || (chat2 = getChat(Long.valueOf(inputChannel.channel_id))) == null) ? chat.noforwards : chat2.noforwards;
}
public boolean isClearingDialog(long j) {
return this.clearingHistoryDialogs.get(j) != null;
}
public boolean isDialogMuted(long j, long j2) {
return isDialogMuted(j, j2, null);
}
public boolean isDialogMuted(long j, long j2, TLRPC.Chat chat) {
Boolean bool;
int i = this.notificationsPreferences.getInt("notify2_" + NotificationsController.getSharedPrefKey(j, j2), -1);
boolean z = false;
if (i == -1) {
if (chat != null) {
if (ChatObject.isChannel(chat) && !chat.megagroup) {
z = true;
}
bool = Boolean.valueOf(z);
} else {
bool = null;
}
return j2 != 0 ? isDialogMuted(j, 0L, chat) : !getNotificationsController().isGlobalNotificationsEnabled(j, bool, false, false);
}
if (i == 2) {
return true;
}
if (i == 3) {
if (this.notificationsPreferences.getInt("notifyuntil_" + NotificationsController.getSharedPrefKey(j, j2), 0) >= getConnectionsManager().getCurrentTime()) {
return true;
}
}
return false;
}
public boolean isDialogNotificationsSoundEnabled(long j, long j2) {
return this.notificationsPreferences.getBoolean("sound_enabled_" + NotificationsController.getSharedPrefKey(j, j2), true);
}
public boolean isDialogVisible(long j, boolean z) {
return (z ? this.visibleScheduledDialogMainThreadIds : this.visibleDialogMainThreadIds).contains(Long.valueOf(j));
}
public boolean isDialogsEndReached(int i) {
return this.dialogsEndReached.get(i);
}
public boolean isForum(long j) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
return chat != null && chat.forum;
}
public boolean isForum(MessageObject messageObject) {
return messageObject != null && isForum(messageObject.getDialogId());
}
public boolean isForum(TLRPC.Message message) {
return message != null && isForum(MessageObject.getDialogId(message));
}
public boolean isFrozen() {
return (this.freezeSinceDate == 0 || this.freezeUntilDate == 0) ? false : true;
}
public boolean isHiddenByUndo(long j) {
return !this.hiddenUndoChats.isEmpty() && this.hiddenUndoChats.contains(Long.valueOf(j));
}
public boolean isInChatCached(TLRPC.Chat chat, TLRPC$User tLRPC$User) {
TLRPC.ChatParticipants chatParticipants;
ArrayList arrayList;
if (chat != null && tLRPC$User != null) {
if (UserObject.isUserSelf(tLRPC$User)) {
return !ChatObject.isNotInChat(chat);
}
TLRPC.ChatFull chatFull = getChatFull(chat.id);
if (chatFull != null && (chatParticipants = chatFull.participants) != null && (arrayList = chatParticipants.participants) != null) {
for (int i = 0; i < arrayList.size(); i++) {
TLRPC.ChatParticipant chatParticipant = (TLRPC.ChatParticipant) arrayList.get(i);
if (chatParticipant != null && chatParticipant.user_id == tLRPC$User.id) {
return true;
}
}
}
}
return false;
}
public boolean isJoiningChannel(long j) {
return this.joiningToChannels.contains(Long.valueOf(j));
}
public boolean isLoadingDialogs(int i) {
return this.loadingDialogs.get(i);
}
public boolean isMonoForum(long j) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
return chat != null && chat.monoforum;
}
public boolean isMonoForumWithManageRights(long j) {
TLRPC.Chat chat = getChat(Long.valueOf(-j));
return ChatObject.isMonoForum(chat) && ChatObject.canManageMonoForum(this.currentAccount, chat);
}
public boolean isPremiumUser(TLRPC$User tLRPC$User) {
return (premiumFeaturesBlocked() || !tLRPC$User.premium || isSupportUser(tLRPC$User)) ? false : true;
}
public boolean isPromoDialog(long j, boolean z) {
TLRPC.Dialog dialog = this.promoDialog;
return dialog != null && dialog.id == j && (!z || this.isLeftPromoChannel);
}
public boolean isSendingSuggestedMessageApproval(long j, int i, boolean z) {
Boolean bool = this.sendingSuggestedMessageApprovalMap.get(j + "_" + i);
return bool != null && bool.booleanValue() == z;
}
public boolean isSensitive(ArrayList<TLRPC.RestrictionReason> arrayList) {
if (arrayList != null && !arrayList.isEmpty()) {
int size = arrayList.size();
for (int i = 0; i < size; i++) {
TLRPC.RestrictionReason restrictionReason = arrayList.get(i);
Set<String> set = this.ignoreRestrictionReasons;
if ((set == null || !set.contains(restrictionReason.reason)) && (("all".equals(restrictionReason.platform) || !(ApplicationLoader.isStandaloneBuild() || BuildVars.isBetaApp() || !"android".equals(restrictionReason.platform))) && "sensitive".equals(restrictionReason.reason))) {
return true;
}
}
}
return false;
}
public boolean isServerDialogsEndReached(int i) {
return this.serverDialogsEndReached.get(i);
}
public boolean isSponsoredDisabled() {
if (getUserFull(getUserConfig().getClientUserId()) == null) {
return false;
}
return !r0.sponsored_enabled;
}
public boolean isStoryQualityFullOnAccount() {
return getUserConfig().isPremium() && this.storyQualityFull;
}
public boolean isTranslationsAutoEnabled() {
return !"disabled".equals(this.translationsAutoEnabled);
}
public boolean isTranslationsManualEnabled() {
return !"disabled".equals(this.translationsManualEnabled);
}
public TL_account.RequirementToContact isUserContactBlocked(long j) {
return isUserContactBlocked(j, false);
}
public TL_account.RequirementToContact isUserContactBlocked(long j, boolean z) {
if (!getUserConfig().isPremium() && getUserConfig().getClientUserId() != j) {
TL_account.RequirementToContact requirementToContact = (TL_account.RequirementToContact) this.cachedIsUserContactBlocked.get(j);
if (requirementToContact != null) {
return requirementToContact;
}
TLRPC$User user = getUser(Long.valueOf(j));
if (user != null && !user.contact_require_premium && user.send_paid_messages_stars == 0) {
return null;
}
TLRPC.UserFull userFull = getUserFull(j);
if (userFull != null) {
return UserObject.getRequirementToContact(userFull);
}
if (getInputUser(j) == null || z) {
return null;
}
this.loadingIsUserContactBlocked.add(Long.valueOf(j));
AndroidUtilities.cancelRunOnUIThread(this.requestIsUserContactBlockedRunnable);
AndroidUtilities.runOnUIThread(this.requestIsUserContactBlockedRunnable, 60L);
}
return null;
}
public void loadAppConfig() {
loadAppConfig(true);
}
public void loadAppConfig(boolean z) {
AndroidUtilities.cancelRunOnUIThread(this.loadAppConfigRunnable);
if (z) {
this.appConfigFetcher.forceRequest(this.currentAccount, 0);
}
this.appConfigFetcher.fetch(this.currentAccount, 0, new MessagesController$.ExternalSyntheticLambda323(this));
}
public void loadChannelAdmins(long j, boolean z) {
if ((SystemClock.elapsedRealtime() / 1000) - this.loadingChannelAdmins.get(j) < 60) {
return;
}
this.loadingChannelAdmins.put(j, (int) (SystemClock.elapsedRealtime() / 1000));
if (z) {
getMessagesStorage().loadChannelAdmins(j);
return;
}
TLRPC.TL_channels_getParticipants tL_channels_getParticipants = new TLRPC.TL_channels_getParticipants();
tL_channels_getParticipants.channel = getInputChannel(j);
tL_channels_getParticipants.limit = 100;
tL_channels_getParticipants.filter = new TLRPC.TL_channelParticipantsAdmins();
getConnectionsManager().sendRequest(tL_channels_getParticipants, new MessagesController$.ExternalSyntheticLambda224(this, j));
}
public void loadChannelParticipants(Long l) {
loadChannelParticipants(l, null, 32);
}
public void loadChannelParticipants(Long l, Utilities.Callback<TLRPC.TL_channels_channelParticipants> callback, int i) {
if (callback == null && (this.loadingFullParticipants.contains(l) || this.loadedFullParticipants.contains(l))) {
return;
}
this.loadingFullParticipants.add(l);
TLRPC.TL_channels_getParticipants tL_channels_getParticipants = new TLRPC.TL_channels_getParticipants();
tL_channels_getParticipants.channel = getInputChannel(l.longValue());
tL_channels_getParticipants.filter = new TLRPC.TL_channelParticipantsRecent();
tL_channels_getParticipants.offset = 0;
tL_channels_getParticipants.limit = i;
getConnectionsManager().sendRequest(tL_channels_getParticipants, new MessagesController$.ExternalSyntheticLambda330(this, l, callback));
}
public void loadCurrentState() {
if (this.updatingState) {
return;
}
this.updatingState = true;
getConnectionsManager().sendRequest(new TLRPC.TL_updates_getState(), new MessagesController$.ExternalSyntheticLambda121(this));
}
public void loadDialogs(int i, int i2, int i3, boolean z) {
loadDialogs(i, i2, i3, z, null);
}
public void loadDialogs(int i, int i2, int i3, boolean z, Runnable runnable) {
TLRPC.TL_inputPeerEmpty tL_inputPeerEmpty;
long j;
if (this.loadingDialogs.get(i) || this.resetingDialogs) {
return;
}
this.loadingDialogs.put(i, true);
NotificationCenter notificationCenter = getNotificationCenter();
int i4 = NotificationCenter.dialogsNeedReload;
notificationCenter.postNotificationName(i4, new Object[0]);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("folderId = " + i + " load cacheOffset = " + i2 + " count = " + i3 + " cache = " + z);
}
if (z) {
getMessagesStorage().getDialogs(i, i2 == 0 ? 0 : this.nextDialogsCacheOffset.get(i, 0), i3, i == 0 && i2 == 0);
return;
}
TLRPC.TL_messages_getDialogs tL_messages_getDialogs = new TLRPC.TL_messages_getDialogs();
tL_messages_getDialogs.limit = i3;
tL_messages_getDialogs.exclude_pinned = true;
if (i != 0) {
tL_messages_getDialogs.flags |= 2;
tL_messages_getDialogs.folder_id = i;
}
long[] dialogLoadOffsets = getUserConfig().getDialogLoadOffsets(i);
long j2 = dialogLoadOffsets[0];
if (j2 == -1) {
ArrayList<TLRPC.Dialog> dialogs = getDialogs(i);
int size = dialogs.size() - 1;
while (true) {
if (size < 0) {
tL_inputPeerEmpty = new TLRPC.TL_inputPeerEmpty();
break;
}
TLRPC.Dialog dialog = dialogs.get(size);
if (!dialog.pinned && !DialogObject.isEncryptedDialog(dialog.id) && dialog.top_message > 0) {
ArrayList arrayList = (ArrayList) this.dialogMessage.get(dialog.id);
MessageObject messageObject = null;
if (arrayList != null) {
for (int i5 = 0; i5 < arrayList.size(); i5++) {
MessageObject messageObject2 = (MessageObject) arrayList.get(i5);
if (messageObject2 != null && (messageObject == null || messageObject2.getId() > messageObject.getId())) {
messageObject = (MessageObject) arrayList.get(i5);
}
}
}
if (messageObject != null && messageObject.getId() > 0) {
TLRPC.Message message = messageObject.messageOwner;
tL_messages_getDialogs.offset_date = message.date;
tL_messages_getDialogs.offset_id = message.id;
TLRPC.Peer peer = message.peer_id;
long j3 = peer.channel_id;
if (j3 == 0) {
j3 = peer.chat_id;
if (j3 == 0) {
j = peer.user_id;
tL_inputPeerEmpty = getInputPeer(j);
}
}
j = -j3;
tL_inputPeerEmpty = getInputPeer(j);
}
}
size--;
}
} else {
if (j2 == 2147483647L) {
this.dialogsEndReached.put(i, true);
this.serverDialogsEndReached.put(i, true);
this.loadingDialogs.put(i, false);
getNotificationCenter().postNotificationName(i4, new Object[0]);
return;
}
int i6 = (int) j2;
tL_messages_getDialogs.offset_id = i6;
tL_messages_getDialogs.offset_date = (int) dialogLoadOffsets[1];
if (i6 != 0) {
if (dialogLoadOffsets[4] != 0) {
TLRPC.TL_inputPeerChannel tL_inputPeerChannel = new TLRPC.TL_inputPeerChannel();
tL_messages_getDialogs.offset_peer = tL_inputPeerChannel;
((TLRPC.InputPeer) tL_inputPeerChannel).channel_id = dialogLoadOffsets[4];
} else if (dialogLoadOffsets[2] != 0) {
TLRPC.TL_inputPeerUser tL_inputPeerUser = new TLRPC.TL_inputPeerUser();
tL_messages_getDialogs.offset_peer = tL_inputPeerUser;
((TLRPC.InputPeer) tL_inputPeerUser).user_id = dialogLoadOffsets[2];
} else {
TLRPC.TL_inputPeerChat tL_inputPeerChat = new TLRPC.TL_inputPeerChat();
tL_messages_getDialogs.offset_peer = tL_inputPeerChat;
((TLRPC.InputPeer) tL_inputPeerChat).chat_id = dialogLoadOffsets[3];
}
tL_messages_getDialogs.offset_peer.access_hash = dialogLoadOffsets[5];
getConnectionsManager().sendRequest(tL_messages_getDialogs, new MessagesController$.ExternalSyntheticLambda423(this, i, i3, runnable));
}
tL_inputPeerEmpty = new TLRPC.TL_inputPeerEmpty();
}
tL_messages_getDialogs.offset_peer = tL_inputPeerEmpty;
getConnectionsManager().sendRequest(tL_messages_getDialogs, new MessagesController$.ExternalSyntheticLambda423(this, i, i3, runnable));
}
protected void loadFilterPeers(HashMap<Long, TLRPC.InputPeer> hashMap, HashMap<Long, TLRPC.InputPeer> hashMap2, HashMap<Long, TLRPC.InputPeer> hashMap3, TLRPC.messages_Dialogs messages_dialogs, TLRPC.messages_Dialogs messages_dialogs2, ArrayList<TLRPC$User> arrayList, ArrayList<TLRPC.Chat> arrayList2, ArrayList<DialogFilter> arrayList3, SparseArray<DialogFilter> sparseArray, ArrayList<Integer> arrayList4, HashMap<Integer, HashSet<Long>> hashMap4, HashSet<Integer> hashSet, Runnable runnable) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda416(this, hashMap2, messages_dialogs, messages_dialogs2, arrayList, arrayList2, arrayList3, sparseArray, arrayList4, hashMap4, hashSet, runnable, hashMap3, hashMap));
}
public void loadFullChat(long j, int i, boolean z) {
TLRPC.TL_channels_getFullChannel tL_messages_getFullChat;
boolean z2 = this.loadedFullChats.get(j, 0L) > 0;
if (this.loadingFullChats.contains(Long.valueOf(j))) {
return;
}
if (z || !z2) {
this.loadingFullChats.add(Long.valueOf(j));
long j2 = -j;
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (ChatObject.isChannel(chat)) {
tL_messages_getFullChat = new TLRPC.TL_channels_getFullChannel();
tL_messages_getFullChat.channel = getInputChannel(chat);
loadChannelAdmins(j, true ^ z2);
} else {
tL_messages_getFullChat = new TLRPC.TL_messages_getFullChat();
((TLRPC.TL_messages_getFullChat) tL_messages_getFullChat).chat_id = j;
if (this.dialogs_read_inbox_max.get(Long.valueOf(j2)) == null || this.dialogs_read_outbox_max.get(Long.valueOf(j2)) == null) {
reloadDialogsReadValue(null, j2);
}
}
int sendRequest = getConnectionsManager().sendRequest(tL_messages_getFullChat, new MessagesController$.ExternalSyntheticLambda240(this, j2, j, chat, i));
if (i != 0) {
getConnectionsManager().bindRequestToGuid(sendRequest, i);
}
}
}
public void loadFullUser(TLRPC$User tLRPC$User, int i, boolean z) {
loadFullUser(tLRPC$User, i, z, null);
}
public void loadFullUser(TLRPC$User tLRPC$User, int i, boolean z, Utilities.Callback<TLRPC.UserFull> callback) {
if (tLRPC$User != null) {
if (callback == null) {
if (this.loadingFullUsers.contains(Long.valueOf(tLRPC$User.id))) {
return;
}
if (!z && this.loadedFullUsers.get(tLRPC$User.id) > 0) {
return;
}
}
this.loadingFullUsers.add(Long.valueOf(tLRPC$User.id));
TLRPC.TL_users_getFullUser tL_users_getFullUser = new TLRPC.TL_users_getFullUser();
tL_users_getFullUser.id = getInputUser(tLRPC$User);
long j = tLRPC$User.id;
if (this.dialogs_read_inbox_max.get(Long.valueOf(j)) == null || this.dialogs_read_outbox_max.get(Long.valueOf(j)) == null) {
reloadDialogsReadValue(null, j);
}
getConnectionsManager().bindRequestToGuid(getConnectionsManager().sendRequest(tL_users_getFullUser, new MessagesController$.ExternalSyntheticLambda385(this, j, callback, tLRPC$User, i)), i);
}
}
public void loadGlobalNotificationsSettings() {
SharedPreferences.Editor editor;
if (this.loadingNotificationSettings == 0 && !getUserConfig().notificationsSettingsLoaded) {
SharedPreferences notificationsSettings = getNotificationsSettings(this.currentAccount);
if (notificationsSettings.contains("EnableGroup")) {
boolean z = notificationsSettings.getBoolean("EnableGroup", true);
editor = notificationsSettings.edit();
if (!z) {
editor.putInt("EnableGroup2", ConnectionsManager.DEFAULT_DATACENTER_ID);
editor.putInt("EnableChannel2", ConnectionsManager.DEFAULT_DATACENTER_ID);
}
editor.remove("EnableGroup").commit();
} else {
editor = null;
}
if (notificationsSettings.contains("EnableAll")) {
boolean z2 = notificationsSettings.getBoolean("EnableAll", true);
if (editor == null) {
editor = notificationsSettings.edit();
}
if (!z2) {
editor.putInt("EnableAll2", ConnectionsManager.DEFAULT_DATACENTER_ID);
}
editor.remove("EnableAll").commit();
}
if (editor != null) {
editor.commit();
}
this.loadingNotificationSettings = 4;
int i = 0;
while (i < 3) {
TL_account.getNotifySettings getnotifysettings = new TL_account.getNotifySettings();
getnotifysettings.peer = i == 0 ? new TLRPC.TL_inputNotifyChats() : i == 1 ? new TLRPC.TL_inputNotifyUsers() : new TLRPC.TL_inputNotifyBroadcasts();
getConnectionsManager().sendRequest(getnotifysettings, new MessagesController$.ExternalSyntheticLambda396(this, i));
i++;
}
getConnectionsManager().sendRequest(new TL_account.getReactionsNotifySettings(), new MessagesController$.ExternalSyntheticLambda397(this));
}
if (getUserConfig().notificationsSignUpSettingsLoaded) {
return;
}
loadSignUpNotificationsSettings();
}
public void loadHintDialogs() {
if (!this.hintDialogs.isEmpty() || TextUtils.isEmpty(this.installReferer)) {
return;
}
TLRPC.TL_help_getRecentMeUrls tL_help_getRecentMeUrls = new TLRPC.TL_help_getRecentMeUrls();
tL_help_getRecentMeUrls.referer = this.installReferer;
getConnectionsManager().sendRequest(tL_help_getRecentMeUrls, new MessagesController$.ExternalSyntheticLambda328(this));
}
public void loadMessages(long j, long j2, boolean z, int i, int i2, int i3, boolean z2, int i4, int i5, int i6, int i7, int i8, long j3, int i9, int i10, int i11, int i12, boolean z3, int i13, boolean z4) {
loadMessagesInternal(j, j2, z, i, i2, i3, z2, i4, i5, i6, i7, i8, j3, i9, i10, i11, i12, z3, i13, true, true, z4, null, 0L);
}
public void loadMessages(long j, long j2, boolean z, int i, int i2, int i3, boolean z2, int i4, int i5, int i6, int i7, int i8, long j3, int i9, int i10, boolean z3) {
loadMessages(j, j2, z, i, i2, i3, z2, i4, i5, i6, i7, i8, j3, i10, j3 != 0 ? i9 : 0, 0, 0, false, 0, z3);
}
public void loadPeerSettings(TLRPC$User tLRPC$User, TLRPC.Chat chat) {
loadPeerSettings(tLRPC$User, chat, false);
}
public void loadPeerSettings(TLRPC$User tLRPC$User, TLRPC.Chat chat, boolean z) {
if (tLRPC$User == null && chat == null) {
return;
}
long j = tLRPC$User != null ? tLRPC$User.id : -chat.id;
if (this.loadingPeerSettings.indexOfKey(j) >= 0) {
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("request spam button for " + j);
}
int i = this.notificationsPreferences.getInt("dialog_bar_vis3" + j, 0);
if (z || !(i == 1 || i == 3)) {
this.loadingPeerSettings.put(j, Boolean.TRUE);
TLRPC.TL_messages_getPeerSettings tL_messages_getPeerSettings = new TLRPC.TL_messages_getPeerSettings();
tL_messages_getPeerSettings.peer = getInputPeer(tLRPC$User != null ? tLRPC$User.id : -chat.id);
getConnectionsManager().sendRequest(tL_messages_getPeerSettings, new MessagesController$.ExternalSyntheticLambda186(this, j));
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("dialog bar already hidden for " + j);
}
}
public void loadPinnedDialogs(int i, long j, ArrayList<Long> arrayList) {
if (this.loadingPinnedDialogs.indexOfKey(i) >= 0 || getUserConfig().isPinnedDialogsLoaded(i)) {
return;
}
this.loadingPinnedDialogs.put(i, 1);
TLRPC.TL_messages_getPinnedDialogs tL_messages_getPinnedDialogs = new TLRPC.TL_messages_getPinnedDialogs();
tL_messages_getPinnedDialogs.folder_id = i;
getConnectionsManager().sendRequest(tL_messages_getPinnedDialogs, new MessagesController$.ExternalSyntheticLambda394(this, i));
}
public void loadRemoteFilters(boolean z) {
loadRemoteFilters(z, null);
}
public void loadRemoteFilters(boolean z, Utilities.Callback<Boolean> callback) {
if (callback != null) {
this.onLoadedRemoteFilters = callback;
}
if (this.loadingRemoteFilters || !getUserConfig().isClientActivated()) {
return;
}
if (z || !getUserConfig().filtersLoaded) {
if (z) {
getUserConfig().filtersLoaded = false;
getUserConfig().saveConfig(false);
}
getConnectionsManager().sendRequest(new TLRPC.TL_messages_getDialogFilters(), new MessagesController$.ExternalSyntheticLambda387(this));
}
}
public void loadSignUpNotificationsSettings() {
if (this.loadingNotificationSignUpSettings) {
return;
}
this.loadingNotificationSignUpSettings = true;
getConnectionsManager().sendRequest(new TL_account.getContactSignUpNotification(), new MessagesController$.ExternalSyntheticLambda178(this));
}
public void loadSuggestedFilters() {
if (this.loadingSuggestedFilters) {
return;
}
this.loadingSuggestedFilters = true;
getConnectionsManager().sendRequest(new TLRPC.TL_messages_getSuggestedDialogFilters(), new MessagesController$.ExternalSyntheticLambda55(this));
}
protected void loadUnknownChannel(TLRPC.Chat chat, long j) {
Exception e;
NativeByteBuffer nativeByteBuffer;
if (!(chat instanceof TLRPC.TL_channel) || this.gettingUnknownChannels.indexOfKey(chat.id) >= 0) {
return;
}
if (chat.access_hash == 0) {
if (j != 0) {
getMessagesStorage().removePendingTask(j);
return;
}
return;
}
TLRPC.TL_inputPeerChannel tL_inputPeerChannel = new TLRPC.TL_inputPeerChannel();
long j2 = chat.id;
((TLRPC.InputPeer) tL_inputPeerChannel).channel_id = j2;
((TLRPC.InputPeer) tL_inputPeerChannel).access_hash = chat.access_hash;
this.gettingUnknownChannels.put(j2, Boolean.TRUE);
TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = tL_inputPeerChannel;
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer);
if (j == 0) {
try {
nativeByteBuffer = new NativeByteBuffer(chat.getObjectSize() + 4);
try {
nativeByteBuffer.writeInt32(0);
chat.serializeToStream(nativeByteBuffer);
} catch (Exception e2) {
e = e2;
FileLog.e(e);
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda180(this, j, chat));
}
} catch (Exception e3) {
e = e3;
nativeByteBuffer = null;
}
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
}
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda180(this, j, chat));
}
protected void loadUnknownDialog(TLRPC.InputPeer inputPeer, long j) {
NativeByteBuffer nativeByteBuffer;
if (inputPeer == null) {
return;
}
long peerDialogId = DialogObject.getPeerDialogId(inputPeer);
if (this.gettingUnknownDialogs.indexOfKey(peerDialogId) >= 0) {
return;
}
this.gettingUnknownDialogs.put(peerDialogId, Boolean.TRUE);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("load unknown dialog " + peerDialogId);
}
TLRPC.TL_messages_getPeerDialogs tL_messages_getPeerDialogs = new TLRPC.TL_messages_getPeerDialogs();
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer;
tL_messages_getPeerDialogs.peers.add(tL_inputDialogPeer);
if (j == 0) {
try {
nativeByteBuffer = new NativeByteBuffer(inputPeer.getObjectSize() + 4);
} catch (Exception e) {
e = e;
nativeByteBuffer = null;
}
try {
nativeByteBuffer.writeInt32(15);
inputPeer.serializeToStream(nativeByteBuffer);
} catch (Exception e2) {
e = e2;
FileLog.e(e);
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda255(this, j, peerDialogId));
}
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
}
getConnectionsManager().sendRequest(tL_messages_getPeerDialogs, new MessagesController$.ExternalSyntheticLambda255(this, j, peerDialogId));
}
public void loadUnreadDialogs() {
if (this.loadingUnreadDialogs || getUserConfig().unreadDialogsLoaded) {
return;
}
this.loadingUnreadDialogs = true;
getConnectionsManager().sendRequest(new TLRPC.TL_messages_getDialogUnreadMarks(), new MessagesController$.ExternalSyntheticLambda234(this));
}
public void loadUserInfo(TLRPC$User tLRPC$User, boolean z, int i) {
loadUserInfo(tLRPC$User, z, i, 0);
}
public void loadUserInfo(TLRPC$User tLRPC$User, boolean z, int i, int i2) {
getMessagesStorage().loadUserInfo(tLRPC$User, z, i, i2);
}
public void lockFiltersInternal() {
boolean z;
if (getUserConfig().isPremium() || this.dialogFilters.size() - 1 <= this.dialogFiltersLimitDefault) {
z = false;
} else {
int size = (this.dialogFilters.size() - 1) - this.dialogFiltersLimitDefault;
ArrayList arrayList = new ArrayList(this.dialogFilters);
Collections.reverse(arrayList);
z = false;
for (int i = 0; i < arrayList.size(); i++) {
boolean z2 = ((DialogFilter) arrayList.get(i)).locked;
if (i < size) {
if (!z2) {
z = true;
}
((DialogFilter) arrayList.get(i)).locked = true;
} else {
if (z2) {
z = true;
}
((DialogFilter) arrayList.get(i)).locked = false;
}
}
}
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
}
}
public void logDeviceStats() {
if (!this.collectDeviceStats || this.loggedDeviceStats) {
return;
}
ArrayList<File> rootDirs = AndroidUtilities.getRootDirs();
if (!rootDirs.isEmpty()) {
int i = 0;
String absolutePath = rootDirs.get(0).getAbsolutePath();
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
int size = rootDirs.size();
while (true) {
if (i >= size) {
break;
}
String absolutePath2 = rootDirs.get(i).getAbsolutePath();
if (absolutePath2.startsWith(SharedConfig.storageCacheDir)) {
absolutePath = absolutePath2;
break;
}
i++;
}
}
boolean contains = absolutePath.contains("/storage/emulated/");
TLRPC.TL_help_saveAppLog tL_help_saveAppLog = new TLRPC.TL_help_saveAppLog();
TLRPC.TL_inputAppEvent tL_inputAppEvent = new TLRPC.TL_inputAppEvent();
tL_inputAppEvent.time = getConnectionsManager().getCurrentTime();
tL_inputAppEvent.type = "android_sdcard_exists";
TLRPC.TL_jsonBool tL_jsonBool = new TLRPC.TL_jsonBool();
tL_jsonBool.value = contains;
tL_inputAppEvent.data = tL_jsonBool;
tL_inputAppEvent.peer = contains ? 1L : 0L;
tL_help_saveAppLog.events.add(tL_inputAppEvent);
getConnectionsManager().sendRequest(tL_help_saveAppLog, new MessagesController$.ExternalSyntheticLambda58());
}
this.loggedDeviceStats = true;
}
public void markAllTopicsAsRead(long j) {
getMessagesStorage().loadTopics(j, new MessagesController$.ExternalSyntheticLambda191(this, j));
}
public void markDialogAsRead(long r17, int r19, int r20, int r21, boolean r22, long r23, int r25, boolean r26, int r27) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.markDialogAsRead(long, int, int, int, boolean, long, int, boolean, int):void");
}
public void markDialogAsReadNow(long j, long j2) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda386(this, j2, j));
}
public void markDialogAsUnread(long j, TLRPC.InputPeer inputPeer, long j2) {
NativeByteBuffer nativeByteBuffer;
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
NativeByteBuffer nativeByteBuffer2 = null;
if (dialog != null) {
dialog.unread_mark = true;
if (dialog.unread_count == 0 && !isDialogMuted(j, 0L)) {
this.unreadUnmutedDialogs++;
}
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_READ_DIALOG_MESSAGE)});
getMessagesStorage().setDialogUnread(j, true);
int i = 0;
while (true) {
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
if (i < dialogFilterArr.length) {
DialogFilter dialogFilter = dialogFilterArr[i];
if (dialogFilter != null && (dialogFilter.flags & DIALOG_FILTER_FLAG_EXCLUDE_READ) != 0) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
break;
}
i++;
} else {
break;
}
}
}
if (DialogObject.isEncryptedDialog(j)) {
return;
}
TLRPC.TL_messages_markDialogUnread tL_messages_markDialogUnread = new TLRPC.TL_messages_markDialogUnread();
tL_messages_markDialogUnread.unread = true;
if (inputPeer == null) {
inputPeer = getInputPeer(j);
}
if (inputPeer instanceof TLRPC.TL_inputPeerEmpty) {
return;
}
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer;
tL_messages_markDialogUnread.peer = tL_inputDialogPeer;
if (j2 == 0) {
try {
nativeByteBuffer = new NativeByteBuffer(inputPeer.getObjectSize() + 12);
} catch (Exception e) {
e = e;
}
try {
nativeByteBuffer.writeInt32(9);
nativeByteBuffer.writeInt64(j);
inputPeer.serializeToStream(nativeByteBuffer);
} catch (Exception e2) {
e = e2;
nativeByteBuffer2 = nativeByteBuffer;
FileLog.e(e);
nativeByteBuffer = nativeByteBuffer2;
j2 = getMessagesStorage().createPendingTask(nativeByteBuffer);
getConnectionsManager().sendRequest(tL_messages_markDialogUnread, new MessagesController$.ExternalSyntheticLambda354(this, j2));
}
j2 = getMessagesStorage().createPendingTask(nativeByteBuffer);
}
getConnectionsManager().sendRequest(tL_messages_markDialogUnread, new MessagesController$.ExternalSyntheticLambda354(this, j2));
}
public void markDialogMessageAsDeleted(long j, ArrayList<Integer> arrayList) {
ArrayList arrayList2 = (ArrayList) this.dialogMessage.get(j);
if (arrayList2 != null) {
for (int i = 0; i < arrayList2.size(); i++) {
MessageObject messageObject = (MessageObject) arrayList2.get(i);
if (messageObject != null) {
int i2 = 0;
while (true) {
if (i2 < arrayList.size()) {
if (messageObject.getId() == arrayList.get(i2).intValue()) {
messageObject.deleted = true;
break;
}
i2++;
}
}
}
}
}
}
public void markMentionMessageAsRead(int i, long j, long j2) {
getMessagesStorage().markMentionMessageAsRead(-j, i, j2);
if (j == 0) {
TLRPC.TL_messages_readMessageContents tL_messages_readMessageContents = new TLRPC.TL_messages_readMessageContents();
tL_messages_readMessageContents.id.add(Integer.valueOf(i));
getConnectionsManager().sendRequest(tL_messages_readMessageContents, new MessagesController$.ExternalSyntheticLambda204(this));
return;
}
TLRPC.TL_channels_readMessageContents tL_channels_readMessageContents = new TLRPC.TL_channels_readMessageContents();
TLRPC.InputChannel inputChannel = getInputChannel(j);
tL_channels_readMessageContents.channel = inputChannel;
if (inputChannel == null) {
return;
}
tL_channels_readMessageContents.id.add(Integer.valueOf(i));
getConnectionsManager().sendRequest(tL_channels_readMessageContents, new MessagesController$.ExternalSyntheticLambda203());
}
public void markMentionsAsRead(long j, long j2) {
if (DialogObject.isEncryptedDialog(j) || j == getUserConfig().getClientUserId()) {
return;
}
getMessagesStorage().resetMentionsCount(j, j2, 0);
TLRPC.TL_messages_readMentions tL_messages_readMentions = new TLRPC.TL_messages_readMentions();
tL_messages_readMentions.peer = getInputPeer(j);
if (j2 != 0) {
tL_messages_readMentions.top_msg_id = (int) j2;
tL_messages_readMentions.flags |= 1;
}
getConnectionsManager().sendRequest(tL_messages_readMentions, null);
}
public void markMessageAsRead(long j, long j2, int i) {
TLRPC.EncryptedChat encryptedChat;
if (j2 == 0 || j == 0) {
return;
}
if ((i > 0 || i == Integer.MIN_VALUE) && DialogObject.isEncryptedDialog(j) && (encryptedChat = getEncryptedChat(Integer.valueOf(DialogObject.getEncryptedChatId(j)))) != null) {
ArrayList arrayList = new ArrayList();
arrayList.add(Long.valueOf(j2));
getSecretChatHelper().sendMessagesReadMessage(encryptedChat, arrayList, (TLRPC.Message) null);
if (i > 0) {
int currentTime = getConnectionsManager().getCurrentTime();
getMessagesStorage().createTaskForSecretChat(encryptedChat.id, currentTime, currentTime, 0, arrayList);
}
}
}
public void markMessageAsRead2(long j, int i, TLRPC.InputChannel inputChannel, int i2, long j2) {
markMessageAsRead2(j, i, inputChannel, i2, j2, true);
}
public void markMessageAsRead2(long r15, int r17, org.telegram.tgnet.TLRPC.InputChannel r18, int r19, long r20, boolean r22) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.markMessageAsRead2(long, int, org.telegram.tgnet.TLRPC$InputChannel, int, long, boolean):void");
}
public void markMessageContentAsRead(MessageObject messageObject) {
TLRPC.TL_channels_readMessageContents tL_messages_readMessageContents;
ConnectionsManager connectionsManager;
MessagesController$.ExternalSyntheticLambda355 externalSyntheticLambda356;
if (messageObject.scheduled) {
return;
}
ArrayList arrayList = new ArrayList();
if (messageObject.messageOwner.mentioned) {
getMessagesStorage().markMentionMessageAsRead(-messageObject.messageOwner.peer_id.channel_id, messageObject.getId(), messageObject.getDialogId());
}
arrayList.add(Integer.valueOf(messageObject.getId()));
long dialogId = messageObject.getDialogId();
getMessagesStorage().markMessagesContentAsRead(dialogId, arrayList, 0, 0);
getNotificationCenter().postNotificationName(NotificationCenter.messagesReadContent, new Object[]{Long.valueOf(dialogId), arrayList});
if (messageObject.getId() < 0) {
markMessageAsRead(messageObject.getDialogId(), messageObject.messageOwner.random_id, Integer.MIN_VALUE);
return;
}
if (messageObject.messageOwner.peer_id.channel_id != 0) {
tL_messages_readMessageContents = new TLRPC.TL_channels_readMessageContents();
TLRPC.InputChannel inputChannel = getInputChannel(messageObject.messageOwner.peer_id.channel_id);
tL_messages_readMessageContents.channel = inputChannel;
if (inputChannel == null) {
return;
}
tL_messages_readMessageContents.id.add(Integer.valueOf(messageObject.getId()));
connectionsManager = getConnectionsManager();
externalSyntheticLambda356 = new MessagesController$.ExternalSyntheticLambda355();
} else {
tL_messages_readMessageContents = new TLRPC.TL_messages_readMessageContents();
((TLRPC.TL_messages_readMessageContents) tL_messages_readMessageContents).id.add(Integer.valueOf(messageObject.getId()));
connectionsManager = getConnectionsManager();
externalSyntheticLambda356 = new MessagesController$.ExternalSyntheticLambda356(this);
}
connectionsManager.sendRequest(tL_messages_readMessageContents, externalSyntheticLambda356);
}
public void markReactionsAsRead(long j, long j2) {
int i;
if (j2 == 0) {
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog != null) {
dialog.unread_reactions_count = 0;
}
if (isForum(j) || isMonoForumWithManageRights(j)) {
this.topicsController.markAllReactionsAsRead(-j);
}
} else {
this.topicsController.markAllReactionsAsRead(-j, j2);
}
getMessagesStorage().updateUnreadReactionsCount(j, j2, 0);
TLRPC.TL_messages_readReactions tL_messages_readReactions = new TLRPC.TL_messages_readReactions();
tL_messages_readReactions.peer = getInputPeer(j);
if (j2 != 0) {
if (isMonoForum(j)) {
tL_messages_readReactions.saved_peer_id = getInputPeer(j2);
i = tL_messages_readReactions.flags | 2;
} else {
tL_messages_readReactions.top_msg_id = (int) j2;
i = tL_messages_readReactions.flags | 1;
}
tL_messages_readReactions.flags = i;
}
getConnectionsManager().sendRequest(tL_messages_readReactions, new MessagesController$.ExternalSyntheticLambda388());
NotificationCenter.getInstance(this.currentAccount).postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_REACTIONS_READ)});
}
public void markSponsoredAsRead(long j, MessageObject messageObject) {
}
public boolean matchesAdminRights(TLRPC.Chat chat, TLRPC$User tLRPC$User, TLRPC.TL_chatAdminRights tL_chatAdminRights) {
if (tL_chatAdminRights == null) {
return true;
}
TLRPC.TL_chatAdminRights chatAdminRightsCached = getChatAdminRightsCached(chat, tLRPC$User);
if ((!tL_chatAdminRights.change_info || (chatAdminRightsCached != null && chatAdminRightsCached.change_info)) && ((!tL_chatAdminRights.post_messages || (chatAdminRightsCached != null && chatAdminRightsCached.post_messages)) && ((!tL_chatAdminRights.edit_messages || (chatAdminRightsCached != null && chatAdminRightsCached.edit_messages)) && ((!tL_chatAdminRights.delete_messages || (chatAdminRightsCached != null && chatAdminRightsCached.delete_messages)) && ((!tL_chatAdminRights.ban_users || (chatAdminRightsCached != null && chatAdminRightsCached.ban_users)) && ((!tL_chatAdminRights.invite_users || (chatAdminRightsCached != null && chatAdminRightsCached.invite_users)) && ((!tL_chatAdminRights.pin_messages || (chatAdminRightsCached != null && chatAdminRightsCached.pin_messages)) && ((!tL_chatAdminRights.add_admins || (chatAdminRightsCached != null && chatAdminRightsCached.add_admins)) && ((!tL_chatAdminRights.anonymous || (chatAdminRightsCached != null && chatAdminRightsCached.anonymous)) && ((!tL_chatAdminRights.manage_call || (chatAdminRightsCached != null && chatAdminRightsCached.manage_call)) && (!tL_chatAdminRights.other || (chatAdminRightsCached != null && chatAdminRightsCached.other)))))))))))) {
if (!tL_chatAdminRights.manage_topics) {
return true;
}
if (chatAdminRightsCached != null && chatAdminRightsCached.manage_topics) {
return true;
}
}
return false;
}
public void onFilterUpdate(DialogFilter dialogFilter) {
for (int i = 0; i < 2; i++) {
if (this.selectedDialogFilter[i] == dialogFilter) {
sortDialogs(null);
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
return;
}
}
}
protected void onFolderEmpty(int i) {
if (getUserConfig().getDialogLoadOffsets(i)[0] != 2147483647L) {
loadDialogs(i, 0, 10, false, new MessagesController$.ExternalSyntheticLambda106(this, i));
} else if (i != 1) {
removeFolder(i);
} else {
this.hasArchivedChats = false;
checkArchiveFolder();
}
}
public void openApp(TLRPC$User tLRPC$User, int i) {
openApp(null, tLRPC$User, null, i, null);
}
public void openApp(BaseFragment baseFragment, TLRPC$User tLRPC$User, String str, int i, Browser.Progress progress) {
openApp(baseFragment, tLRPC$User, str, i, progress, false, false);
}
public void openApp(BaseFragment baseFragment, TLRPC$User tLRPC$User, String str, int i, Browser.Progress progress, boolean z, boolean z2) {
if (tLRPC$User == null) {
return;
}
boolean[] zArr = {false};
if (progress != null) {
progress.onCancel(new MessagesController$.ExternalSyntheticLambda335(zArr));
progress.init();
}
TL_bots.BotInfo[] botInfoArr = {r0};
MessagesController$.ExternalSyntheticLambda336 externalSyntheticLambda336 = new MessagesController$.ExternalSyntheticLambda336(this, baseFragment, progress, zArr, tLRPC$User, str, z, z2, botInfoArr);
MediaDataController mediaDataController = getMediaDataController();
long j = tLRPC$User.id;
TL_bots.BotInfo botInfoCached = mediaDataController.getBotInfoCached(j, j);
if (tLRPC$User.bot_has_main_app || botInfoCached != null) {
externalSyntheticLambda336.run();
return;
}
MediaDataController mediaDataController2 = getMediaDataController();
long j2 = tLRPC$User.id;
mediaDataController2.loadBotInfo(j2, j2, false, i, new MessagesController$.ExternalSyntheticLambda337(this, zArr, botInfoArr, tLRPC$User, i, externalSyntheticLambda336));
}
public void openByUserName(String str, BaseFragment baseFragment, int i) {
openByUserName(str, baseFragment, i, null);
}
public void openByUserName(java.lang.String r16, org.telegram.ui.ActionBar.BaseFragment r17, int r18, org.telegram.messenger.browser.Browser.Progress r19) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.openByUserName(java.lang.String, org.telegram.ui.ActionBar.BaseFragment, int, org.telegram.messenger.browser.Browser$Progress):void");
}
public void openChatOrProfileWith(org.telegram.tgnet.TLRPC$User r6, org.telegram.tgnet.TLRPC.Chat r7, org.telegram.ui.ActionBar.BaseFragment r8, int r9, boolean r10) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.openChatOrProfileWith(org.telegram.tgnet.TLRPC$User, org.telegram.tgnet.TLRPC$Chat, org.telegram.ui.ActionBar.BaseFragment, int, boolean):void");
}
public void performLogout(int i) {
if (i == 1) {
unregistedPush();
getConnectionsManager().sendRequest(new TLRPC.TL_auth_logOut(), new MessagesController$.ExternalSyntheticLambda418(this));
} else {
getConnectionsManager().cleanup(i == 2);
}
getUserConfig().clearConfig();
SharedPrefsHelper.cleanupAccount(this.currentAccount);
ArrayList observers = getNotificationCenter().getObservers(NotificationCenter.appDidLogout);
if (observers != null) {
int size = observers.size();
for (int i2 = 0; i2 < size; i2++) {
if (observers.get(i2) instanceof LaunchActivity) {
break;
}
}
}
if (UserConfig.selectedAccount == this.currentAccount) {
int i3 = 0;
while (true) {
if (i3 >= 4) {
i3 = -1;
break;
} else if (UserConfig.getInstance(i3).isClientActivated()) {
break;
} else {
i3++;
}
}
if (i3 != -1) {
UserConfig.selectedAccount = i3;
UserConfig.getInstance(0).saveConfig(false);
LaunchActivity.clearFragments();
}
}
getNotificationCenter().postNotificationName(NotificationCenter.appDidLogout, new Object[0]);
getMessagesStorage().cleanup(false);
cleanup();
getContactsController().deleteUnknownAppAccounts();
}
public boolean pinDialog(long j, boolean z, TLRPC.InputPeer inputPeer, long j2) {
NativeByteBuffer nativeByteBuffer;
long createPendingTask;
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog == null || dialog.pinned == z) {
return dialog != null;
}
int i = dialog.folder_id;
ArrayList<TLRPC.Dialog> dialogs = getDialogs(i);
dialog.pinned = z;
if (z) {
int i2 = 0;
for (int i3 = 0; i3 < dialogs.size(); i3++) {
TLRPC.Dialog dialog2 = dialogs.get(i3);
if (!(dialog2 instanceof TLRPC.TL_dialogFolder)) {
if (!dialog2.pinned) {
if (dialog2.id != this.promoDialogId) {
break;
}
} else {
i2 = Math.max(dialog2.pinnedNum, i2);
}
}
}
dialog.pinnedNum = i2 + 1;
} else {
dialog.pinnedNum = 0;
}
NativeByteBuffer nativeByteBuffer2 = null;
sortDialogs(null);
if (!z && !dialogs.isEmpty() && dialogs.get(dialogs.size() - 1) == dialog && !this.dialogsEndReached.get(i)) {
dialogs.remove(dialogs.size() - 1);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
if (!DialogObject.isEncryptedDialog(j) && j2 != -1) {
TLRPC.TL_messages_toggleDialogPin tL_messages_toggleDialogPin = new TLRPC.TL_messages_toggleDialogPin();
tL_messages_toggleDialogPin.pinned = z;
TLRPC.InputPeer inputPeer2 = inputPeer == null ? getInputPeer(j) : inputPeer;
if (inputPeer2 instanceof TLRPC.TL_inputPeerEmpty) {
return false;
}
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer2;
tL_messages_toggleDialogPin.peer = tL_inputDialogPeer;
if (j2 == 0) {
try {
nativeByteBuffer = new NativeByteBuffer(inputPeer2.getObjectSize() + 16);
} catch (Exception e) {
e = e;
}
try {
nativeByteBuffer.writeInt32(4);
nativeByteBuffer.writeInt64(j);
nativeByteBuffer.writeBool(z);
inputPeer2.serializeToStream(nativeByteBuffer);
} catch (Exception e2) {
e = e2;
nativeByteBuffer2 = nativeByteBuffer;
FileLog.e(e);
nativeByteBuffer = nativeByteBuffer2;
createPendingTask = getMessagesStorage().createPendingTask(nativeByteBuffer);
getConnectionsManager().sendRequest(tL_messages_toggleDialogPin, new MessagesController$.ExternalSyntheticLambda90(this, createPendingTask));
getMessagesStorage().setDialogPinned(j, dialog.pinnedNum);
return true;
}
createPendingTask = getMessagesStorage().createPendingTask(nativeByteBuffer);
} else {
createPendingTask = j2;
}
getConnectionsManager().sendRequest(tL_messages_toggleDialogPin, new MessagesController$.ExternalSyntheticLambda90(this, createPendingTask));
}
getMessagesStorage().setDialogPinned(j, dialog.pinnedNum);
return true;
}
public void pinMessage(TLRPC.Chat chat, TLRPC$User tLRPC$User, int i, boolean z, boolean z2, boolean z3) {
if (chat == null && tLRPC$User == null) {
return;
}
TLRPC.TL_messages_updatePinnedMessage tL_messages_updatePinnedMessage = new TLRPC.TL_messages_updatePinnedMessage();
tL_messages_updatePinnedMessage.peer = getInputPeer(chat != null ? -chat.id : tLRPC$User.id);
tL_messages_updatePinnedMessage.id = i;
tL_messages_updatePinnedMessage.unpin = z;
tL_messages_updatePinnedMessage.silent = !z3;
tL_messages_updatePinnedMessage.pm_oneside = z2;
getConnectionsManager().sendRequest(tL_messages_updatePinnedMessage, new MessagesController$.ExternalSyntheticLambda238(this, i, chat, tLRPC$User, z));
}
public boolean premiumFeaturesBlocked() {
return this.premiumLocked && !getUserConfig().isPremium();
}
public boolean premiumPurchaseBlocked() {
return this.premiumLocked;
}
public void pressTranscribeButton() {
int i = this.transcribeButtonPressed;
if (i < 2) {
this.transcribeButtonPressed = i + 1;
SharedPreferences sharedPreferences = this.mainPreferences;
if (sharedPreferences != null) {
sharedPreferences.edit().putInt("transcribeButtonPressed", this.transcribeButtonPressed).apply();
}
}
}
public void processChatInfo(long j, TLRPC.ChatFull chatFull, ArrayList<TLRPC$User> arrayList, boolean z, boolean z2, boolean z3, ArrayList<Integer> arrayList2, HashMap<Integer, MessageObject> hashMap, int i, boolean z4) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda94(this, z, j, z3, z2, chatFull, arrayList, arrayList2, hashMap, i, z4));
}
public boolean processDeletedReactionTags(TLRPC.Message message) {
TLRPC.TL_messageReactions tL_messageReactions;
if (message == null || DialogObject.getPeerDialogId(message.peer_id) != getUserConfig().getClientUserId() || (tL_messageReactions = message.reactions) == null || !((TLRPC.MessageReactions) tL_messageReactions).reactions_as_tags || ((TLRPC.MessageReactions) tL_messageReactions).results == null) {
return false;
}
long savedDialogId = MessageObject.getSavedDialogId(getUserConfig().getClientUserId(), message);
boolean z = false;
for (int i = 0; i < ((TLRPC.MessageReactions) message.reactions).results.size(); i++) {
if (updateSavedReactionTags(savedDialogId, ReactionsLayoutInBubble.VisibleReaction.fromTL(((TLRPC.ReactionCount) ((TLRPC.MessageReactions) message.reactions).results.get(i)).reaction), false, false)) {
z = true;
}
}
return z;
}
public void processDialogsUpdate(TLRPC.messages_Dialogs messages_dialogs, ArrayList<TLRPC.EncryptedChat> arrayList, boolean z) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda237(this, messages_dialogs, z));
}
public void processDialogsUpdateRead(LongSparseIntArray longSparseIntArray, LongSparseIntArray longSparseIntArray2) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda445(this, longSparseIntArray, longSparseIntArray2));
}
public void processLoadedAdminsResponse(long j, TLRPC.TL_channels_channelParticipants tL_channels_channelParticipants) {
LongSparseArray longSparseArray = new LongSparseArray(((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants.size());
for (int i = 0; i < ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants.size(); i++) {
TLRPC.ChannelParticipant channelParticipant = (TLRPC.ChannelParticipant) ((TLRPC.channels_ChannelParticipants) tL_channels_channelParticipants).participants.get(i);
longSparseArray.put(MessageObject.getPeerId(channelParticipant.peer), channelParticipant);
}
processLoadedChannelAdmins(longSparseArray, j, false);
}
public void processLoadedChannelAdmins(LongSparseArray longSparseArray, long j, boolean z) {
if (!z) {
getMessagesStorage().putChannelAdmins(j, longSparseArray);
}
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda70(this, j, longSparseArray, z));
}
public void processLoadedDeleteTask(int i, LongSparseArray longSparseArray, LongSparseArray longSparseArray2) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda114(this, longSparseArray, longSparseArray2, i));
}
protected void processLoadedDialogFilters(ArrayList<DialogFilter> arrayList, TLRPC.messages_Dialogs messages_dialogs, TLRPC.messages_Dialogs messages_dialogs2, ArrayList<TLRPC$User> arrayList2, ArrayList<TLRPC.Chat> arrayList3, ArrayList<TLRPC.EncryptedChat> arrayList4, int i, Runnable runnable) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda215(this, messages_dialogs, arrayList4, messages_dialogs2, i, arrayList, arrayList2, arrayList3, runnable));
}
public void processLoadedDialogs(TLRPC.messages_Dialogs messages_dialogs, ArrayList<TLRPC.EncryptedChat> arrayList, ArrayList<TLRPC.UserFull> arrayList2, int i, int i2, int i3, int i4, boolean z, boolean z2, boolean z3) {
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda384(this, i, i4, messages_dialogs, arrayList2, z, i3, arrayList, i2, z3, z2));
}
public void processLoadedMessages(org.telegram.tgnet.TLRPC.messages_Messages r36, int r37, long r38, long r40, int r42, int r43, int r44, boolean r45, int r46, int r47, int r48, int r49, int r50, int r51, boolean r52, int r53, long r54, int r56, boolean r57, int r58, boolean r59, boolean r60, org.telegram.messenger.Timer r61) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.processLoadedMessages(org.telegram.tgnet.TLRPC$messages_Messages, int, long, long, int, int, int, boolean, int, int, int, int, int, int, boolean, int, long, int, boolean, int, boolean, boolean, org.telegram.messenger.Timer):void");
}
protected void processNewChannelDifferenceParams(int i, int i2, long j) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("processNewChannelDifferenceParams pts = " + i + " pts_count = " + i2 + " channeldId = " + j);
}
int i3 = this.channelsPts.get(j);
if (i3 == 0) {
i3 = getMessagesStorage().getChannelPtsSync(j);
if (i3 == 0) {
i3 = 1;
}
this.channelsPts.put(j, i3);
}
if (i3 + i2 == i) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY CHANNEL PTS");
}
this.channelsPts.put(j, i);
getMessagesStorage().saveChannelPts(j, i);
return;
}
if (i3 != i) {
long j2 = this.updatesStartWaitTimeChannels.get(j);
if (!((Boolean) this.gettingDifferenceChannels.get(j, Boolean.FALSE)).booleanValue() && j2 != 0 && Math.abs(System.currentTimeMillis() - j2) > 1500) {
getChannelDifference(j);
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD CHANNEL UPDATE TO QUEUE pts = " + i + " pts_count = " + i2);
}
if (j2 == 0) {
this.updatesStartWaitTimeChannels.put(j, System.currentTimeMillis());
}
UserActionUpdatesPts userActionUpdatesPts = new UserActionUpdatesPts((1) null);
((TLRPC.Updates) userActionUpdatesPts).pts = i;
((TLRPC.Updates) userActionUpdatesPts).pts_count = i2;
((TLRPC.Updates) userActionUpdatesPts).chat_id = j;
ArrayList arrayList = (ArrayList) this.updatesQueueChannels.get(j);
if (arrayList == null) {
arrayList = new ArrayList();
this.updatesQueueChannels.put(j, arrayList);
}
arrayList.add(userActionUpdatesPts);
}
}
public void processNewDifferenceParams(int i, int i2, int i3, int i4) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("processNewDifferenceParams seq = " + i + " pts = " + i2 + " date = " + i3 + " pts_count = " + i4);
}
if (i2 != -1) {
if (getMessagesStorage().getLastPtsValue() + i4 == i2) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY PTS");
}
getMessagesStorage().setLastPtsValue(i2);
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
} else if (getMessagesStorage().getLastPtsValue() != i2) {
if (this.gettingDifference || this.updatesStartWaitTimePts == 0 || Math.abs(System.currentTimeMillis() - this.updatesStartWaitTimePts) <= 1500) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD UPDATE TO QUEUE pts = " + i2 + " pts_count = " + i4);
}
if (this.updatesStartWaitTimePts == 0) {
this.updatesStartWaitTimePts = System.currentTimeMillis();
}
TLRPC.Updates userActionUpdatesPts = new UserActionUpdatesPts((1) null);
userActionUpdatesPts.pts = i2;
userActionUpdatesPts.pts_count = i4;
this.updatesQueuePts.add(userActionUpdatesPts);
} else {
getDifference();
}
}
}
if (i != -1) {
if (getMessagesStorage().getLastSeqValue() + 1 == i) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("APPLY SEQ");
}
getMessagesStorage().setLastSeqValue(i);
if (i3 != -1) {
getMessagesStorage().setLastDateValue(i3);
}
getMessagesStorage().saveDiffParams(getMessagesStorage().getLastSeqValue(), getMessagesStorage().getLastPtsValue(), getMessagesStorage().getLastDateValue(), getMessagesStorage().getLastQtsValue());
return;
}
if (getMessagesStorage().getLastSeqValue() != i) {
if (!this.gettingDifference && this.updatesStartWaitTimeSeq != 0 && Math.abs(System.currentTimeMillis() - this.updatesStartWaitTimeSeq) > 1500) {
getDifference();
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("ADD UPDATE TO QUEUE seq = " + i);
}
if (this.updatesStartWaitTimeSeq == 0) {
this.updatesStartWaitTimeSeq = System.currentTimeMillis();
}
TLRPC.Updates userActionUpdatesSeq = new UserActionUpdatesSeq((1) null);
userActionUpdatesSeq.seq = i;
this.updatesQueueSeq.add(userActionUpdatesSeq);
}
}
}
public boolean processUpdateArray(java.util.ArrayList<org.telegram.tgnet.TLRPC$Update> r82, java.util.ArrayList<org.telegram.tgnet.TLRPC$User> r83, java.util.ArrayList<org.telegram.tgnet.TLRPC.Chat> r84, boolean r85, int r86) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.processUpdateArray(java.util.ArrayList, java.util.ArrayList, java.util.ArrayList, boolean, int):boolean");
}
public void processUpdates(org.telegram.tgnet.TLRPC.Updates r30, boolean r31) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.processUpdates(org.telegram.tgnet.TLRPC$Updates, boolean):void");
}
public void processUserInfo(TLRPC$User tLRPC$User, TLRPC.UserFull userFull, boolean z, boolean z2, int i, ArrayList<Integer> arrayList, HashMap<Integer, MessageObject> hashMap, int i2, boolean z3) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda131(this, z, tLRPC$User, i, z2, userFull, arrayList, hashMap, i2, z3));
}
public void putAllNeededDraftDialogs() {
LongSparseArray drafts = getMediaDataController().getDrafts();
int size = drafts.size();
for (int i = 0; i < size; i++) {
TLRPC.DraftMessage draftMessage = (TLRPC.DraftMessage) ((LongSparseArray) drafts.valueAt(i)).get(0L);
if (draftMessage != null) {
putDraftDialogIfNeed(drafts.keyAt(i), draftMessage);
}
}
}
public void putChat(org.telegram.tgnet.TLRPC.Chat r10, boolean r11) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.putChat(org.telegram.tgnet.TLRPC$Chat, boolean):void");
}
public void putChatFull(TLRPC.ChatFull chatFull) {
this.fullChats.put(chatFull.id, chatFull);
getTranslateController().updateDialogFull(-chatFull.id);
}
public void putChats(ArrayList<TLRPC.Chat> arrayList, boolean z) {
if (arrayList == null || arrayList.isEmpty()) {
return;
}
int size = arrayList.size();
for (int i = 0; i < size; i++) {
putChat(arrayList.get(i), z);
}
}
public void putDialogsEndReachedAfterRegistration() {
this.dialogsEndReached.put(0, true);
this.serverDialogsEndReached.put(0, true);
}
public void putDraftDialogIfNeed(long j, TLRPC.DraftMessage draftMessage) {
if (this.dialogs_dict.indexOfKey(j) < 0) {
if (!ChatObject.isMonoForum(this.currentAccount, j) || ChatObject.canManageMonoForum(this.currentAccount, j)) {
MediaDataController mediaDataController = getMediaDataController();
int size = this.allDialogs.size();
if (size > 0) {
TLRPC.Dialog dialog = this.allDialogs.get(size - 1);
if (draftMessage.date < DialogObject.getLastMessageOrDraftDate(dialog, mediaDataController.getDraft(dialog.id, 0L))) {
return;
}
}
TLRPC.Dialog tL_dialog = new TLRPC.TL_dialog();
tL_dialog.id = j;
tL_dialog.draft = draftMessage;
tL_dialog.folder_id = mediaDataController.getDraftFolderId(j);
tL_dialog.flags = (j >= 0 || !ChatObject.isChannel(getChat(Long.valueOf(-j)))) ? 0 : 1;
this.dialogs_dict.put(j, tL_dialog);
this.allDialogs.add(tL_dialog);
sortDialogs(null);
}
}
}
public void putEncryptedChat(TLRPC.EncryptedChat encryptedChat, boolean z) {
if (encryptedChat == null) {
return;
}
if (z) {
this.encryptedChats.putIfAbsent(Integer.valueOf(encryptedChat.id), encryptedChat);
} else {
this.encryptedChats.put(Integer.valueOf(encryptedChat.id), encryptedChat);
}
}
public void putEncryptedChats(ArrayList<TLRPC.EncryptedChat> arrayList, boolean z) {
if (arrayList == null || arrayList.isEmpty()) {
return;
}
int size = arrayList.size();
for (int i = 0; i < size; i++) {
putEncryptedChat(arrayList.get(i), z);
}
}
public void putGroupCall(long j, ChatObject.Call call) {
this.groupCalls.put(call.call.id, call);
this.groupCallsByChatId.put(j, call);
TLRPC.ChatFull chatFull = getChatFull(j);
if (chatFull != null) {
chatFull.call = call.getInputGroupCall();
}
getNotificationCenter().postNotificationName(NotificationCenter.groupCallUpdated, new Object[]{Long.valueOf(j), Long.valueOf(call.call.id), Boolean.FALSE});
loadFullChat(j, 0, true);
}
public void putMonoForumLinkedChat(long j, long j2) {
this.monoForumLinkedChannels.put(Long.valueOf(j), Long.valueOf(j2));
this.monoForumLinkedChannels.put(Long.valueOf(j2), Long.valueOf(j));
}
public boolean putUser(TLRPC$User tLRPC$User, boolean z) {
return putUser(tLRPC$User, z, false);
}
public boolean putUser(org.telegram.tgnet.TLRPC$User r9, boolean r10, boolean r11) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.putUser(org.telegram.tgnet.TLRPC$User, boolean, boolean):boolean");
}
public void putUsers(ArrayList<TLRPC$User> arrayList, boolean z) {
if (arrayList == null || arrayList.isEmpty()) {
return;
}
int size = arrayList.size();
boolean z2 = false;
for (int i = 0; i < size; i++) {
if (putUser(arrayList.get(i), z)) {
z2 = true;
}
}
if (z2) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda440(this));
}
}
public void registerForPush(int i, String str) {
if (TextUtils.isEmpty(str) || this.registeringForPush || getUserConfig().getClientUserId() == 0) {
return;
}
if (getUserConfig().registeredForPush && str.equals(SharedConfig.pushString)) {
return;
}
this.registeringForPush = true;
this.lastPushRegisterSendTime = SystemClock.elapsedRealtime();
if (SharedConfig.pushAuthKey == null) {
SharedConfig.pushAuthKey = new byte[256];
Utilities.random.nextBytes(SharedConfig.pushAuthKey);
SharedConfig.saveConfig();
}
TL_account.registerDevice registerdevice = new TL_account.registerDevice();
registerdevice.token_type = i;
registerdevice.token = str;
registerdevice.no_muted = false;
registerdevice.secret = SharedConfig.pushAuthKey;
for (int i2 = 0; i2 < 4; i2++) {
UserConfig userConfig = UserConfig.getInstance(i2);
if (i2 != this.currentAccount && userConfig.isClientActivated()) {
long clientUserId = userConfig.getClientUserId();
registerdevice.other_uids.add(Long.valueOf(clientUserId));
if (BuildVars.LOGS_ENABLED) {
FileLog.d("add other uid = " + clientUserId + " for account " + this.currentAccount);
}
}
}
getConnectionsManager().sendRequest(registerdevice, new MessagesController$.ExternalSyntheticLambda348(this, i, str));
}
public void rejectSuggestedMessage(long j, int i, String str) {
approveOrRejectSuggestedMessageImpl(j, i, -1, true, str);
}
public void reloadMentionsCountForChannel(TLRPC.InputPeer inputPeer, long j) {
Exception e;
NativeByteBuffer nativeByteBuffer;
if (j == 0) {
try {
nativeByteBuffer = new NativeByteBuffer(inputPeer.getObjectSize() + 4);
} catch (Exception e2) {
e = e2;
nativeByteBuffer = null;
}
try {
nativeByteBuffer.writeInt32(22);
inputPeer.serializeToStream(nativeByteBuffer);
} catch (Exception e3) {
e = e3;
FileLog.e(e);
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
TLRPC.TL_messages_getUnreadMentions tL_messages_getUnreadMentions = new TLRPC.TL_messages_getUnreadMentions();
tL_messages_getUnreadMentions.peer = inputPeer;
tL_messages_getUnreadMentions.limit = 1;
getConnectionsManager().sendRequest(tL_messages_getUnreadMentions, new MessagesController$.ExternalSyntheticLambda111(this, inputPeer, j));
}
j = getMessagesStorage().createPendingTask(nativeByteBuffer);
}
TLRPC.TL_messages_getUnreadMentions tL_messages_getUnreadMentions2 = new TLRPC.TL_messages_getUnreadMentions();
tL_messages_getUnreadMentions2.peer = inputPeer;
tL_messages_getUnreadMentions2.limit = 1;
getConnectionsManager().sendRequest(tL_messages_getUnreadMentions2, new MessagesController$.ExternalSyntheticLambda111(this, inputPeer, j));
}
public void reloadMentionsCountForChannels(ArrayList<Long> arrayList) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda428(this, arrayList));
}
public void reloadReactionsNotifySettings() {
getConnectionsManager().sendRequest(new TL_account.getReactionsNotifySettings(), new MessagesController$.ExternalSyntheticLambda275(this));
}
public void reloadUser(long j) {
TLObject tL_users_getUsers = new TLRPC.TL_users_getUsers();
TLRPC.InputUser inputUser = getInputUser(j);
if (inputUser == null) {
return;
}
((TLRPC.TL_users_getUsers) tL_users_getUsers).id.add(inputUser);
ConnectionsManager.getInstance(this.currentAccount).sendRequest(tL_users_getUsers, new MessagesController$.ExternalSyntheticLambda39(this));
}
public void reloadWebPages(long j, HashMap<String, ArrayList<MessageObject>> hashMap, int i) {
HashMap<String, ArrayList<MessageObject>> hashMap2;
LongSparseArray longSparseArray;
boolean z = i == 1;
boolean z2 = i == 3;
if (z) {
hashMap2 = this.reloadingScheduledWebpages;
longSparseArray = this.reloadingScheduledWebpagesPending;
} else if (z2) {
hashMap2 = this.reloadingSavedWebpages;
longSparseArray = this.reloadingSavedWebpagesPending;
} else {
hashMap2 = this.reloadingWebpages;
longSparseArray = this.reloadingWebpagesPending;
}
HashMap<String, ArrayList<MessageObject>> hashMap3 = hashMap2;
LongSparseArray longSparseArray2 = longSparseArray;
for (Map.Entry<String, ArrayList<MessageObject>> entry : hashMap.entrySet()) {
String key = entry.getKey();
ArrayList<MessageObject> value = entry.getValue();
ArrayList<MessageObject> arrayList = hashMap3.get(key);
if (arrayList == null) {
arrayList = new ArrayList<>();
hashMap3.put(key, arrayList);
}
arrayList.addAll(value);
TL_account.getWebPagePreview getwebpagepreview = new TL_account.getWebPagePreview();
getwebpagepreview.message = key;
getConnectionsManager().sendRequest(getwebpagepreview, new MessagesController$.ExternalSyntheticLambda427(this, hashMap3, key, longSparseArray2, j, i));
}
}
protected void removeDeletedMessagesFromArray(long j, ArrayList<TLRPC.Message> arrayList) {
int i = 0;
int i2 = this.deletedHistory.get(j, 0);
if (i2 == 0) {
return;
}
int size = arrayList.size();
while (i < size) {
if (arrayList.get(i).id <= i2) {
arrayList.remove(i);
i--;
size--;
}
i++;
}
}
public void removeDialogAction(long j, boolean z, boolean z2) {
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog == null) {
return;
}
if (z) {
this.clearingHistoryDialogs.remove(j);
} else {
this.deletingDialogs.remove(j);
if (!z2) {
this.allDialogs.add(dialog);
sortDialogs(null);
}
}
if (z2) {
return;
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
public void removeDraftDialogIfNeed(long j) {
TLRPC.Dialog dialog = (TLRPC.Dialog) this.dialogs_dict.get(j);
if (dialog == null || dialog.top_message != 0) {
return;
}
this.dialogs_dict.remove(dialog.id);
this.allDialogs.remove(dialog);
}
public void removeFilter(DialogFilter dialogFilter) {
this.dialogFilters.remove(dialogFilter);
this.dialogFiltersById.remove(dialogFilter.id);
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
}
public Pair<Runnable, Runnable> removeFolderTemporarily(int i, ArrayList<Long> arrayList) {
this.frozenDialogFilters = new ArrayList<>(this.dialogFilters);
int i2 = 0;
while (i2 < this.frozenDialogFilters.size()) {
if (this.frozenDialogFilters.get(i2).id == i) {
this.frozenDialogFilters.remove(i2);
i2--;
}
i2++;
}
this.hiddenUndoChats.clear();
if (arrayList != null) {
this.hiddenUndoChats.addAll(arrayList);
}
boolean z = !this.hiddenUndoChats.isEmpty();
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
if (z) {
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[0]);
}
return new Pair<>(new MessagesController$.ExternalSyntheticLambda451(this, i, z), new MessagesController$.ExternalSyntheticLambda452(this, z));
}
public void removeSuggestion(long j, String str) {
if (TextUtils.isEmpty(str)) {
return;
}
if (j == 0) {
TLRPC.TL_pendingSuggestion tL_pendingSuggestion = this.customPendingSuggestion;
if (tL_pendingSuggestion != null && TextUtils.equals(str, tL_pendingSuggestion.suggestion)) {
this.customPendingSuggestion = null;
getNotificationCenter().postNotificationName(NotificationCenter.newSuggestionsAvailable, new Object[0]);
} else {
if (!this.pendingSuggestions.remove(str) && this.dismissedSuggestions.contains(str)) {
return;
}
this.dismissedSuggestions.add(str);
SharedPreferences.Editor edit = this.mainPreferences.edit();
edit.putStringSet("pendingSuggestions", this.pendingSuggestions);
edit.putStringSet("dismissedSuggestions", this.dismissedSuggestions);
edit.commit();
getNotificationCenter().postNotificationName(NotificationCenter.newSuggestionsAvailable, new Object[0]);
}
}
TLRPC.TL_help_dismissSuggestion tL_help_dismissSuggestion = new TLRPC.TL_help_dismissSuggestion();
tL_help_dismissSuggestion.suggestion = str;
tL_help_dismissSuggestion.peer = j == 0 ? new TLRPC.TL_inputPeerEmpty() : getInputPeer(j);
getConnectionsManager().sendRequest(tL_help_dismissSuggestion, new MessagesController$.ExternalSyntheticLambda392());
}
public void renameSavedReactionTag(ReactionsLayoutInBubble.VisibleReaction visibleReaction, String str) {
boolean z;
boolean z2;
long j;
String str2;
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null) {
return;
}
TLRPC.messages_SavedReactionTags messages_savedreactiontags = (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(0L);
if (messages_savedreactiontags == null) {
LongSparseArray longSparseArray2 = this.reactionTags;
TLRPC.messages_SavedReactionTags tL_messages_savedReactionsTags = new TLRPC.TL_messages_savedReactionsTags();
longSparseArray2.put(0L, tL_messages_savedReactionsTags);
messages_savedreactiontags = tL_messages_savedReactionsTags;
}
int i = 0;
while (true) {
if (i >= messages_savedreactiontags.tags.size()) {
z = false;
z2 = false;
break;
}
TLRPC.TL_savedReactionTag tL_savedReactionTag = (TLRPC.TL_savedReactionTag) messages_savedreactiontags.tags.get(i);
if (visibleReaction.isSame(tL_savedReactionTag.reaction)) {
if (TextUtils.isEmpty(str)) {
z = tL_savedReactionTag.title != null;
tL_savedReactionTag.flags &= -2;
tL_savedReactionTag.title = null;
} else {
z = !TextUtils.equals(tL_savedReactionTag.title, str);
tL_savedReactionTag.flags |= 1;
tL_savedReactionTag.title = str;
}
z2 = true;
} else {
i++;
}
}
if (!z2) {
TLRPC.TL_savedReactionTag tL_savedReactionTag2 = new TLRPC.TL_savedReactionTag();
tL_savedReactionTag2.reaction = visibleReaction.toTLReaction();
if (!TextUtils.isEmpty(str)) {
tL_savedReactionTag2.title = str;
}
tL_savedReactionTag2.count = 1;
messages_savedreactiontags.tags.add(tL_savedReactionTag2);
z = true;
}
if (z) {
TLRPC.TL_messages_updateSavedReactionTag tL_messages_updateSavedReactionTag = new TLRPC.TL_messages_updateSavedReactionTag();
tL_messages_updateSavedReactionTag.reaction = visibleReaction.toTLReaction();
if (!TextUtils.isEmpty(str)) {
tL_messages_updateSavedReactionTag.flags |= 1;
tL_messages_updateSavedReactionTag.title = str;
}
getConnectionsManager().sendRequest(tL_messages_updateSavedReactionTag, null);
Collections.sort(messages_savedreactiontags.tags, new MessagesController$.ExternalSyntheticLambda212(this));
long j2 = 0;
for (int i2 = 0; i2 < messages_savedreactiontags.tags.size(); i2++) {
TLRPC.TL_savedReactionTag tL_savedReactionTag3 = (TLRPC.TL_savedReactionTag) messages_savedreactiontags.tags.get(i2);
if (tL_savedReactionTag3.count > 0) {
TLRPC.TL_reactionEmoji tL_reactionEmoji = tL_savedReactionTag3.reaction;
if (tL_reactionEmoji instanceof TLRPC.TL_reactionEmoji) {
j = MessagesController$.ExternalSyntheticBackport3.m(Utilities.MD5(tL_reactionEmoji.emoticon).substring(0, 16), 16);
} else {
if (tL_reactionEmoji instanceof TLRPC.TL_reactionCustomEmoji) {
j = ((TLRPC.TL_reactionCustomEmoji) tL_reactionEmoji).document_id;
}
if ((tL_savedReactionTag3.flags & 1) != 0 && (str2 = tL_savedReactionTag3.title) != null) {
j2 = MediaDataController.calcHash(j2, MessagesController$.ExternalSyntheticBackport4.m(Utilities.MD5(str2).substring(0, 16), 16));
}
j2 = MediaDataController.calcHash(j2, tL_savedReactionTag3.count);
}
j2 = MediaDataController.calcHash(j2, j);
if ((tL_savedReactionTag3.flags & 1) != 0) {
j2 = MediaDataController.calcHash(j2, MessagesController$.ExternalSyntheticBackport4.m(Utilities.MD5(str2).substring(0, 16), 16));
}
j2 = MediaDataController.calcHash(j2, tL_savedReactionTag3.count);
}
}
messages_savedreactiontags.hash = j2;
saveSavedReactionsTags(0L, messages_savedreactiontags);
getNotificationCenter().postNotificationName(NotificationCenter.savedReactionTagsUpdate, new Object[]{0L});
}
}
public void reorderPinnedDialogs(int i, ArrayList<TLRPC.InputDialogPeer> arrayList, long j) {
OutputSerializedData outputSerializedData;
TLRPC.TL_messages_reorderPinnedDialogs tL_messages_reorderPinnedDialogs = new TLRPC.TL_messages_reorderPinnedDialogs();
tL_messages_reorderPinnedDialogs.folder_id = i;
tL_messages_reorderPinnedDialogs.force = true;
if (j == 0) {
ArrayList<TLRPC.Dialog> dialogs = getDialogs(i);
if (dialogs.isEmpty()) {
return;
}
ArrayList arrayList2 = new ArrayList();
ArrayList arrayList3 = new ArrayList();
int size = dialogs.size();
int i2 = 0;
for (int i3 = 0; i3 < size; i3++) {
TLRPC.Dialog dialog = dialogs.get(i3);
if (!(dialog instanceof TLRPC.TL_dialogFolder)) {
if (!dialog.pinned) {
if (dialog.id != this.promoDialogId) {
break;
}
} else {
arrayList2.add(Long.valueOf(dialog.id));
arrayList3.add(Integer.valueOf(dialog.pinnedNum));
if (!DialogObject.isEncryptedDialog(dialog.id)) {
TLRPC.InputPeer inputPeer = getInputPeer(dialog.id);
TLRPC.TL_inputDialogPeer tL_inputDialogPeer = new TLRPC.TL_inputDialogPeer();
tL_inputDialogPeer.peer = inputPeer;
tL_messages_reorderPinnedDialogs.order.add(tL_inputDialogPeer);
i2 += tL_inputDialogPeer.getObjectSize();
}
}
}
}
getMessagesStorage().setDialogsPinned(arrayList2, arrayList3);
try {
outputSerializedData = new NativeByteBuffer(i2 + 12);
try {
outputSerializedData.writeInt32(16);
outputSerializedData.writeInt32(i);
outputSerializedData.writeInt32(tL_messages_reorderPinnedDialogs.order.size());
int size2 = tL_messages_reorderPinnedDialogs.order.size();
for (int i4 = 0; i4 < size2; i4++) {
((TLRPC.InputDialogPeer) tL_messages_reorderPinnedDialogs.order.get(i4)).serializeToStream(outputSerializedData);
}
} catch (Exception e) {
e = e;
FileLog.e(e);
j = getMessagesStorage().createPendingTask(outputSerializedData);
getConnectionsManager().sendRequest(tL_messages_reorderPinnedDialogs, new MessagesController$.ExternalSyntheticLambda173(this, j));
}
} catch (Exception e2) {
e = e2;
outputSerializedData = null;
}
j = getMessagesStorage().createPendingTask(outputSerializedData);
} else {
tL_messages_reorderPinnedDialogs.order = arrayList;
}
getConnectionsManager().sendRequest(tL_messages_reorderPinnedDialogs, new MessagesController$.ExternalSyntheticLambda173(this, j));
}
public void reportMessageDelivery(long j, int i, boolean z) {
StarsController.MessageId from = StarsController.MessageId.from(j, i);
if (this.reportedMessageDelivery.contains(from)) {
return;
}
this.reportedMessageDelivery.add(from);
this.pendingReportMessageDelivery.add(new Pair<>(from, new AtomicBoolean(z)));
AndroidUtilities.cancelRunOnUIThread(this.sendReportMessageDeliver);
AndroidUtilities.runOnUIThread(this.sendReportMessageDeliver);
}
public void reportSpam(long j, TLRPC$User tLRPC$User, TLRPC.Chat chat, TLRPC.EncryptedChat encryptedChat, boolean z) {
TLRPC.TL_messages_reportEncryptedSpam tL_messages_reportSpam;
long j2;
ConnectionsManager connectionsManager;
MessagesController$.ExternalSyntheticLambda42 externalSyntheticLambda44;
long j3;
if (tLRPC$User == null && chat == null && encryptedChat == null) {
return;
}
SharedPreferences.Editor edit = this.notificationsPreferences.edit();
edit.putInt("dialog_bar_vis3" + j, 3);
edit.commit();
if (DialogObject.isEncryptedDialog(j)) {
if (encryptedChat == null || encryptedChat.access_hash == 0) {
return;
}
tL_messages_reportSpam = new TLRPC.TL_messages_reportEncryptedSpam();
TLRPC.TL_inputEncryptedChat tL_inputEncryptedChat = new TLRPC.TL_inputEncryptedChat();
tL_messages_reportSpam.peer = tL_inputEncryptedChat;
tL_inputEncryptedChat.chat_id = encryptedChat.id;
tL_inputEncryptedChat.access_hash = encryptedChat.access_hash;
connectionsManager = getConnectionsManager();
externalSyntheticLambda44 = new MessagesController$.ExternalSyntheticLambda42();
} else if (z) {
tL_messages_reportSpam = new TL_account.reportPeer();
if (chat != null) {
j3 = -chat.id;
} else {
if (tLRPC$User != null) {
j3 = tLRPC$User.id;
}
((TL_account.reportPeer) tL_messages_reportSpam).message = "";
((TL_account.reportPeer) tL_messages_reportSpam).reason = new TLRPC.TL_inputReportReasonGeoIrrelevant();
connectionsManager = getConnectionsManager();
externalSyntheticLambda44 = new MessagesController$.ExternalSyntheticLambda43();
}
((TL_account.reportPeer) tL_messages_reportSpam).peer = getInputPeer(j3);
((TL_account.reportPeer) tL_messages_reportSpam).message = "";
((TL_account.reportPeer) tL_messages_reportSpam).reason = new TLRPC.TL_inputReportReasonGeoIrrelevant();
connectionsManager = getConnectionsManager();
externalSyntheticLambda44 = new MessagesController$.ExternalSyntheticLambda43();
} else {
tL_messages_reportSpam = new TLRPC.TL_messages_reportSpam();
if (chat != null) {
j2 = -chat.id;
} else {
if (tLRPC$User != null) {
j2 = tLRPC$User.id;
}
connectionsManager = getConnectionsManager();
externalSyntheticLambda44 = new MessagesController$.ExternalSyntheticLambda44();
}
((TLRPC.TL_messages_reportSpam) tL_messages_reportSpam).peer = getInputPeer(j2);
connectionsManager = getConnectionsManager();
externalSyntheticLambda44 = new MessagesController$.ExternalSyntheticLambda44();
}
connectionsManager.sendRequest(tL_messages_reportSpam, externalSyntheticLambda44, 2);
}
public void requestContactToken(long j, Utilities.Callback<TLRPC.TL_exportedContactToken> callback) {
if (callback == null || this.requestingContactToken) {
return;
}
if (this.cachedContactToken != null && r0.expires > System.currentTimeMillis() / 1000) {
callback.run(this.cachedContactToken);
return;
}
this.requestingContactToken = true;
getConnectionsManager().sendRequest(new TLRPC.TL_contacts_exportContactToken(), new MessagesController$.ExternalSyntheticLambda454(this, callback, j, System.currentTimeMillis()));
}
public void requestContactToken(Utilities.Callback<TLRPC.TL_exportedContactToken> callback) {
requestContactToken(0L, callback);
}
public void saveGif(Object obj, TLRPC$Document tLRPC$Document) {
if (obj == null || !MessageObject.isGifDocument(tLRPC$Document)) {
return;
}
TLRPC.TL_messages_saveGif tL_messages_saveGif = new TLRPC.TL_messages_saveGif();
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
tL_messages_saveGif.id = tL_inputDocument;
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
byte[] bArr = tLRPC$Document.file_reference;
((TLRPC.InputDocument) tL_inputDocument).file_reference = bArr;
if (bArr == null) {
((TLRPC.InputDocument) tL_inputDocument).file_reference = new byte[0];
}
tL_messages_saveGif.unsave = false;
getConnectionsManager().sendRequest(tL_messages_saveGif, new MessagesController$.ExternalSyntheticLambda168(this, obj, tL_messages_saveGif));
}
public void saveRecentSticker(Object obj, TLRPC$Document tLRPC$Document, boolean z) {
if (obj == null || tLRPC$Document == null) {
return;
}
TLRPC.TL_messages_saveRecentSticker tL_messages_saveRecentSticker = new TLRPC.TL_messages_saveRecentSticker();
TLRPC.TL_inputDocument tL_inputDocument = new TLRPC.TL_inputDocument();
tL_messages_saveRecentSticker.id = tL_inputDocument;
((TLRPC.InputDocument) tL_inputDocument).id = tLRPC$Document.id;
((TLRPC.InputDocument) tL_inputDocument).access_hash = tLRPC$Document.access_hash;
byte[] bArr = tLRPC$Document.file_reference;
((TLRPC.InputDocument) tL_inputDocument).file_reference = bArr;
if (bArr == null) {
((TLRPC.InputDocument) tL_inputDocument).file_reference = new byte[0];
}
tL_messages_saveRecentSticker.unsave = false;
tL_messages_saveRecentSticker.attached = z;
getConnectionsManager().sendRequest(tL_messages_saveRecentSticker, new MessagesController$.ExternalSyntheticLambda270(this, obj, tL_messages_saveRecentSticker));
}
public void saveTheme(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent, boolean z, boolean z2) {
TLRPC.TL_theme tL_theme = themeAccent != null ? themeAccent.info : themeInfo.info;
if (tL_theme != null) {
TL_account.saveTheme savetheme = new TL_account.saveTheme();
TLRPC.TL_inputTheme tL_inputTheme = new TLRPC.TL_inputTheme();
tL_inputTheme.id = tL_theme.id;
tL_inputTheme.access_hash = tL_theme.access_hash;
savetheme.theme = tL_inputTheme;
savetheme.unsave = z2;
getConnectionsManager().sendRequest(savetheme, new MessagesController$.ExternalSyntheticLambda382());
getConnectionsManager().resumeNetworkMaybe();
}
if (z2) {
return;
}
installTheme(themeInfo, themeAccent, z);
}
public void saveThemeToServer(Theme.ThemeInfo themeInfo, Theme.ThemeAccent themeAccent) {
String str;
File file;
if (themeInfo == null) {
return;
}
if (themeAccent != 0) {
str = themeAccent.saveToFile().getAbsolutePath();
file = themeAccent.getPathToWallpaper();
} else {
str = themeInfo.pathToFile;
file = null;
}
String str2 = str;
File file2 = file;
if (str2 == null || this.uploadingThemes.containsKey(str2)) {
return;
}
this.uploadingThemes.put(str2, themeAccent != 0 ? themeAccent : themeInfo);
Utilities.globalQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda69(this, str2, file2, themeAccent, themeInfo));
}
public void saveWallpaperToServer(java.io.File r8, org.telegram.ui.ActionBar.Theme.OverrideWallpaperInfo r9, boolean r10, long r11) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.saveWallpaperToServer(java.io.File, org.telegram.ui.ActionBar.Theme$OverrideWallpaperInfo, boolean, long):void");
}
public void selectDialogFilter(DialogFilter dialogFilter, int i) {
DialogFilter[] dialogFilterArr = this.selectedDialogFilter;
DialogFilter dialogFilter2 = dialogFilterArr[i];
if (dialogFilter2 == dialogFilter) {
return;
}
dialogFilterArr[i] = dialogFilter;
if (dialogFilterArr[i == 0 ? (char) 1 : (char) 0] == dialogFilter) {
dialogFilterArr[i == 0 ? (char) 1 : (char) 0] = null;
}
if (dialogFilterArr[i] != null) {
sortDialogs(null);
} else if (dialogFilter2 != null) {
dialogFilter2.dialogs.clear();
dialogFilter2.dialogsForward.clear();
}
}
public void sendBotStart(TLRPC$User tLRPC$User, String str) {
if (tLRPC$User == null) {
return;
}
TLRPC.TL_messages_startBot tL_messages_startBot = new TLRPC.TL_messages_startBot();
tL_messages_startBot.bot = getInputUser(tLRPC$User);
tL_messages_startBot.peer = getInputPeer(tLRPC$User.id);
tL_messages_startBot.start_param = str;
tL_messages_startBot.random_id = Utilities.random.nextLong();
getConnectionsManager().sendRequest(tL_messages_startBot, new MessagesController$.ExternalSyntheticLambda27(this));
}
public boolean sendTyping(long j, long j2, int i, int i2) {
return sendTyping(j, j2, i, null, i2);
}
public boolean sendTyping(long r17, long r19, int r21, java.lang.String r22, int r23) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.sendTyping(long, long, int, java.lang.String, int):boolean");
}
public void setBoostsToUnblockRestrictions(long j, int i) {
TLRPC.TL_channels_setBoostsToUnblockRestrictions tL_channels_setBoostsToUnblockRestrictions = new TLRPC.TL_channels_setBoostsToUnblockRestrictions();
tL_channels_setBoostsToUnblockRestrictions.boosts = i;
tL_channels_setBoostsToUnblockRestrictions.channel = getInputChannel(j);
getConnectionsManager().sendRequest(tL_channels_setBoostsToUnblockRestrictions, new MessagesController$.ExternalSyntheticLambda351(this, j));
}
public void setChannelSlowMode(long j, int i) {
TLRPC.TL_channels_toggleSlowMode tL_channels_toggleSlowMode = new TLRPC.TL_channels_toggleSlowMode();
tL_channels_toggleSlowMode.seconds = i;
tL_channels_toggleSlowMode.channel = getInputChannel(j);
getConnectionsManager().sendRequest(tL_channels_toggleSlowMode, new MessagesController$.ExternalSyntheticLambda220(this, j));
}
public void setChatPendingRequestsOnClose(long j, int i) {
this.mainPreferences.edit().putInt("chatPendingRequests" + j, i).apply();
}
public void setChatReactions(long j, int i, List<String> list) {
TLRPC.TL_chatReactionsNone tL_chatReactionsAll;
TLRPC.TL_messages_setChatAvailableReactions tL_messages_setChatAvailableReactions = new TLRPC.TL_messages_setChatAvailableReactions();
tL_messages_setChatAvailableReactions.peer = getInputPeer(-j);
if (i == 2) {
tL_chatReactionsAll = new TLRPC.TL_chatReactionsNone();
} else {
if (i != 0) {
TLRPC.TL_chatReactionsSome tL_chatReactionsSome = new TLRPC.TL_chatReactionsSome();
tL_messages_setChatAvailableReactions.available_reactions = tL_chatReactionsSome;
for (int i2 = 0; i2 < list.size(); i2++) {
TLRPC.TL_reactionEmoji tL_reactionEmoji = new TLRPC.TL_reactionEmoji();
tL_reactionEmoji.emoticon = list.get(i2);
tL_chatReactionsSome.reactions.add(tL_reactionEmoji);
}
getConnectionsManager().sendRequest(tL_messages_setChatAvailableReactions, new MessagesController$.ExternalSyntheticLambda187(this, j, tL_messages_setChatAvailableReactions));
}
tL_chatReactionsAll = new TLRPC.TL_chatReactionsAll();
}
tL_messages_setChatAvailableReactions.available_reactions = tL_chatReactionsAll;
getConnectionsManager().sendRequest(tL_messages_setChatAvailableReactions, new MessagesController$.ExternalSyntheticLambda187(this, j, tL_messages_setChatAvailableReactions));
}
public void setContentSettings(boolean z) {
TL_account.contentSettings contentsettings = this.contentSettings;
if (contentsettings != null) {
if (!contentsettings.sensitive_can_change) {
return;
} else {
contentsettings.sensitive_enabled = z;
}
}
if (this.ignoreRestrictionReasons == null) {
this.ignoreRestrictionReasons = new HashSet();
}
Set<String> set = this.ignoreRestrictionReasons;
if (z) {
set.add("sensitive");
} else {
set.remove("sensitive");
}
TL_account.setContentSettings setcontentsettings = new TL_account.setContentSettings();
setcontentsettings.sensitive_enabled = z;
getConnectionsManager().sendRequest(setcontentsettings, new MessagesController$.ExternalSyntheticLambda179());
}
public void setCustomChatReactions(long r15, int r17, java.util.List<org.telegram.tgnet.TLRPC.Reaction> r18, int r19, java.lang.Boolean r20, org.telegram.messenger.Utilities.Callback<org.telegram.tgnet.TLRPC.TL_error> r21, java.lang.Runnable r22) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.setCustomChatReactions(long, int, java.util.List, int, java.lang.Boolean, org.telegram.messenger.Utilities$Callback, java.lang.Runnable):void");
}
public void setDefaultBannedRole(long j, TLRPC.TL_chatBannedRights tL_chatBannedRights, boolean z, BaseFragment baseFragment) {
if (tL_chatBannedRights == null) {
return;
}
TLRPC.TL_messages_editChatDefaultBannedRights tL_messages_editChatDefaultBannedRights = new TLRPC.TL_messages_editChatDefaultBannedRights();
tL_messages_editChatDefaultBannedRights.peer = getInputPeer(-j);
tL_messages_editChatDefaultBannedRights.banned_rights = tL_chatBannedRights;
getConnectionsManager().sendRequest(tL_messages_editChatDefaultBannedRights, new MessagesController$.ExternalSyntheticLambda363(this, j, baseFragment, tL_messages_editChatDefaultBannedRights, z));
}
public void setDefaultSendAs(long j, long j2) {
TLRPC.ChatFull chatFull = getChatFull(-j);
if (chatFull != null) {
chatFull.default_send_as = getPeer(j2);
getMessagesStorage().updateChatInfo(chatFull, false);
getNotificationCenter().postNotificationName(NotificationCenter.updateDefaultSendAsPeer, new Object[]{Long.valueOf(j), chatFull.default_send_as});
}
TLRPC.TL_messages_saveDefaultSendAs tL_messages_saveDefaultSendAs = new TLRPC.TL_messages_saveDefaultSendAs();
tL_messages_saveDefaultSendAs.peer = getInputPeer(j);
tL_messages_saveDefaultSendAs.send_as = getInputPeer(j2);
getConnectionsManager().sendRequest(tL_messages_saveDefaultSendAs, new MessagesController$.ExternalSyntheticLambda309(this, j), 64);
}
public void setDialogHistoryTTL(long j, int i) {
TLRPC.UserFull userFull;
TLRPC.TL_messages_setHistoryTTL tL_messages_setHistoryTTL = new TLRPC.TL_messages_setHistoryTTL();
tL_messages_setHistoryTTL.peer = getInputPeer(j);
tL_messages_setHistoryTTL.period = i;
getConnectionsManager().sendRequest(tL_messages_setHistoryTTL, new MessagesController$.ExternalSyntheticLambda233(this));
TLRPC.Dialog dialog = (TLRPC.Dialog) getMessagesController().dialogs_dict.get(j);
if (dialog != null) {
dialog.ttl_period = i;
}
getMessagesStorage().setDialogTtl(j, i);
TLRPC.ChatFull chatFull = null;
if (j > 0) {
userFull = getUserFull(j);
if (userFull != null) {
userFull.ttl_period = i;
userFull.flags |= 16384;
}
} else {
TLRPC.ChatFull chatFull2 = getChatFull(-j);
if (chatFull2 != null) {
chatFull2.ttl_period = i;
chatFull2.flags = chatFull2 instanceof TLRPC.TL_channelFull ? chatFull2.flags | ConnectionsManager.FileTypePhoto : chatFull2.flags | 16384;
}
chatFull = chatFull2;
userFull = null;
}
if (chatFull == null) {
if (userFull != null) {
getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, new Object[]{Long.valueOf(j), userFull});
}
} else {
NotificationCenter notificationCenter = getNotificationCenter();
int i2 = NotificationCenter.chatInfoDidLoad;
Boolean bool = Boolean.FALSE;
notificationCenter.postNotificationName(i2, new Object[]{chatFull, 0, bool, bool});
}
}
public void setDialogsInTransaction(boolean z) {
this.dialogsInTransaction = z;
if (z) {
return;
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{Boolean.TRUE});
}
public void setFolderTags(boolean z) {
SharedPreferences.Editor edit = this.mainPreferences.edit();
this.folderTags = z;
edit.putBoolean("folderTags", z).apply();
}
public void setForumLastTopicId(long j, long j2) {
this.mainPreferences.edit().putLong("forumlasttopic" + j, j2).apply();
}
public void setLastCreatedDialogId(long j, boolean z, boolean z2) {
if (!z) {
ArrayList<Long> arrayList = this.createdDialogMainThreadIds;
Long valueOf = Long.valueOf(j);
if (!z2) {
arrayList.remove(valueOf);
SparseArray sparseArray = (SparseArray) this.pollsToCheck.get(j);
if (sparseArray != null) {
int size = sparseArray.size();
for (int i = 0; i < size; i++) {
((MessageObject) sparseArray.valueAt(i)).pollVisibleOnScreen = false;
}
}
} else if (arrayList.contains(valueOf)) {
return;
} else {
arrayList.add(Long.valueOf(j));
}
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda370(this, z, z2, j));
}
public void setLastVisibleDialogId(long j, boolean z, boolean z2) {
ArrayList<Long> arrayList = z ? this.visibleScheduledDialogMainThreadIds : this.visibleDialogMainThreadIds;
if (!z2) {
arrayList.remove(Long.valueOf(j));
} else {
if (arrayList.contains(Long.valueOf(j))) {
return;
}
arrayList.add(Long.valueOf(j));
}
}
public void setParticipantBannedRole(long j, TLRPC$User tLRPC$User, TLRPC.Chat chat, TLRPC.TL_chatBannedRights tL_chatBannedRights, boolean z, BaseFragment baseFragment) {
setParticipantBannedRole(j, tLRPC$User, chat, tL_chatBannedRights, z, baseFragment, null);
}
public void setParticipantBannedRole(long j, TLRPC$User tLRPC$User, TLRPC.Chat chat, TLRPC.TL_chatBannedRights tL_chatBannedRights, boolean z, BaseFragment baseFragment, Runnable runnable) {
if ((tLRPC$User == null && chat == null) || tL_chatBannedRights == null) {
return;
}
TLRPC.TL_channels_editBanned tL_channels_editBanned = new TLRPC.TL_channels_editBanned();
tL_channels_editBanned.channel = getInputChannel(j);
tL_channels_editBanned.participant = tLRPC$User != null ? getInputPeer(tLRPC$User) : getInputPeer(chat);
tL_channels_editBanned.banned_rights = tL_chatBannedRights;
getConnectionsManager().sendRequest(tL_channels_editBanned, new MessagesController$.ExternalSyntheticLambda151(this, j, runnable, baseFragment, tL_channels_editBanned, z));
}
public void setReferer(String str) {
if (str == null) {
return;
}
this.installReferer = str;
this.mainPreferences.edit().putString("installReferer", str).commit();
}
public void setSavedViewAs(boolean z) {
if (this.savedViewAsChats != z) {
SharedPreferences.Editor edit = this.mainPreferences.edit();
this.savedViewAsChats = z;
edit.putBoolean("savedViewAsChats", z).apply();
}
}
public void setStoryQuality(boolean z) {
if (this.storyQualityFull != z) {
SharedPreferences.Editor edit = this.mainPreferences.edit();
this.storyQualityFull = z;
edit.putBoolean("storyQualityFull", z).apply();
getNotificationCenter().postNotificationName(NotificationCenter.storyQualityUpdate, new Object[0]);
}
}
public void setUserAdminRole(long j, TLRPC$User tLRPC$User, TLRPC.TL_chatAdminRights tL_chatAdminRights, String str, boolean z, BaseFragment baseFragment, boolean z2, boolean z3, String str2, Runnable runnable) {
setUserAdminRole(j, tLRPC$User, tL_chatAdminRights, str, z, baseFragment, z2, z3, str2, runnable, null);
}
public void setUserAdminRole(long j, TLRPC$User tLRPC$User, TLRPC.TL_chatAdminRights tL_chatAdminRights, String str, boolean z, BaseFragment baseFragment, boolean z2, boolean z3, String str2, Runnable runnable, ErrorDelegate errorDelegate) {
int i;
boolean z4;
MessagesController messagesController;
long j2;
TLRPC$User tLRPC$User2;
String str3;
BaseFragment baseFragment2;
MessagesController$.ExternalSyntheticLambda208 externalSyntheticLambda210;
if (tLRPC$User == null || tL_chatAdminRights == null) {
return;
}
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (ChatObject.isChannel(chat)) {
TLRPC.TL_channels_editAdmin tL_channels_editAdmin = new TLRPC.TL_channels_editAdmin();
tL_channels_editAdmin.channel = getInputChannel(chat);
tL_channels_editAdmin.user_id = getInputUser(tLRPC$User);
tL_channels_editAdmin.admin_rights = tL_chatAdminRights;
tL_channels_editAdmin.rank = str;
MessagesController$.ExternalSyntheticLambda207 externalSyntheticLambda207 = new MessagesController$.ExternalSyntheticLambda207(this, j, runnable, chat, tLRPC$User, errorDelegate, baseFragment, tL_channels_editAdmin, z);
if (tLRPC$User.bot || !z2) {
getConnectionsManager().sendRequest(tL_channels_editAdmin, externalSyntheticLambda207);
return;
}
externalSyntheticLambda210 = new MessagesController$.ExternalSyntheticLambda208(this, tL_channels_editAdmin, externalSyntheticLambda207);
i = 0;
z4 = true;
messagesController = this;
j2 = j;
tLRPC$User2 = tLRPC$User;
str3 = str2;
baseFragment2 = baseFragment;
} else {
TLRPC.TL_messages_editChatAdmin tL_messages_editChatAdmin = new TLRPC.TL_messages_editChatAdmin();
tL_messages_editChatAdmin.chat_id = j;
tL_messages_editChatAdmin.user_id = getInputUser(tLRPC$User);
tL_messages_editChatAdmin.is_admin = z3 || tL_chatAdminRights.change_info || tL_chatAdminRights.delete_messages || tL_chatAdminRights.ban_users || tL_chatAdminRights.invite_users || tL_chatAdminRights.pin_messages || tL_chatAdminRights.add_admins || tL_chatAdminRights.manage_call;
MessagesController$.ExternalSyntheticLambda209 externalSyntheticLambda209 = new MessagesController$.ExternalSyntheticLambda209(this, j, runnable, baseFragment, tL_messages_editChatAdmin, errorDelegate);
if (!tL_messages_editChatAdmin.is_admin && !z2 && TextUtils.isEmpty(str2)) {
getConnectionsManager().sendRequest(tL_messages_editChatAdmin, externalSyntheticLambda209);
return;
}
i = 0;
z4 = true;
messagesController = this;
j2 = j;
tLRPC$User2 = tLRPC$User;
str3 = str2;
baseFragment2 = baseFragment;
externalSyntheticLambda210 = new MessagesController$.ExternalSyntheticLambda210(this, tL_messages_editChatAdmin, externalSyntheticLambda209);
}
messagesController.addUserToChat(j2, tLRPC$User2, i, str3, baseFragment2, z4, externalSyntheticLambda210, errorDelegate);
}
public boolean shouldShowMoveCaptionHint() {
return getMainSettings().getInt("movecaptionhint", 0) < 24 || BuildVars.DEBUG_PRIVATE_VERSION;
}
public boolean showSensitiveContent() {
if (this.contentSettings != null && System.currentTimeMillis() - this.contentSettingsLoadedTime < 3600000) {
return this.contentSettings.sensitive_enabled;
}
Set<String> set = this.ignoreRestrictionReasons;
return set == null || set.contains("sensitive");
}
public void sortDialogs(androidx.collection.LongSparseArray r17) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.sortDialogs(androidx.collection.LongSparseArray):void");
}
public void sortDialogsList(ArrayList<TLRPC.Dialog> arrayList) {
if (arrayList == null) {
return;
}
Collections.sort(arrayList, this.dialogComparator);
}
public boolean starsPurchaseAvailable() {
return !this.starsLocked;
}
public void startShortPoll(TLRPC.Chat chat, int i, boolean z) {
startShortPoll(chat, i, z, null);
}
public void startShortPoll(TLRPC.Chat chat, int i, boolean z, Consumer consumer) {
if (chat == null) {
return;
}
Utilities.stageQueue.postRunnable(new MessagesController$.ExternalSyntheticLambda468(this, chat, z, i, consumer));
}
public boolean storiesEnabled() {
char c;
String str = this.storiesPosting;
int hashCode = str.hashCode();
if (hashCode == -1609594047) {
if (str.equals("enabled")) {
c = 1;
}
c = 65535;
} else if (hashCode != -318452137) {
if (hashCode == 270940796 && str.equals("disabled")) {
c = 3;
}
c = 65535;
} else {
if (str.equals("premium")) {
c = 0;
}
c = 65535;
}
return c != 0 ? c == 1 : getUserConfig().isPremium();
}
public boolean storyEntitiesAllowed() {
char c;
String str = this.storiesEntities;
int hashCode = str.hashCode();
if (hashCode == -1609594047) {
if (str.equals("enabled")) {
c = 1;
}
c = 65535;
} else if (hashCode != -318452137) {
if (hashCode == 270940796 && str.equals("disabled")) {
c = 3;
}
c = 65535;
} else {
if (str.equals("premium")) {
c = 0;
}
c = 65535;
}
return c != 0 ? c == 1 : getUserConfig().isPremium();
}
public boolean storyEntitiesAllowed(TLRPC$User tLRPC$User) {
char c;
if (tLRPC$User != null && tLRPC$User.id == this.storiesChangelogUserId) {
return true;
}
String str = this.storiesEntities;
int hashCode = str.hashCode();
if (hashCode == -1609594047) {
if (str.equals("enabled")) {
c = 1;
}
c = 65535;
} else if (hashCode != -318452137) {
if (hashCode == 270940796 && str.equals("disabled")) {
c = 3;
}
c = 65535;
} else {
if (str.equals("premium")) {
c = 0;
}
c = 65535;
}
return c != 0 ? c == 1 : tLRPC$User != null && tLRPC$User.premium;
}
public void toggleChannelForum(long j, boolean z, boolean z2) {
TLRPC.TL_channels_toggleForum tL_channels_toggleForum = new TLRPC.TL_channels_toggleForum();
tL_channels_toggleForum.channel = getInputChannel(j);
tL_channels_toggleForum.enabled = z;
tL_channels_toggleForum.tabs = z2;
getConnectionsManager().sendRequest(tL_channels_toggleForum, new MessagesController$.ExternalSyntheticLambda213(this), 64);
getNotificationCenter().postNotificationName(NotificationCenter.chatSwitchedForum, new Object[]{Long.valueOf(j), Boolean.valueOf(z), Boolean.valueOf(z2)});
}
public void toggleChannelInvitesHistory(long j, boolean z) {
TLRPC.TL_channels_togglePreHistoryHidden tL_channels_togglePreHistoryHidden = new TLRPC.TL_channels_togglePreHistoryHidden();
tL_channels_togglePreHistoryHidden.channel = getInputChannel(j);
tL_channels_togglePreHistoryHidden.enabled = z;
getConnectionsManager().sendRequest(tL_channels_togglePreHistoryHidden, new MessagesController$.ExternalSyntheticLambda60(this), 64);
}
public void toggleChannelSignatures(long j, boolean z, boolean z2) {
TLRPC.Chat chat = getChat(Long.valueOf(j));
if (chat != null) {
chat.signatures = z;
chat.signature_profiles = z2;
putChat(chat, true);
}
TLRPC.TL_channels_toggleSignatures tL_channels_toggleSignatures = new TLRPC.TL_channels_toggleSignatures();
tL_channels_toggleSignatures.channel = getInputChannel(j);
tL_channels_toggleSignatures.signatures_enabled = z;
tL_channels_toggleSignatures.profiles_enabled = z2;
getConnectionsManager().sendRequest(tL_channels_toggleSignatures, new MessagesController$.ExternalSyntheticLambda67(this), 64);
getNotificationCenter().postNotificationName(NotificationCenter.updateAllMessages, new Object[]{Long.valueOf(-j)});
}
public void toggleChatJoinRequest(long j, boolean z, Runnable runnable, Runnable runnable2) {
TLRPC.TL_channels_toggleJoinRequest tL_channels_toggleJoinRequest = new TLRPC.TL_channels_toggleJoinRequest();
tL_channels_toggleJoinRequest.channel = getInputChannel(j);
tL_channels_toggleJoinRequest.enabled = z;
getConnectionsManager().sendRequest(tL_channels_toggleJoinRequest, new MessagesController$.ExternalSyntheticLambda316(this, runnable, runnable2), 64);
}
public void toggleChatJoinToSend(long j, boolean z, Runnable runnable, Runnable runnable2) {
TLRPC.TL_channels_toggleJoinToSend tL_channels_toggleJoinToSend = new TLRPC.TL_channels_toggleJoinToSend();
tL_channels_toggleJoinToSend.channel = getInputChannel(j);
tL_channels_toggleJoinToSend.enabled = z;
getConnectionsManager().sendRequest(tL_channels_toggleJoinToSend, new MessagesController$.ExternalSyntheticLambda38(this, runnable, runnable2), 64);
}
public void toggleChatNoForwards(long j, boolean z) {
TLRPC.TL_messages_toggleNoForwards tL_messages_toggleNoForwards = new TLRPC.TL_messages_toggleNoForwards();
tL_messages_toggleNoForwards.peer = getInputPeer(-j);
tL_messages_toggleNoForwards.enabled = z;
getConnectionsManager().sendRequest(tL_messages_toggleNoForwards, new MessagesController$.ExternalSyntheticLambda190(this), 64);
}
public void unblockPeer(long j) {
unblockPeer(j, null);
}
public void unblockPeer(long j, Runnable runnable) {
TLRPC.Chat chat;
TLRPC.TL_contacts_unblock tL_contacts_unblock = new TLRPC.TL_contacts_unblock();
TLRPC$User tLRPC$User = null;
if (j > 0) {
TLRPC$User user = getUser(Long.valueOf(j));
if (user == null) {
return;
}
tLRPC$User = user;
chat = null;
} else {
chat = getChat(Long.valueOf(-j));
if (chat == null) {
return;
}
}
this.totalBlockedCount--;
this.blockePeers.delete(j);
tL_contacts_unblock.id = tLRPC$User != null ? getInputPeer(tLRPC$User) : getInputPeer(chat);
getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad, new Object[0]);
getConnectionsManager().sendRequest(tL_contacts_unblock, new MessagesController$.ExternalSyntheticLambda271(runnable));
}
public void unpinAllMessages(TLRPC.Chat chat, TLRPC$User tLRPC$User) {
if (chat == null && tLRPC$User == null) {
return;
}
TLRPC.TL_messages_unpinAllMessages tL_messages_unpinAllMessages = new TLRPC.TL_messages_unpinAllMessages();
tL_messages_unpinAllMessages.peer = getInputPeer(chat != null ? -chat.id : tLRPC$User.id);
getConnectionsManager().sendRequest(tL_messages_unpinAllMessages, new MessagesController$.ExternalSyntheticLambda193(this, chat, tLRPC$User));
}
public void unregistedPush() {
if (getUserConfig().registeredForPush && SharedConfig.pushString.length() == 0) {
TL_account.unregisterDevice unregisterdevice = new TL_account.unregisterDevice();
unregisterdevice.token = SharedConfig.pushString;
unregisterdevice.token_type = SharedConfig.pushType;
for (int i = 0; i < 4; i++) {
UserConfig userConfig = UserConfig.getInstance(i);
if (i != this.currentAccount && userConfig.isClientActivated()) {
unregisterdevice.other_uids.add(Long.valueOf(userConfig.getClientUserId()));
}
}
getConnectionsManager().sendRequest(unregisterdevice, new MessagesController$.ExternalSyntheticLambda194());
}
}
public void updateChannelUserName(BaseFragment baseFragment, long j, String str, Runnable runnable, Runnable runnable2) {
TLRPC.TL_channels_updateUsername tL_channels_updateUsername = new TLRPC.TL_channels_updateUsername();
tL_channels_updateUsername.channel = getInputChannel(j);
tL_channels_updateUsername.username = str;
getConnectionsManager().sendRequest(tL_channels_updateUsername, new MessagesController$.ExternalSyntheticLambda108(this, j, str, runnable, baseFragment, tL_channels_updateUsername, runnable2), 64);
}
public void updateChatAbout(long j, String str, TLRPC.ChatFull chatFull) {
TLRPC.TL_messages_editChatAbout tL_messages_editChatAbout = new TLRPC.TL_messages_editChatAbout();
tL_messages_editChatAbout.peer = getInputPeer(-j);
tL_messages_editChatAbout.about = str;
getConnectionsManager().sendRequest(tL_messages_editChatAbout, new MessagesController$.ExternalSyntheticLambda447(this, chatFull, str), 64);
}
public void updateConfig(TLRPC.TL_config tL_config) {
AndroidUtilities.runOnUIThread(new MessagesController$.ExternalSyntheticLambda17(this, tL_config));
}
public void updateEmojiStatus(long j, TLRPC.EmojiStatus emojiStatus, TL_stars.StarGift starGift) {
TL_account.updateEmojiStatus tL_channels_updateEmojiStatus;
boolean z = j == 0 || j == getUserConfig().getClientUserId();
TLRPC.EmojiStatus emojiStatusCollectibleFromGift = ((emojiStatus instanceof TLRPC.TL_inputEmojiStatusCollectible) && (starGift instanceof TL_stars.TL_starGiftUnique)) ? emojiStatusCollectibleFromGift((TL_stars.TL_starGiftUnique) starGift) : emojiStatus;
if (z) {
tL_channels_updateEmojiStatus = new TL_account.updateEmojiStatus();
tL_channels_updateEmojiStatus.emoji_status = emojiStatus;
TLRPC$User currentUser = getUserConfig().getCurrentUser();
if (currentUser != null) {
currentUser.emoji_status = emojiStatusCollectibleFromGift;
getNotificationCenter().postNotificationName(NotificationCenter.userEmojiStatusUpdated, new Object[]{currentUser});
}
} else {
tL_channels_updateEmojiStatus = new TLRPC.TL_channels_updateEmojiStatus();
long j2 = -j;
((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).channel = getInputChannel(j2);
((TLRPC.TL_channels_updateEmojiStatus) tL_channels_updateEmojiStatus).emoji_status = emojiStatus;
TLRPC.Chat chat = getChat(Long.valueOf(j2));
if (chat != null) {
chat.flags |= 512;
chat.emoji_status = emojiStatusCollectibleFromGift;
putChat(chat, true);
}
}
getMessagesController().updateEmojiStatusUntilUpdate(j, emojiStatusCollectibleFromGift);
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, new Object[]{Integer.valueOf(UPDATE_MASK_EMOJI_STATUS)});
getConnectionsManager().sendRequest(tL_channels_updateEmojiStatus, null);
}
public void updateEmojiStatus(TLRPC.EmojiStatus emojiStatus) {
updateEmojiStatus(emojiStatus, null);
}
public void updateEmojiStatus(TLRPC.EmojiStatus emojiStatus, TL_stars.StarGift starGift) {
updateEmojiStatus(0L, emojiStatus, starGift);
}
public void updateEmojiStatusUntil() {
int currentTimeMillis = (int) (System.currentTimeMillis() / 1000);
Iterator it = this.emojiStatusUntilValues.keySet().iterator();
Long l = null;
while (it.hasNext()) {
if (((Integer) this.emojiStatusUntilValues.get(it.next())).intValue() > currentTimeMillis) {
l = Long.valueOf(Math.min(l == null ? Long.MAX_VALUE : l.longValue(), r5 - currentTimeMillis));
} else {
it.remove();
}
}
if (l == null) {
Runnable runnable = this.recentEmojiStatusUpdateRunnable;
if (runnable != null) {
this.recentEmojiStatusUpdateRunnableTime = -1L;
this.recentEmojiStatusUpdateRunnableTimeout = -1L;
AndroidUtilities.cancelRunOnUIThread(runnable);
return;
}
return;
}
long longValue = l.longValue() + 2;
long j = currentTimeMillis;
if (j + longValue != this.recentEmojiStatusUpdateRunnableTime + this.recentEmojiStatusUpdateRunnableTimeout) {
AndroidUtilities.cancelRunOnUIThread(this.recentEmojiStatusUpdateRunnable);
this.recentEmojiStatusUpdateRunnableTime = j;
this.recentEmojiStatusUpdateRunnableTimeout = longValue;
MessagesController$.ExternalSyntheticLambda362 externalSyntheticLambda362 = new MessagesController$.ExternalSyntheticLambda362(this);
this.recentEmojiStatusUpdateRunnable = externalSyntheticLambda362;
AndroidUtilities.runOnUIThread(externalSyntheticLambda362, longValue * 1000);
}
}
public void updateEmojiStatusUntilUpdate(long j, TLRPC.EmojiStatus emojiStatus) {
int emojiStatusUntil = DialogObject.getEmojiStatusUntil(emojiStatus);
if (emojiStatusUntil != 0) {
this.emojiStatusUntilValues.put(Long.valueOf(j), Integer.valueOf(emojiStatusUntil));
} else if (!this.emojiStatusUntilValues.containsKey(Long.valueOf(j))) {
return;
} else {
this.emojiStatusUntilValues.remove(Long.valueOf(j));
}
updateEmojiStatusUntil();
}
public void updateFilterDialogs(DialogFilter dialogFilter) {
TLRPC.EncryptedChat encryptedChat;
if (dialogFilter == null) {
return;
}
ArrayList arrayList = dialogFilter.dialogs;
ArrayList arrayList2 = dialogFilter.dialogsForward;
arrayList.clear();
arrayList2.clear();
this.sortingDialogFilter = dialogFilter;
try {
Collections.sort(this.allDialogs, this.dialogDateComparator);
} catch (Exception e) {
FileLog.e(e);
}
int size = this.allDialogs.size();
for (int i = 0; i < size; i++) {
TLRPC.Dialog dialog = this.allDialogs.get(i);
if (dialog instanceof TLRPC.TL_dialog) {
long j = dialog.id;
if (DialogObject.isEncryptedDialog(j) && (encryptedChat = getEncryptedChat(Integer.valueOf(DialogObject.getEncryptedChatId(j)))) != null) {
j = encryptedChat.user_id;
}
if (dialogFilter.includesDialog(getAccountInstance(), j, dialog)) {
if (canAddToForward(dialog)) {
arrayList2.add(dialog);
}
arrayList.add(dialog);
}
}
}
try {
Collections.sort(this.allDialogs, this.dialogComparator);
} catch (Exception unused) {
}
}
public boolean updateInterfaceWithMessages(long r27, java.util.ArrayList<org.telegram.messenger.MessageObject> r29, int r30) {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.updateInterfaceWithMessages(long, java.util.ArrayList, int):boolean");
}
public void updatePremium(boolean z) {
if (this.dialogFilters.isEmpty()) {
return;
}
if (z) {
for (int i = 0; i < this.dialogFilters.size(); i++) {
this.dialogFilters.get(i).locked = false;
}
} else {
if (!this.dialogFilters.get(0).isDefault()) {
int i2 = 1;
while (true) {
if (i2 >= this.dialogFilters.size()) {
break;
}
if (this.dialogFilters.get(i2).isDefault()) {
this.dialogFilters.add(0, this.dialogFilters.remove(i2));
break;
}
i2++;
}
}
lockFiltersInternal();
}
getMessagesStorage().saveDialogFiltersOrder();
getNotificationCenter().postNotificationName(NotificationCenter.dialogFiltersUpdated, new Object[0]);
getStoriesController().onPremiumChanged();
}
public void updateSavedReactionTags(long j) {
long j2;
String str;
LongSparseArray longSparseArray = this.reactionTags;
if (longSparseArray == null) {
return;
}
TLRPC.messages_SavedReactionTags messages_savedreactiontags = (TLRPC.TL_messages_savedReactionsTags) longSparseArray.get(j);
if (messages_savedreactiontags == null) {
if (j == 0) {
return;
}
LongSparseArray longSparseArray2 = this.reactionTags;
TLRPC.messages_SavedReactionTags tL_messages_savedReactionsTags = new TLRPC.TL_messages_savedReactionsTags();
longSparseArray2.put(j, tL_messages_savedReactionsTags);
messages_savedreactiontags = tL_messages_savedReactionsTags;
}
Collections.sort(messages_savedreactiontags.tags, new MessagesController$.ExternalSyntheticLambda326(this));
long j3 = 0;
for (int i = 0; i < messages_savedreactiontags.tags.size(); i++) {
TLRPC.TL_savedReactionTag tL_savedReactionTag = (TLRPC.TL_savedReactionTag) messages_savedreactiontags.tags.get(i);
if (tL_savedReactionTag.count > 0) {
TLRPC.TL_reactionEmoji tL_reactionEmoji = tL_savedReactionTag.reaction;
if (tL_reactionEmoji instanceof TLRPC.TL_reactionEmoji) {
j2 = MessagesController$.ExternalSyntheticBackport5.m(Utilities.MD5(tL_reactionEmoji.emoticon).substring(0, 16), 16);
} else {
if (tL_reactionEmoji instanceof TLRPC.TL_reactionCustomEmoji) {
j2 = ((TLRPC.TL_reactionCustomEmoji) tL_reactionEmoji).document_id;
}
if (j == 0 && (tL_savedReactionTag.flags & 1) != 0 && (str = tL_savedReactionTag.title) != null) {
j3 = MediaDataController.calcHash(j3, MessagesController$.ExternalSyntheticBackport6.m(Utilities.MD5(str).substring(0, 16), 16));
}
j3 = MediaDataController.calcHash(j3, tL_savedReactionTag.count);
}
j3 = MediaDataController.calcHash(j3, j2);
if (j == 0) {
j3 = MediaDataController.calcHash(j3, MessagesController$.ExternalSyntheticBackport6.m(Utilities.MD5(str).substring(0, 16), 16));
}
j3 = MediaDataController.calcHash(j3, tL_savedReactionTag.count);
}
}
messages_savedreactiontags.hash = j3;
saveSavedReactionsTags(j, messages_savedreactiontags);
getNotificationCenter().postNotificationName(NotificationCenter.savedReactionTagsUpdate, new Object[]{Long.valueOf(j)});
}
public void updateSavedReactionTags(HashSet<Long> hashSet) {
updateSavedReactionTags(0L);
Iterator<Long> it = hashSet.iterator();
while (it.hasNext()) {
updateSavedReactionTags(it.next().longValue());
}
}
public boolean updateSavedReactionTags(long j, ReactionsLayoutInBubble.VisibleReaction visibleReaction, boolean z, boolean z2) {
if (this.reactionTags == null) {
return false;
}
int i = 0;
boolean z3 = false;
while (i < 2) {
long j2 = i == 0 ? 0L : j;
boolean z4 = true;
if (i != 1 || j2 != 0) {
TLRPC.TL_messages_savedReactionsTags tL_messages_savedReactionsTags = (TLRPC.TL_messages_savedReactionsTags) this.reactionTags.get(j2);
if (tL_messages_savedReactionsTags == null) {
if (j2 != 0) {
LongSparseArray longSparseArray = this.reactionTags;
tL_messages_savedReactionsTags = new TLRPC.TL_messages_savedReactionsTags();
longSparseArray.put(j2, tL_messages_savedReactionsTags);
}
}
int i2 = 0;
boolean z5 = false;
boolean z6 = false;
while (i2 < ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.size()) {
TLRPC.TL_savedReactionTag tL_savedReactionTag = (TLRPC.TL_savedReactionTag) ((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.get(i2);
if (visibleReaction.isSame(tL_savedReactionTag.reaction)) {
int i3 = tL_savedReactionTag.count;
int max = Math.max(0, (z ? 1 : -1) + i3);
tL_savedReactionTag.count = max;
if (max <= 0) {
((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.remove(i2);
i2--;
} else if (max == i3) {
z5 = true;
}
z3 = true;
z5 = true;
z6 = true;
}
i2++;
}
if (z5 || !z) {
z4 = z6;
} else {
TLRPC.TL_savedReactionTag tL_savedReactionTag2 = new TLRPC.TL_savedReactionTag();
tL_savedReactionTag2.reaction = visibleReaction.toTLReaction();
tL_savedReactionTag2.count = 1;
((TLRPC.messages_SavedReactionTags) tL_messages_savedReactionsTags).tags.add(tL_savedReactionTag2);
z3 = true;
}
if (z2 && z4) {
updateSavedReactionTags(j2);
}
i++;
}
i++;
}
return z3;
}
public void updateTimerProc() {
throw new UnsupportedOperationException("Method not decompiled: org.telegram.messenger.MessagesController.updateTimerProc():void");
}
public void updateTranscribeAudioTrialCooldownUntil(int i) {
if (i != this.transcribeAudioTrialCooldownUntil) {
this.transcribeAudioTrialCooldownUntil = i;
this.mainPreferences.edit().putInt("transcribeAudioTrialCooldownUntil", this.transcribeAudioTrialCooldownUntil).apply();
scheduleTranscriptionUpdate();
}
}
public void updateTranscribeAudioTrialCurrentNumber(int i) {
if (i != this.transcribeAudioTrialCurrentNumber) {
this.transcribeAudioTrialCurrentNumber = i;
this.mainPreferences.edit().putInt("transcribeAudioTrialCurrentNumber", this.transcribeAudioTrialCurrentNumber).apply();
}
}
public void updateUsernameActiveness(TLObject tLObject, String str, boolean z) {
if (TextUtils.isEmpty(str)) {
return;
}
this.objectsByUsernames.remove(str);
if (z) {
this.objectsByUsernames.put(str.toLowerCase(), tLObject);
}
}
public void uploadAndApplyUserAvatar(TLRPC.FileLocation fileLocation) {
if (fileLocation == null) {
return;
}
this.uploadingAvatar = FileLoader.getDirectory(4) + "/" + fileLocation.volume_id + "_" + fileLocation.local_id + ".jpg";
getFileLoader().uploadFile(this.uploadingAvatar, false, true, ConnectionsManager.FileTypePhoto);
}
}