mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
missed case for sending media saved notification
This commit is contained in:
parent
9d82b4b7a9
commit
2ca8b1acb1
@ -52,6 +52,8 @@ import androidx.viewpager.widget.ViewPager;
|
||||
import com.codewaves.stickyheadergrid.StickyHeaderGridLayoutManager;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import org.session.libsession.messaging.messages.control.DataExtractionNotification;
|
||||
import org.session.libsession.messaging.sending_receiving.MessageSender;
|
||||
import org.session.libsession.messaging.threads.Address;
|
||||
import org.thoughtcrime.securesms.database.CursorRecyclerViewAdapter;
|
||||
import org.thoughtcrime.securesms.database.MediaDatabase;
|
||||
@ -351,6 +353,8 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
|
||||
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
|
||||
actionMode.finish();
|
||||
// Sending a Data extraction notification
|
||||
sendMediaSavedNotificationIfNeeded();
|
||||
}
|
||||
}.execute();
|
||||
})
|
||||
@ -358,6 +362,14 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
}, mediaRecords.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, recipient.getAddress());
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private void handleDeleteMedia(@NonNull Collection<MediaDatabase.MediaRecord> mediaRecords) {
|
||||
int recordCount = mediaRecords.size();
|
||||
|
@ -362,6 +362,9 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, conversationRecipient.getAddress());
|
||||
|
@ -760,6 +760,9 @@ public class ConversationFragment extends Fragment
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a MediaSaved notification to the recipient
|
||||
*/
|
||||
private void sendMediaSavedNotificationIfNeeded() {
|
||||
DataExtractionNotification message = new DataExtractionNotification(new DataExtractionNotification.Kind.MediaSaved(System.currentTimeMillis()));
|
||||
MessageSender.send(message, recipient.getAddress());
|
||||
|
Loading…
Reference in New Issue
Block a user