mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #1667 from deltachat/remove-dead-code
remove dead code
This commit is contained in:
@@ -152,10 +152,6 @@ public class DcMsg {
|
||||
return getFromId() == DcContact.DC_CONTACT_ID_SELF;
|
||||
}
|
||||
|
||||
public boolean isGroupAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getDisplayBody() {
|
||||
return getText();
|
||||
}
|
||||
@@ -174,21 +170,12 @@ public class DcMsg {
|
||||
public boolean isPreparing() {
|
||||
return getState() == DC_STATE_OUT_PREPARING;
|
||||
}
|
||||
public long getExpiresIn() {
|
||||
return -1; // never.
|
||||
}
|
||||
public long getExpireStarted() {
|
||||
return 0;
|
||||
}
|
||||
public boolean isSecure() {
|
||||
return showPadlock()!=0;
|
||||
}
|
||||
public boolean isPending() {
|
||||
return getState() == DC_STATE_OUT_PENDING;
|
||||
}
|
||||
public boolean isMediaPending() {
|
||||
return isPending();
|
||||
}
|
||||
public boolean isDelivered() {
|
||||
return getState() == DC_STATE_OUT_DELIVERED;
|
||||
}
|
||||
@@ -198,17 +185,7 @@ public class DcMsg {
|
||||
public boolean isSeen() {
|
||||
return getState() == DC_STATE_IN_SEEN;
|
||||
}
|
||||
public boolean isMms() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// the following are probably system messages in delta-land
|
||||
public boolean isJoined() { return false; }
|
||||
public boolean isExpirationTimerUpdate() { return false; }
|
||||
public boolean isEndSession() { return false; }
|
||||
public boolean isIdentityUpdate() { return false; }
|
||||
public boolean isIdentityVerified() { return false; }
|
||||
public boolean isIdentityDefault() { return false; }
|
||||
|
||||
// working with raw c-data
|
||||
private long msgCPtr; // CAVE: the name is referenced in the JNI
|
||||
|
||||
@@ -47,10 +47,6 @@ public class AudioSlide extends Slide {
|
||||
super(context, new UriAttachment(uri, null, contentType, AttachmentDatabase.TRANSFER_PROGRESS_STARTED, dataSize, 0, 0, null, null, voiceNote));
|
||||
}
|
||||
|
||||
public AudioSlide(Context context, Attachment attachment) {
|
||||
super(context, attachment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Uri getThumbnailUri() {
|
||||
|
||||
@@ -14,12 +14,8 @@ import org.thoughtcrime.securesms.util.StorageUtil;
|
||||
|
||||
public class DocumentSlide extends Slide {
|
||||
|
||||
public DocumentSlide(@NonNull Context context, @NonNull Attachment attachment) {
|
||||
super(context, attachment);
|
||||
}
|
||||
|
||||
public DocumentSlide(Context context, DcMsg dcMsg) {
|
||||
this(context, new DcAttachment(dcMsg));
|
||||
super(context, new DcAttachment(dcMsg));
|
||||
dcMsgId = dcMsg.getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,6 @@ public class GifSlide extends ImageSlide {
|
||||
super(context, dcMsg);
|
||||
}
|
||||
|
||||
public GifSlide(Context context, Attachment attachment) {
|
||||
super(context, attachment);
|
||||
}
|
||||
|
||||
public GifSlide(Context context, Uri uri, long size, int width, int height) {
|
||||
super(context, constructAttachmentFromUri(context, uri, MediaUtil.IMAGE_GIF, size, width, height, uri, null, false));
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.thoughtcrime.securesms.mms;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.b44t.messenger.DcMsg;
|
||||
|
||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||
|
||||
public class MmsSlide extends ImageSlide {
|
||||
|
||||
public MmsSlide(@NonNull Context context, @NonNull DcMsg dcMsg) {
|
||||
super(context, dcMsg);
|
||||
}
|
||||
|
||||
public MmsSlide(@NonNull Context context, @NonNull Attachment attachment) {
|
||||
super(context, attachment);
|
||||
}
|
||||
}
|
||||
@@ -49,10 +49,6 @@ public class VideoSlide extends Slide {
|
||||
dcMsgId = dcMsg.getId();
|
||||
}
|
||||
|
||||
public VideoSlide(Context context, Attachment attachment) {
|
||||
super(context, attachment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPlayOverlay() {
|
||||
return true;
|
||||
|
||||
@@ -16,14 +16,12 @@ import com.b44t.messenger.DcMsg;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
||||
|
||||
import org.thoughtcrime.securesms.attachments.Attachment;
|
||||
import org.thoughtcrime.securesms.mms.AudioSlide;
|
||||
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
||||
import org.thoughtcrime.securesms.mms.DocumentSlide;
|
||||
import org.thoughtcrime.securesms.mms.GifSlide;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.mms.ImageSlide;
|
||||
import org.thoughtcrime.securesms.mms.MmsSlide;
|
||||
import org.thoughtcrime.securesms.mms.PartAuthority;
|
||||
import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.mms.VideoSlide;
|
||||
@@ -66,29 +64,6 @@ public class MediaUtil {
|
||||
return slide;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getSlideForMsg instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static Slide getSlideForAttachment(Context context, Attachment attachment) {
|
||||
Slide slide = null;
|
||||
if (isGif(attachment.getContentType())) {
|
||||
slide = new GifSlide(context, attachment);
|
||||
} else if (isImageType(attachment.getContentType())) {
|
||||
slide = new ImageSlide(context, attachment);
|
||||
} else if (isVideoType(attachment.getContentType())) {
|
||||
slide = new VideoSlide(context, attachment);
|
||||
} else if (isAudioType(attachment.getContentType())) {
|
||||
slide = new AudioSlide(context, attachment);
|
||||
} else if (isMms(attachment.getContentType())) {
|
||||
slide = new MmsSlide(context, attachment);
|
||||
} else if (attachment.getContentType() != null) {
|
||||
slide = new DocumentSlide(context, attachment);
|
||||
}
|
||||
|
||||
return slide;
|
||||
}
|
||||
|
||||
public static @Nullable String getMimeType(Context context, Uri uri) {
|
||||
if (uri == null) return null;
|
||||
|
||||
@@ -192,10 +167,6 @@ public class MediaUtil {
|
||||
return dimens;
|
||||
}
|
||||
|
||||
public static boolean isMms(String contentType) {
|
||||
return !TextUtils.isEmpty(contentType) && contentType.trim().equals("application/mms");
|
||||
}
|
||||
|
||||
public static boolean isVideo(String contentType) {
|
||||
return !TextUtils.isEmpty(contentType) && contentType.trim().startsWith("video/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user