mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Update note to self sending flow.
This commit is contained in:
@@ -118,22 +118,7 @@ class MediaSelectionRepository(context: Context) {
|
||||
StoryType.NONE
|
||||
}
|
||||
|
||||
if (MessageSender.isLocalSelfSend(context, singleRecipient, SendType.SIGNAL)) {
|
||||
Log.i(TAG, "Local self-send. Skipping pre-upload.")
|
||||
emitter.onSuccess(
|
||||
MediaSendActivityResult(
|
||||
recipientId = singleRecipient!!.id,
|
||||
nonUploadedMedia = updatedMedia,
|
||||
body = trimmedBody,
|
||||
messageSendType = sendType,
|
||||
isViewOnce = isViewOnce,
|
||||
mentions = trimmedMentions,
|
||||
bodyRanges = trimmedBodyRanges,
|
||||
storyType = StoryType.NONE,
|
||||
scheduledTime = scheduledTime
|
||||
)
|
||||
)
|
||||
} else if (scheduledTime != -1L && storyType == StoryType.NONE) {
|
||||
if (scheduledTime != -1L && storyType == StoryType.NONE) {
|
||||
Log.i(TAG, "Scheduled message. Skipping pre-upload.")
|
||||
if (contacts.isEmpty()) {
|
||||
emitter.onSuccess(
|
||||
@@ -261,10 +246,6 @@ class MediaSelectionRepository(context: Context) {
|
||||
uploadRepository.deleteAbandonedAttachments()
|
||||
}
|
||||
|
||||
fun isLocalSelfSend(recipient: Recipient?): Boolean {
|
||||
return MessageSender.isLocalSelfSend(context, recipient, SendType.SIGNAL)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun buildModelsToTransform(
|
||||
selectedMedia: List<Media>,
|
||||
|
||||
@@ -107,7 +107,7 @@ class MediaSelectionViewModel(
|
||||
store.update {
|
||||
it.copy(
|
||||
isMeteredConnection = metered,
|
||||
isPreUploadEnabled = shouldPreUpload(metered, it.recipient)
|
||||
isPreUploadEnabled = shouldPreUpload(metered)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class MediaSelectionViewModel(
|
||||
store.update(Recipient.live(recipientSearchKey.recipientId).liveData) { r, s ->
|
||||
s.copy(
|
||||
recipient = r,
|
||||
isPreUploadEnabled = shouldPreUpload(s.isMeteredConnection, r)
|
||||
isPreUploadEnabled = shouldPreUpload(s.isMeteredConnection)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -449,8 +449,8 @@ class MediaSelectionViewModel(
|
||||
repository.uploadRepository.cancelUpload(media)
|
||||
}
|
||||
|
||||
private fun shouldPreUpload(metered: Boolean, recipient: Recipient?): Boolean {
|
||||
return !metered && !repository.isLocalSelfSend(recipient)
|
||||
private fun shouldPreUpload(metered: Boolean): Boolean {
|
||||
return !metered
|
||||
}
|
||||
|
||||
fun onSaveState(outState: Bundle) {
|
||||
|
||||
Reference in New Issue
Block a user