mirror of https://github.com/M66B/FairEmail.git
parent
431809f164
commit
6a15b4000d
|
@ -124,8 +124,6 @@ import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
|
|||
import static javax.mail.Folder.READ_WRITE;
|
||||
|
||||
class Core {
|
||||
static final Map<Long, EntityFolder> newMessages = new HashMap<>();
|
||||
|
||||
private static final int MAX_NOTIFICATION_COUNT = 25; // per group
|
||||
private static final long AFTER_SEND_DELAY = 15 * 1000L; // milliseconds
|
||||
private static final int SYNC_CHUNCK_SIZE = 200;
|
||||
|
@ -2305,10 +2303,6 @@ class Core {
|
|||
|
||||
// Prepare scroll to top
|
||||
if (!message.ui_seen && message.received > account.created) {
|
||||
synchronized (newMessages) {
|
||||
newMessages.put(folder.id, folder);
|
||||
}
|
||||
|
||||
Intent report = new Intent(FragmentMessages.ACTION_NEW_MESSAGE);
|
||||
report.putExtra("folder", folder.id);
|
||||
report.putExtra("unified", folder.unified);
|
||||
|
|
|
@ -3785,8 +3785,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
if (handleThreadActions(messages))
|
||||
return;
|
||||
|
||||
checkNewMessages();
|
||||
|
||||
Log.i("Submit messages=" + messages.size());
|
||||
adapter.submitList(messages);
|
||||
|
||||
|
@ -4512,10 +4510,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
long fid = intent.getLongExtra("folder", -1);
|
||||
boolean unified = intent.getBooleanExtra("unified", false);
|
||||
|
||||
synchronized (Core.newMessages) {
|
||||
Core.newMessages.remove(fid);
|
||||
}
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean autoscroll = prefs.getBoolean("autoscroll", true);
|
||||
|
||||
|
@ -4525,27 +4519,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
adapter.gotoTop();
|
||||
}
|
||||
|
||||
private void checkNewMessages() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean autoscroll = prefs.getBoolean("autoscroll", true);
|
||||
|
||||
boolean newMessages = false;
|
||||
synchronized (Core.newMessages) {
|
||||
for (long fid : new ArrayList<>(Core.newMessages.keySet())) {
|
||||
EntityFolder f = Core.newMessages.get(fid);
|
||||
if (f != null &&
|
||||
((viewType == AdapterMessage.ViewType.UNIFIED && f.unified) ||
|
||||
(viewType == AdapterMessage.ViewType.FOLDER && folder == f.id))) {
|
||||
newMessages = true;
|
||||
Core.newMessages.remove(fid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (autoscroll && newMessages)
|
||||
adapter.gotoTop();
|
||||
}
|
||||
|
||||
private void onStoreRaw(Intent intent) {
|
||||
message = intent.getLongExtra("id", -1);
|
||||
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
||||
|
|
Loading…
Reference in New Issue