Use same MIME type as delta chat

This commit is contained in:
Stephen Paul Weber 2024-09-11 16:31:07 +02:00 committed by Arne
parent ba7c842321
commit 3dbe1d2dc8
7 changed files with 8 additions and 8 deletions

View file

@ -1951,7 +1951,7 @@ public class FileBackend {
// body.append("|0|0|0|") // 3, 4, 5
// .append(getAPK(file, mXmppConnectionService.getApplicationContext())); // 6 TODO: Add apk later again
}
if ("application/xdc+zip".equals(mime)) {
if ("application/webxdc+zip".equals(mime)) {
try {
final var zip = new ZipFile(file);
final ZipEntry manifestEntry = zip == null ? null : zip.getEntry("manifest.toml");

View file

@ -1308,7 +1308,7 @@ public class ConversationFragment extends XmppFragment
if (conversation == null) {
return;
}
if (Objects.equals(type, "application/xdc+zip")) newSubThread();
if (Objects.equals(type, "application/webxdc+zip")) newSubThread();
final String subject = binding.textinputSubject.getText().toString();
final Toast prepareFileToast = ToastCompat.makeText(getActivity(), getText(R.string.preparing_file), ToastCompat.LENGTH_SHORT);
activity.delegateUriPermissionsToService(uri);
@ -1692,7 +1692,7 @@ public class ConversationFragment extends XmppFragment
} else if (attachment.getType() == Attachment.Type.IMAGE) {
Log.d(Config.LOGTAG, "ConversationsActivity.commitAttachments() - attaching image to conversations. CHOOSE_IMAGE");
attachImageToConversation(conversation, attachment.getUri(), attachment.getMime());
} else if (attachment.getMime() != null && attachment.getMime().equals("application/xdc+zip")) {
} else if (attachment.getMime() != null && attachment.getMime().equals("application/webxdc+zip")) {
Log.d(Config.LOGTAG, "ConversationsActivity.commitAttachments() - attaching WebXDC to conversations. CHOOSE_FILE");
newSubThread();
if (conversation.getNextEncryption() == Message.ENCRYPTION_AXOLOTL || conversation.getNextEncryption() == Message.ENCRYPTION_PGP || conversation.getNextEncryption() == Message.ENCRYPTION_OTR) {

View file

@ -102,7 +102,7 @@ public class MediaAdapter extends RecyclerView.Adapter<MediaAdapter.MediaViewHol
attr = R.attr.media_preview_archive;
} else if (mime.equals("application/epub+zip") || mime.equals("application/vnd.amazon.mobi8-ebook")) {
attr = R.attr.media_preview_ebook;
} else if (mime.equals("application/xdc+zip")) {
} else if (mime.equals("application/webxdc+zip")) {
attr = R.attr.icon_webxdcs;
} else if (mime.equals(ExportBackupService.MIME_TYPE)) {
attr = R.attr.media_preview_backup;

View file

@ -1728,7 +1728,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
displayMediaPreviewMessage(viewHolder, message, darkBackground, type);
} else if (message.getFileParams().runtime > 0 && (message.getFileParams().width == 0 && message.getFileParams().height == 0)) {
displayAudioMessage(viewHolder, message, darkBackground, type);
} else if ("application/xdc+zip".equals(message.getFileParams().getMediaType()) && message.getConversation() instanceof Conversation && !message.getFileParams().getCids().isEmpty()) {
} else if ("application/webxdc+zip".equals(message.getFileParams().getMediaType()) && message.getConversation() instanceof Conversation && !message.getFileParams().getCids().isEmpty()) {
displayWebxdcMessage(viewHolder, message, darkBackground, type);
} else {
displayOpenableMessage(viewHolder, message, darkBackground, type);

View file

@ -76,7 +76,7 @@ public class ViewUtil {
try {
context.startActivity(openIntent);
} catch (final ActivityNotFoundException e) {
if (mime.equals("application/xdc+zip")) {
if (mime.equals("application/webxdc+zip")) {
Toast.makeText(context, R.string.webxdc_hint, Toast.LENGTH_LONG).show();
} else {
ToastCompat.makeText(context, R.string.no_application_found_to_open_file, ToastCompat.LENGTH_SHORT).show();

View file

@ -237,7 +237,7 @@ public final class MimeUtils {
add("application/x-x509-server-cert", "crt");
add("application/x-xcf", "xcf");
add("application/x-xfig", "fig");
add("application/xdc+zip", "xdc");
add("application/webxdc+zip", "xdc");
add("application/xhtml+xml", "xhtml");
add("video/3gpp", "3gpp");
add("video/3gpp", "3gp");

View file

@ -582,7 +582,7 @@ public class UIHelper {
return context.getString(R.string.ebook);
} else if (mime.equals("application/gpx+xml")) {
return context.getString(R.string.gpx_track);
} else if (mime.equals("application/xdc+zip")) {
} else if (mime.equals("application/webxdc+zip")) {
final var name = message.getFileParams().getName();
if (name != null && name.length() < 20) {
return name;