diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java
index e51ebb8a2f..3381594e89 100644
--- a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java
+++ b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java
@@ -94,6 +94,8 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import xyz.nextalone.nagram.NaConfig;
+
public class SendMessagesHelper extends BaseController implements NotificationCenter.NotificationCenterDelegate {
public static final int MEDIA_TYPE_DICE = 11;
@@ -8137,7 +8139,7 @@ public static void prepareSendingMedia(AccountInstance accountInstance, ArrayLis
videoEditedInfo = info.videoEditedInfo != null ? info.videoEditedInfo : createCompressionSettings(info.path);
}
- if (!forceDocument && (videoEditedInfo != null || info.path.endsWith("mp4"))) {
+ if (NaConfig.INSTANCE.getSendMp4DocumentAsVideo().Bool() || (!forceDocument && (videoEditedInfo != null || info.path.endsWith("mp4")))) {
if (info.path == null && info.searchImage != null) {
if (info.searchImage.photo instanceof TLRPC.TL_photo) {
info.path = FileLoader.getInstance(accountInstance.getCurrentAccount()).getPathToAttach(info.searchImage.photo, true).getAbsolutePath();
@@ -8206,6 +8208,12 @@ public static void prepareSendingMedia(AccountInstance accountInstance, ArrayLis
attributeVideo.supports_streaming = true;
}
document.attributes.add(attributeVideo);
+
+ // na: Fix filename
+ TLRPC.TL_documentAttributeFilename fileName = new TLRPC.TL_documentAttributeFilename();
+ fileName.file_name = new File(path).getName();
+ document.attributes.add(fileName);
+
if (videoEditedInfo != null && (videoEditedInfo.needConvert() || !info.isVideo)) {
if (info.isVideo && videoEditedInfo.muted) {
fillVideoAttribute(info.path, attributeVideo, videoEditedInfo);
@@ -8891,6 +8899,12 @@ public static void prepareSendingVideo(AccountInstance accountInstance, String v
}
attributeVideo.round_message = isRound;
document.attributes.add(attributeVideo);
+
+ // na: Fix filename
+ TLRPC.TL_documentAttributeFilename fileName = new TLRPC.TL_documentAttributeFilename();
+ fileName.file_name = new File(path).getName();
+ document.attributes.add(fileName);
+
if (videoEditedInfo != null && videoEditedInfo.notReadyYet) {
attributeVideo.w = videoEditedInfo.resultWidth;
attributeVideo.h = videoEditedInfo.resultHeight;
diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoExperimentalSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoExperimentalSettingsActivity.java
index 5221376451..571654882a 100644
--- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoExperimentalSettingsActivity.java
+++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoExperimentalSettingsActivity.java
@@ -100,6 +100,7 @@ public class NekoExperimentalSettingsActivity extends BaseNekoXSettingsActivity
private final AbstractConfigCell customArtworkApiRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomArtworkApi(), "", null));
private final AbstractConfigCell fakeHighPerformanceDeviceRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getFakeHighPerformanceDevice()));
private final AbstractConfigCell disableEmojiDrawLimitRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableEmojiDrawLimit()));
+ private final AbstractConfigCell sendMp4DocumentAsVideoRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getSendMp4DocumentAsVideo()));
private final AbstractConfigCell divider1 = cellGroup.appendCell(new ConfigCellDivider());
private final AbstractConfigCell header3 = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString(R.string.ExternalStickerCache)));
diff --git a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
index fe10945263..de602f185e 100644
--- a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
+++ b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
@@ -566,6 +566,12 @@ object NaConfig {
ConfigItem.configTypeString,
"https://p2p.belloworld.it/"
)
+ val sendMp4DocumentAsVideo =
+ addConfig(
+ "SendMp4DocumentAsVideo",
+ ConfigItem.configTypeBool,
+ false
+ )
private fun addConfig(
k: String,
diff --git a/TMessagesProj/src/main/res/values-es-rES/strings_na.xml b/TMessagesProj/src/main/res/values-es-rES/strings_na.xml
index 4c70a2139d..a6d9737259 100644
--- a/TMessagesProj/src/main/res/values-es-rES/strings_na.xml
+++ b/TMessagesProj/src/main/res/values-es-rES/strings_na.xml
@@ -125,11 +125,11 @@
Deshabilitar botón flotante de diálogos
Deshabilitar Flag Secure
Centrar el título en la barra de acción
- Mostrar respuestas rápidas en comandos de bot
+ Mostrar respuestas rápidas en comandos del bot
Tipo de servicio Push
- En App
- Google FCM
- Empuje unificado
- Mostrar notificaciones residentes
- Unificado Push Gateway
+ En la App
+ FCM de Google
+ Unified Push
+ Mostrar notificación permanente
+ Gateway de Unified Push
diff --git a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
index e9d451655a..a4865dc9e0 100644
--- a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
+++ b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
@@ -132,4 +132,5 @@
Unified Push
显示常驻通知
Unified Push Gateway
+ MP4 视频作为文件发送时可预览
diff --git a/TMessagesProj/src/main/res/values/strings_na.xml b/TMessagesProj/src/main/res/values/strings_na.xml
index ee733c6b0c..954ae8760f 100644
--- a/TMessagesProj/src/main/res/values/strings_na.xml
+++ b/TMessagesProj/src/main/res/values/strings_na.xml
@@ -132,4 +132,5 @@
Unified Push
Show resident notifications
Unified Push Gateway
+ Send mp4 document as video