mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Remove always-empty-objects.
This commit is contained in:
@@ -29,15 +29,9 @@ import android.content.SharedPreferences;
|
||||
import com.b44t.ui.SettingsAdvActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class MessagesController implements NotificationCenter.NotificationCenterDelegate {
|
||||
|
||||
public ConcurrentHashMap<Long, TLRPC.TL_dialog> dialogs_dict = new ConcurrentHashMap<>(100, 1.0f, 2);
|
||||
public HashMap<Long, MessageObject> dialogMessage = new HashMap<>();
|
||||
public HashMap<Long, CharSequence> printingStrings = new HashMap<>();
|
||||
|
||||
private String uploadingAvatar = null;
|
||||
|
||||
public int fontSize;
|
||||
@@ -48,8 +42,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
|
||||
public static final int UPDATE_MASK_CHAT_AVATAR = 8;
|
||||
public static final int UPDATE_MASK_CHAT_NAME = 16;
|
||||
public static final int UPDATE_MASK_CHAT_MEMBERS = 32;
|
||||
public static final int UPDATE_MASK_USER_PRINT = 64;
|
||||
public static final int UPDATE_MASK_READ_DIALOG_MESSAGE = 256;
|
||||
public static final int UPDATE_MASK_SELECT_DIALOG = 512;
|
||||
public static final int UPDATE_MASK_NEW_MESSAGE = 2048;
|
||||
public static final int UPDATE_MASK_SEND_STATE = 4096;
|
||||
|
||||
@@ -70,7 +70,6 @@ public class NotificationsController {
|
||||
private HashMap<Long, Integer> autoNotificationsIds = new HashMap<>();
|
||||
private int wearNotificationId = 10000;
|
||||
private int autoNotificationId = 20000;
|
||||
public ArrayList<MessageObject> popupMessages = new ArrayList<>();
|
||||
private long opened_dialog_id = 0;
|
||||
private int total_unread_count = 0;
|
||||
private int personal_count = 0;
|
||||
@@ -935,7 +934,7 @@ public class NotificationsController {
|
||||
}
|
||||
}
|
||||
|
||||
private void scheduleNotificationDelay(boolean onlineReason) {
|
||||
/*private void scheduleNotificationDelay(boolean onlineReason) {
|
||||
try {
|
||||
FileLog.e("messenger", "delay notification start, onlineReason = " + onlineReason);
|
||||
notificationDelayWakelock.acquire(10000);
|
||||
@@ -945,7 +944,7 @@ public class NotificationsController {
|
||||
FileLog.e("messenger", e);
|
||||
showOrUpdateNotification(notifyCheck);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
protected void repeatNotificationMaybe() {
|
||||
notificationsQueue.postRunnable(new Runnable() {
|
||||
|
||||
@@ -41,7 +41,6 @@ public class TLRPC {
|
||||
}
|
||||
|
||||
public static class ChatPhoto extends TLObject {
|
||||
public FileLocation photo_small;
|
||||
public FileLocation photo_big;
|
||||
}
|
||||
|
||||
@@ -107,16 +106,6 @@ public class TLRPC {
|
||||
public static class TL_messageMediaPhoto extends MessageMedia {
|
||||
}
|
||||
|
||||
public static class PeerNotifySettings extends TLObject {
|
||||
public int flags;
|
||||
public boolean silent;
|
||||
public int mute_until;
|
||||
public String sound;
|
||||
}
|
||||
|
||||
public static class TL_peerNotifySettings extends PeerNotifySettings {
|
||||
}
|
||||
|
||||
public static class TL_messages_stickerSet extends TLObject {
|
||||
public StickerSet set;
|
||||
public ArrayList<Document> documents = new ArrayList<>();
|
||||
@@ -361,7 +350,6 @@ public class TLRPC {
|
||||
public Peer peer;
|
||||
public int top_message;
|
||||
public int unread_count;
|
||||
public PeerNotifySettings notify_settings;
|
||||
public int pts;
|
||||
public DraftMessage draft;
|
||||
public long id; //custom
|
||||
|
||||
@@ -80,10 +80,9 @@ public class DialogCell extends BaseCell {
|
||||
private long currentDialogId;
|
||||
private final boolean isDialogCell = true; // if it is no dialog cell, it is a search cell ...
|
||||
private int unreadCount;
|
||||
private boolean lastUnreadState;
|
||||
private int lastSendState;
|
||||
private boolean dialogMuted;
|
||||
private MessageObject message;
|
||||
private final MessageObject message = null;
|
||||
private int index;
|
||||
|
||||
private ImageReceiver avatarImage;
|
||||
@@ -91,7 +90,6 @@ public class DialogCell extends BaseCell {
|
||||
|
||||
private TLRPC.User user = null;
|
||||
private TLRPC.Chat chat = null;
|
||||
private CharSequence lastPrintString = null;
|
||||
|
||||
public boolean useSeparator = false;
|
||||
|
||||
@@ -534,7 +532,7 @@ public class DialogCell extends BaseCell {
|
||||
public void checkCurrentDialogIndex() {
|
||||
if (index < MrMailbox.m_currChatlist.getCnt()) { // EDIT BY MR - was: index < getDialogsArray().size()
|
||||
TLRPC.TL_dialog dialog = MrMailbox.m_currChatlist.get_TLRPC_TL_dialog(index); // EDIT BY MR - was: getDialogsArray().get(index);
|
||||
MessageObject newMessageObject = MessagesController.getInstance().dialogMessage.get(dialog.id);
|
||||
final MessageObject newMessageObject = null;
|
||||
if (currentDialogId != dialog.id ||
|
||||
message != null && message.getId() != dialog.top_message ||
|
||||
unreadCount != dialog.unread_count ||
|
||||
@@ -553,14 +551,6 @@ public class DialogCell extends BaseCell {
|
||||
|
||||
if (mask != 0) {
|
||||
boolean continueUpdate = false;
|
||||
if (isDialogCell) {
|
||||
if ((mask & MessagesController.UPDATE_MASK_USER_PRINT) != 0) {
|
||||
CharSequence printString = MessagesController.getInstance().printingStrings.get(currentDialogId);
|
||||
if (lastPrintString != null && printString == null || lastPrintString == null && printString != null || lastPrintString != null && printString != null && !lastPrintString.equals(printString)) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_AVATAR) != 0) {
|
||||
if (chat == null) {
|
||||
continueUpdate = true;
|
||||
@@ -581,18 +571,6 @@ public class DialogCell extends BaseCell {
|
||||
continueUpdate = true;
|
||||
}
|
||||
}
|
||||
if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_READ_DIALOG_MESSAGE) != 0) {
|
||||
if (message != null && lastUnreadState != message.isUnread()) {
|
||||
lastUnreadState = message.isUnread();
|
||||
continueUpdate = true;
|
||||
} else if (isDialogCell) {
|
||||
TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(currentDialogId);
|
||||
if (dialog != null && unreadCount != dialog.unread_count) {
|
||||
unreadCount = dialog.unread_count;
|
||||
continueUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_SEND_STATE) != 0) {
|
||||
if (message != null && lastSendState != message.messageOwner.send_state) {
|
||||
lastSendState = message.messageOwner.send_state;
|
||||
|
||||
@@ -1908,9 +1908,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
checkAndUpdateAvatar();
|
||||
updateVisibleRows();
|
||||
}
|
||||
if ((updateMask & MessagesController.UPDATE_MASK_USER_PRINT) != 0) {
|
||||
updateSubtitle = true;
|
||||
}
|
||||
if (avatarContainer != null && updateSubtitle) {
|
||||
avatarContainer.updateSubtitle();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.MessagesController;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.NotificationsController;
|
||||
@@ -56,7 +55,6 @@ import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.ConnectionsManager;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.Adapters.BaseFragmentAdapter;
|
||||
import com.b44t.ui.Cells.HeaderCell;
|
||||
@@ -211,13 +209,13 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
|
||||
}*/
|
||||
//MessagesStorage.getInstance().setDialogFlags(dialog_id, which == 2 ? 1 : 0);
|
||||
editor.apply();
|
||||
TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id);
|
||||
/*TLRPC.TL_dialog dialog = MessagesController.getInstance().dialogs_dict.get(dialog_id);
|
||||
if (dialog != null) {
|
||||
dialog.notify_settings = new TLRPC.TL_peerNotifySettings();
|
||||
if (which == 2) {
|
||||
dialog.notify_settings.mute_until = Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if (listView != null) {
|
||||
listView.invalidateViews();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user