Persist notifying messages

This commit is contained in:
M66B
2019-07-06 10:16:42 +02:00
parent 828d936325
commit dd3d92d61f
7 changed files with 1892 additions and 39 deletions

View File

@@ -165,12 +165,12 @@ public class ServiceSynchronize extends LifecycleService {
});
db.message().liveUnseenNotify().observe(cowner, new Observer<List<TupleMessageEx>>() {
private Map<String, List<Long>> notifying = new HashMap<>();
@Override
public void onChanged(List<TupleMessageEx> messages) {
try {
Core.notifyMessages(ServiceSynchronize.this, notifying, messages);
if (messages == null)
messages = new ArrayList<>();
Core.notifyMessages(ServiceSynchronize.this, messages);
} catch (SecurityException ex) {
Log.w(ex);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ServiceSynchronize.this);