mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 22:03:54 +00:00
media saved notification is sent only when incoming media are saved
This commit is contained in:
parent
40015c2898
commit
2bce2738b3
@ -353,9 +353,12 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
|||||||
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
|
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
|
||||||
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
|
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
|
||||||
actionMode.finish();
|
actionMode.finish();
|
||||||
// Sending a Data extraction notification
|
// Sending a Data extraction notification (for incoming attachments only)
|
||||||
|
boolean containsIncoming = mediaRecords.parallelStream().anyMatch(m -> !m.isOutgoing());
|
||||||
|
if (containsIncoming) {
|
||||||
sendMediaSavedNotificationIfNeeded();
|
sendMediaSavedNotificationIfNeeded();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}.execute();
|
}.execute();
|
||||||
})
|
})
|
||||||
.execute();
|
.execute();
|
||||||
|
@ -357,8 +357,10 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
|||||||
saveTask.executeOnExecutor(
|
saveTask.executeOnExecutor(
|
||||||
AsyncTask.THREAD_POOL_EXECUTOR,
|
AsyncTask.THREAD_POOL_EXECUTOR,
|
||||||
new Attachment(mediaItem.uri, mediaItem.type, saveDate, null));
|
new Attachment(mediaItem.uri, mediaItem.type, saveDate, null));
|
||||||
// Sending a Data extraction notification
|
// Sending a Data extraction notification (for incoming attachments only)
|
||||||
|
if(!mediaItem.outgoing) {
|
||||||
sendMediaSavedNotificationIfNeeded();
|
sendMediaSavedNotificationIfNeeded();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.execute();
|
.execute();
|
||||||
});
|
});
|
||||||
|
@ -746,8 +746,10 @@ public class ConversationFragment extends Fragment
|
|||||||
if (!Util.isEmpty(attachments)) {
|
if (!Util.isEmpty(attachments)) {
|
||||||
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity());
|
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity());
|
||||||
saveTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, attachments.toArray(new SaveAttachmentTask.Attachment[0]));
|
saveTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, attachments.toArray(new SaveAttachmentTask.Attachment[0]));
|
||||||
// Sending a Data extraction notification
|
// Sending a Data extraction notification (for incoming attachments only)
|
||||||
|
if(!message.isOutgoing()) {
|
||||||
sendMediaSavedNotificationIfNeeded();
|
sendMediaSavedNotificationIfNeeded();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user