Use same MIME type as delta chat

(cherry picked from commit 7b579fdbe06dc786ecdb402a0e3625cd6fa386af)
This commit is contained in:
Stephen Paul Weber 2024-09-11 09:31:07 -05:00 committed by Arne
parent 9ebacc92e5
commit eae1f48249
5 changed files with 5 additions and 5 deletions

View file

@ -2116,7 +2116,7 @@ public class FileBackend {
} else if (audio) {
fileParams.runtime = getMediaRuntime(file);
}
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

@ -941,7 +941,7 @@ public class ConversationFragment extends XmppFragment
return;
}
final String subject = binding.textinputSubject.getText().toString();
if ("application/xdc+zip".equals(type)) newSubThread();
if ("application/webxdc+zip".equals(type)) newSubThread();
final Toast prepareFileToast =
Toast.makeText(getActivity(), getText(R.string.preparing_file), Toast.LENGTH_LONG);
prepareFileToast.show();

View file

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

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

@ -450,7 +450,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;