|
|
@ -3751,6 +3751,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
if (handleThreadActions(messages))
|
|
|
|
if (handleThreadActions(messages))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkNewMessages();
|
|
|
|
|
|
|
|
|
|
|
|
Log.i("Submit messages=" + messages.size());
|
|
|
|
Log.i("Submit messages=" + messages.size());
|
|
|
|
adapter.submitList(messages);
|
|
|
|
adapter.submitList(messages);
|
|
|
|
|
|
|
|
|
|
|
@ -4476,6 +4478,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
long fid = intent.getLongExtra("folder", -1);
|
|
|
|
long fid = intent.getLongExtra("folder", -1);
|
|
|
|
boolean unified = intent.getBooleanExtra("unified", false);
|
|
|
|
boolean unified = intent.getBooleanExtra("unified", false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
synchronized (Core.newMessages) {
|
|
|
|
|
|
|
|
Core.newMessages.remove(fid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
boolean autoscroll = prefs.getBoolean("autoscroll", true);
|
|
|
|
boolean autoscroll = prefs.getBoolean("autoscroll", true);
|
|
|
|
|
|
|
|
|
|
|
@ -4485,6 +4491,27 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
adapter.gotoTop();
|
|
|
|
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) {
|
|
|
|
private void onStoreRaw(Intent intent) {
|
|
|
|
message = intent.getLongExtra("id", -1);
|
|
|
|
message = intent.getLongExtra("id", -1);
|
|
|
|
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
|
|
|
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
|
|
|