mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-12 01:31:58 +00:00
hook up sending pipeline & clean
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.gms.common.util.IOUtils;
|
||||
|
||||
import org.session.libsession.messaging.sending_receiving.attachments.AttachmentTransferProgress;
|
||||
import org.session.libsession.utilities.MediaTypes;
|
||||
import org.thoughtcrime.securesms.ApplicationContext;
|
||||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
@@ -192,7 +193,7 @@ public class LinkPreviewRepository implements InjectableType {
|
||||
return Optional.of(new UriAttachment(uri,
|
||||
uri,
|
||||
contentType,
|
||||
AttachmentDatabase.TRANSFER_PROGRESS_STARTED,
|
||||
AttachmentTransferProgress.TRANSFER_PROGRESS_STARTED,
|
||||
bytes.length,
|
||||
bitmap.getWidth(),
|
||||
bitmap.getHeight(),
|
||||
|
||||
@@ -43,13 +43,13 @@ public class LinkPreviewViewModel extends ViewModel {
|
||||
return linkPreviewState.getValue() != null && linkPreviewState.getValue().getLinkPreview().isPresent();
|
||||
}
|
||||
|
||||
public @NonNull List<LinkPreview> getActiveLinkPreviews() {
|
||||
public Optional<LinkPreview> getActiveLinkPreview() {
|
||||
final LinkPreviewState state = linkPreviewState.getValue();
|
||||
|
||||
if (state == null || !state.getLinkPreview().isPresent()) {
|
||||
return Collections.emptyList();
|
||||
return Optional.absent();
|
||||
} else {
|
||||
return Collections.singletonList(state.getLinkPreview().get());
|
||||
return state.getLinkPreview();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user