mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Merge branch 'dev' into ui
This commit is contained in:
commit
d20f81bd2e
@ -353,11 +353,9 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
|
||||
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
|
||||
actionMode.finish();
|
||||
// Sending a Data extraction notification (for incoming attachments only)
|
||||
boolean containsIncoming = mediaRecords.parallelStream().anyMatch(m -> !m.isOutgoing());
|
||||
if (containsIncoming) {
|
||||
//TODO uncomment line below when Data extraction will be activated
|
||||
//sendMediaSavedNotificationIfNeeded();
|
||||
sendMediaSavedNotificationIfNeeded();
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
@ -366,11 +364,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
}, mediaRecords.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
// we don't send media saved notification for groups
|
||||
if (recipient.isGroupRecipient()) return;
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, recipient.getAddress());
|
||||
|
@ -39,8 +39,7 @@ import android.view.Window;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import org.session.libsession.messaging.messages.control.DataExtractionNotification;
|
||||
import org.session.libsession.messaging.sending_receiving.MessageSender;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
@ -53,11 +52,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import org.session.libsession.messaging.messages.control.DataExtractionNotification;
|
||||
import org.session.libsession.messaging.sending_receiving.MessageSender;
|
||||
import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAttachment;
|
||||
import org.session.libsession.utilities.Address;
|
||||
import org.session.libsession.utilities.Util;
|
||||
import org.session.libsession.utilities.recipients.Recipient;
|
||||
import org.session.libsession.utilities.recipients.RecipientModifiedListener;
|
||||
import org.session.libsession.utilities.Util;
|
||||
import org.session.libsignal.utilities.Log;
|
||||
import org.thoughtcrime.securesms.components.MediaView;
|
||||
import org.thoughtcrime.securesms.database.MediaDatabase.MediaRecord;
|
||||
@ -352,21 +354,15 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
saveTask.executeOnExecutor(
|
||||
AsyncTask.THREAD_POOL_EXECUTOR,
|
||||
new Attachment(mediaItem.uri, mediaItem.type, saveDate, null));
|
||||
// Sending a Data extraction notification (for incoming attachments only)
|
||||
if(!mediaItem.outgoing) {
|
||||
//TODO uncomment line below when Data extraction will be activated
|
||||
//sendMediaSavedNotificationIfNeeded();
|
||||
if (!mediaItem.outgoing) {
|
||||
sendMediaSavedNotificationIfNeeded();
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
// we don't send media saved notification for groups
|
||||
if (conversationRecipient.isGroupRecipient()) return;
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, conversationRecipient.getAddress());
|
||||
|
@ -737,10 +737,8 @@ public class ConversationFragment extends Fragment
|
||||
if (!Util.isEmpty(attachments)) {
|
||||
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity());
|
||||
saveTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, attachments.toArray(new SaveAttachmentTask.Attachment[0]));
|
||||
// Sending a Data extraction notification (for incoming attachments only)
|
||||
if(!message.isOutgoing()) {
|
||||
//TODO uncomment line below when Data extraction will be activated
|
||||
//sendMediaSavedNotificationIfNeeded();
|
||||
if (!message.isOutgoing()) {
|
||||
sendMediaSavedNotificationIfNeeded();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -754,11 +752,7 @@ public class ConversationFragment extends Fragment
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
// we don't send media saved notification for groups
|
||||
if (recipient.isGroupRecipient()) return;
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, recipient.getAddress());
|
||||
|
Loading…
x
Reference in New Issue
Block a user