diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 28aad2c5..e39f8706 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -82,7 +82,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 21 - versionCode 414 - versionName "2.3.1" + versionCode 415 + versionName "2.3.2" } } diff --git a/TMessagesProj/jni/Android.mk b/TMessagesProj/jni/Android.mk index f648a89b..88b4e639 100755 --- a/TMessagesProj/jni/Android.mk +++ b/TMessagesProj/jni/Android.mk @@ -87,7 +87,11 @@ LOCAL_SRC_FILES := \ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) -LOCAL_ARM_MODE := arm +ifeq ($(TARGET_ARCH_ABI),armeabi) + LOCAL_ARM_MODE := thumb +else + LOCAL_ARM_MODE := arm +endif LOCAL_MODULE := sqlite LOCAL_CFLAGS := -w -std=gnu99 -O2 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -DHAVE_STRCHRNUL=0 @@ -106,7 +110,11 @@ LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -O2 -funroll-loops LOCAL_LDLIBS := -ljnigraphics -llog -LOCAL_ARM_MODE := arm +ifeq ($(TARGET_ARCH_ABI),armeabi) + LOCAL_ARM_MODE := thumb +else + LOCAL_ARM_MODE := arm +endif LOCAL_SRC_FILES := \ ./opus/src/opus.c \ diff --git a/TMessagesProj/libs/armeabi/libtmessages.5.so b/TMessagesProj/libs/armeabi/libtmessages.5.so index f304df5b..397e267c 100755 Binary files a/TMessagesProj/libs/armeabi/libtmessages.5.so and b/TMessagesProj/libs/armeabi/libtmessages.5.so differ diff --git a/TMessagesProj/src/main/java/org/telegram/android/MediaController.java b/TMessagesProj/src/main/java/org/telegram/android/MediaController.java index 80f9c6dc..2dc688aa 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MediaController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MediaController.java @@ -1350,9 +1350,13 @@ public class MediaController implements NotificationCenter.NotificationCenterDel fileDecodingQueue.postRunnable(new Runnable() { @Override public void run() { - if (playingMessageObject != null && playingMessageObject.audioProgress != 0) { - lastPlayPcm = (long)(currentTotalPcmDuration * playingMessageObject.audioProgress); - seekOpusFile(playingMessageObject.audioProgress); + try { + if (playingMessageObject != null && playingMessageObject.audioProgress != 0) { + lastPlayPcm = (long)(currentTotalPcmDuration * playingMessageObject.audioProgress); + seekOpusFile(playingMessageObject.audioProgress); + } + } catch (Exception e) { + FileLog.e("tmessages", e); } synchronized (playerSync) { freePlayerBuffers.addAll(usedPlayerBuffers); diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java index 5b9f18a3..1c673e6b 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java @@ -60,6 +60,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter private ArrayList loadingFullChats = new ArrayList<>(); private ArrayList loadedFullChats = new ArrayList<>(); + private ArrayList reloadingMessages = new ArrayList<>(); + private boolean gettingNewDeleteTask = false; private int currentDeletingTaskTime = 0; private ArrayList currentDeletingTaskMids = null; @@ -314,6 +316,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter loadedFullUsers.clear(); loadingFullUsers.clear(); loadedFullUsers.clear(); + reloadingMessages.clear(); updatesStartWaitTime = 0; currentDeletingTaskTime = 0; @@ -548,6 +551,47 @@ public class MessagesController implements NotificationCenter.NotificationCenter ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid); } + private void reloadMessages(final ArrayList mids, final long dialog_id) { + final TLRPC.TL_messages_getMessages req = new TLRPC.TL_messages_getMessages(); + for (Integer mid : mids) { + if (reloadingMessages.contains(mid)) { + continue; + } + req.id.add(mid); + } + if (req.id.isEmpty()) { + return; + } + reloadingMessages.addAll(req.id); + ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { + @Override + public void run(TLObject response, TLRPC.TL_error error) { + if (error == null) { + TLRPC.messages_Messages messagesRes = (TLRPC.messages_Messages) response; + MessagesStorage.getInstance().putMessages(messagesRes, dialog_id); + + final ArrayList objects = new ArrayList<>(); + ArrayList messagesToReload = null; + for (TLRPC.Message message : messagesRes.messages) { + message.dialog_id = dialog_id; + final HashMap usersLocal = new HashMap<>(); + for (TLRPC.User u : messagesRes.users) { + usersLocal.put(u.id, u); + } + objects.add(new MessageObject(message, usersLocal, 2)); + } + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + NotificationCenter.getInstance().postNotificationName(NotificationCenter.replaceMessagesObjects, dialog_id, objects); + } + }); + } + reloadingMessages.removeAll(req.id); + } + }); + } + protected void processNewDifferenceParams(int seq, int pts, int date) { if (MessagesStorage.lastSeqValue + 1 == seq) { if (seq != -1) { @@ -1443,9 +1487,21 @@ public class MessagesController implements NotificationCenter.NotificationCenter usersLocal.put(u.id, u); } final ArrayList objects = new ArrayList<>(); + ArrayList messagesToReload = null; for (TLRPC.Message message : messagesRes.messages) { message.dialog_id = dialog_id; objects.add(new MessageObject(message, usersLocal, 2)); + if (isCache && message.media instanceof TLRPC.TL_messageMediaUnsupported) { + if (message.media.bytes.length == 0 || message.media.bytes.length == 1 && message.media.bytes[0] < TLRPC.LAYER) { + if (messagesToReload == null) { + messagesToReload = new ArrayList<>(); + } + messagesToReload.add(message.id); + } + } + } + if (messagesToReload != null) { + reloadMessages(messagesToReload, dialog_id); } AndroidUtilities.runOnUIThread(new Runnable() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java index 16621aa6..4b319175 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java @@ -2734,6 +2734,8 @@ public class MessagesStorage { int downloadMediaMask = 0; for (TLRPC.Message message : messages) { + fixUnsupportedMedia(message); + long dialog_id = message.dialog_id; if (dialog_id == 0) { if (message.to_id.chat_id != 0) { @@ -3499,6 +3501,15 @@ public class MessagesStorage { } } + private void fixUnsupportedMedia(TLRPC.Message message) { + if (message != null && message.media instanceof TLRPC.TL_messageMediaUnsupported && message.media.bytes != null) { + if (message.media.bytes.length == 0) { + message.media.bytes = new byte[1]; + message.media.bytes[0] = TLRPC.LAYER; + } + } + } + public void putMessages(final TLRPC.messages_Messages messages, final long dialog_id) { if (messages.messages.isEmpty()) { return; @@ -3512,6 +3523,7 @@ public class MessagesStorage { SQLitePreparedStatement state = database.executeFast("REPLACE INTO messages VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)"); SQLitePreparedStatement state2 = database.executeFast("REPLACE INTO media VALUES(?, ?, ?, ?)"); for (TLRPC.Message message : messages.messages) { + fixUnsupportedMedia(message); state.requery(); ByteBufferDesc data = buffersStorage.getFreeBuffer(message.getObjectSize()); message.serializeToStream(data); @@ -3680,6 +3692,7 @@ public class MessagesStorage { uid = -dialog.peer.chat_id; } TLRPC.Message message = new_dialogMessage.get(dialog.top_message); + fixUnsupportedMedia(message); ByteBufferDesc data = buffersStorage.getFreeBuffer(message.getObjectSize()); message.serializeToStream(data); diff --git a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java index 7ec39160..4500948a 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java +++ b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java @@ -47,6 +47,7 @@ public class NotificationCenter { public static final int privacyRulesUpdated = totalEvents++; public static final int updateMessageMedia = totalEvents++; public static final int recentImagesDidLoaded = totalEvents++; + public static final int replaceMessagesObjects = totalEvents++; public static final int httpFileDidLoaded = totalEvents++; public static final int httpFileDidFailedLoad = totalEvents++; diff --git a/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java b/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java index 30442cd1..6ad3de90 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/android/SecretChatHelper.java @@ -38,7 +38,7 @@ import java.util.concurrent.ConcurrentHashMap; public class SecretChatHelper { - public static final int CURRENT_SECRET_CHAT_LAYER = 20; + public static final int CURRENT_SECRET_CHAT_LAYER = 23; private ArrayList sendingNotifyLayer = new ArrayList<>(); private HashMap> secretHolesQueue = new HashMap<>(); diff --git a/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java index 76c5cd1d..ff92dab3 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java @@ -1032,38 +1032,57 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter reqSend.media.user_id = user.id; SecretChatHelper.getInstance().performSendEncryptedRequest(reqSend, newMsgObj.messageOwner, encryptedChat, null, null); } else if (type == 7) { - reqSend.media = new TLRPC.TL_decryptedMessageMediaDocument(); - reqSend.media.size = document.size; - if (!(document.thumb instanceof TLRPC.TL_photoSizeEmpty)) { - reqSend.media.thumb = document.thumb.bytes; - reqSend.media.thumb_h = document.thumb.h; - reqSend.media.thumb_w = document.thumb.w; - } else { - reqSend.media.thumb = new byte[0]; - reqSend.media.thumb_h = 0; - reqSend.media.thumb_w = 0; - } - reqSend.media.file_name = FileLoader.getDocumentFileName(document); - reqSend.media.mime_type = document.mime_type; - if (document.access_hash == 0) { - DelayedMessage delayedMessage = new DelayedMessage(); - delayedMessage.originalPath = originalPath; - delayedMessage.sendEncryptedRequest = reqSend; - delayedMessage.type = 2; - delayedMessage.obj = newMsgObj; - delayedMessage.encryptedChat = encryptedChat; - if (path != null && path.length() > 0 && path.startsWith("http")) { - delayedMessage.httpLocation = path; + boolean isSticker = false; + for (TLRPC.DocumentAttribute attribute : document.attributes) { + if (attribute instanceof TLRPC.TL_documentAttributeSticker) { + isSticker = true; } - delayedMessage.documentLocation = document; - performSendDelayedMessage(delayedMessage); + } + if (isSticker) { + reqSend.media = new TLRPC.TL_decryptedMessageMediaExternalDocument(); + reqSend.media.id = document.id; + reqSend.media.date = document.date; + reqSend.media.mime_type = document.mime_type; + reqSend.media.size = document.size; + ((TLRPC.TL_decryptedMessageMediaExternalDocument) reqSend.media).thumbImage = document.thumb; + reqSend.media.dc_id = document.dc_id; + reqSend.media.attributes = document.attributes; + SecretChatHelper.getInstance().performSendEncryptedRequest(reqSend, newMsgObj.messageOwner, encryptedChat, null, null); } else { - TLRPC.TL_inputEncryptedFile encryptedFile = new TLRPC.TL_inputEncryptedFile(); - encryptedFile.id = document.id; - encryptedFile.access_hash = document.access_hash; - reqSend.media.key = document.key; - reqSend.media.iv = document.iv; - SecretChatHelper.getInstance().performSendEncryptedRequest(reqSend, newMsgObj.messageOwner, encryptedChat, encryptedFile, null); + reqSend.media = new TLRPC.TL_decryptedMessageMediaDocument(); + reqSend.media.size = document.size; + if (!(document.thumb instanceof TLRPC.TL_photoSizeEmpty)) { + reqSend.media.thumb = document.thumb.bytes; + reqSend.media.thumb_h = document.thumb.h; + reqSend.media.thumb_w = document.thumb.w; + } else { + reqSend.media.thumb = new byte[0]; + reqSend.media.thumb_h = 0; + reqSend.media.thumb_w = 0; + } + reqSend.media.file_name = FileLoader.getDocumentFileName(document); + reqSend.media.mime_type = document.mime_type; + + if (document.access_hash == 0) { + DelayedMessage delayedMessage = new DelayedMessage(); + delayedMessage.originalPath = originalPath; + delayedMessage.sendEncryptedRequest = reqSend; + delayedMessage.type = 2; + delayedMessage.obj = newMsgObj; + delayedMessage.encryptedChat = encryptedChat; + if (path != null && path.length() > 0 && path.startsWith("http")) { + delayedMessage.httpLocation = path; + } + delayedMessage.documentLocation = document; + performSendDelayedMessage(delayedMessage); + } else { + TLRPC.TL_inputEncryptedFile encryptedFile = new TLRPC.TL_inputEncryptedFile(); + encryptedFile.id = document.id; + encryptedFile.access_hash = document.access_hash; + reqSend.media.key = document.key; + reqSend.media.iv = document.iv; + SecretChatHelper.getInstance().performSendEncryptedRequest(reqSend, newMsgObj.messageOwner, encryptedChat, encryptedFile, null); + } } } else if (type == 8) { if (AndroidUtilities.getPeerLayerVersion(encryptedChat.layer) >= 17) { @@ -1544,6 +1563,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter } boolean isEncrypted = (int)dialog_id == 0; + boolean allowSticker = !isEncrypted; String name = f.getName(); if (name == null) { @@ -1591,7 +1611,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter FileLog.e("tmessages", e); } } - if (document.mime_type.equals("image/webp") && !isEncrypted) { + if (document.mime_type.equals("image/webp") && allowSticker) { BitmapFactory.Options bmOptions = new BitmapFactory.Options(); try { bmOptions.inJustDecodeBounds = true; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java index 1273789a..2348395b 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java @@ -14,8 +14,9 @@ import java.util.Locale; @SuppressWarnings("unchecked") public class TLRPC { - public static int MESSAGE_FLAG_UNREAD = 1; - public static int MESSAGE_FLAG_OUT = 2; + public static final int MESSAGE_FLAG_UNREAD = 1; + public static final int MESSAGE_FLAG_OUT = 2; + public static final int LAYER = 22; public static class ChatPhoto extends TLObject { public FileLocation photo_small; @@ -10831,7 +10832,7 @@ public class TLRPC { public static class invokeWithLayer extends TLObject { public static int constructor = 0xda9b0d0d; - public int layer = 22; + public int layer = LAYER; public TLObject query; public void serializeToStream(AbsSerializedData stream) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/StickersAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/StickersAdapter.java index f8d2e602..2d52263f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/StickersAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/StickersAdapter.java @@ -210,15 +210,17 @@ public class StickersAdapter extends RecyclerView.Adapter implements Notificatio } final HashMap> result = new HashMap<>(); for (TLRPC.TL_stickerPack stickerPack : res.packs) { - ArrayList arrayList = result.get(stickerPack.emoticon); - for (Long id : stickerPack.documents) { - TLRPC.Document document = documents.get(id); - if (document != null) { - if (arrayList == null) { - arrayList = new ArrayList<>(); - result.put(stickerPack.emoticon, arrayList); + if (stickerPack != null && stickerPack.emoticon != null) { + ArrayList arrayList = result.get(stickerPack.emoticon); + for (Long id : stickerPack.documents) { + TLRPC.Document document = documents.get(id); + if (document != null) { + if (arrayList == null) { + arrayList = new ArrayList<>(); + result.put(stickerPack.emoticon, arrayList); + } + arrayList.add(document); } - arrayList.add(document); } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 51ba3b15..adc0c247 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -93,6 +93,7 @@ import org.telegram.ui.Components.TimerDrawable; import org.telegram.ui.Components.TypingDotsDrawable; import java.io.File; +import java.io.RandomAccessFile; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -444,6 +445,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not NotificationCenter.getInstance().addObserver(this, NotificationCenter.didCreatedNewDeleteTask); NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioDidStarted); NotificationCenter.getInstance().addObserver(this, NotificationCenter.updateMessageMedia); + NotificationCenter.getInstance().addObserver(this, NotificationCenter.replaceMessagesObjects); super.onFragmentCreate(); @@ -502,6 +504,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didCreatedNewDeleteTask); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioDidStarted); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.updateMessageMedia); + NotificationCenter.getInstance().removeObserver(this, NotificationCenter.replaceMessagesObjects); if (AndroidUtilities.isTablet()) { NotificationCenter.getInstance().postNotificationName(NotificationCenter.openedChatChanged, dialog_id, true); } @@ -1222,7 +1225,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not stickersAdapter.destroy(); } - if (currentEncryptedChat == null) { + if (currentEncryptedChat == null || currentEncryptedChat != null && AndroidUtilities.getPeerLayerVersion(currentEncryptedChat.layer) >= 23) { stickersListView.setPadding(AndroidUtilities.dp(18), 0, AndroidUtilities.dp(18), 0); stickersListView.setAdapter(stickersAdapter = new StickersAdapter(getParentActivity(), new StickersAdapter.StickersAdapterDelegate() { @Override @@ -1269,6 +1272,36 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not public void onItemClick(View view, int position) { TLRPC.Document document = stickersAdapter.getItem(position); if (document instanceof TLRPC.TL_document) { + if (currentEncryptedChat != null && document.thumb instanceof TLRPC.TL_photoSize) { + File file = FileLoader.getPathToAttach(document.thumb, true); + if (file.exists()) { + try { + int len = (int)file.length(); + byte[] arr = new byte[(int)file.length()]; + RandomAccessFile reader = new RandomAccessFile(file, "r"); + reader.readFully(arr); + TLRPC.TL_document newDocument = new TLRPC.TL_document(); + newDocument.thumb = new TLRPC.TL_photoCachedSize(); + newDocument.thumb.location = document.thumb.location; + newDocument.thumb.size = document.thumb.size; + newDocument.thumb.w = document.thumb.w; + newDocument.thumb.h = document.thumb.h; + newDocument.thumb.type = document.thumb.type; + newDocument.thumb.bytes = arr; + + newDocument.id = document.id; + newDocument.access_hash = document.access_hash; + newDocument.date = document.date; + newDocument.mime_type = document.mime_type; + newDocument.size = document.size; + newDocument.dc_id = document.dc_id; + newDocument.attributes = document.attributes; + document = newDocument; + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + } SendMessagesHelper.getInstance().sendMessage((TLRPC.TL_document) document, null, null, dialog_id); } chatActivityEnterView.setFieldText(""); @@ -2661,6 +2694,25 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not existMessageObject.generateThumbs(false, 1); } updateVisibleRows(); + } else if (id == NotificationCenter.replaceMessagesObjects) { + if (dialog_id == (long) args[0]) { + boolean changed = false; + ArrayList messageObjects = (ArrayList) args[1]; + for (MessageObject messageObject : messageObjects) { + MessageObject old = messagesDict.get(messageObject.messageOwner.id); + if (old != null) { + messagesDict.put(old.messageOwner.id, messageObject); + int idx = messages.indexOf(old); + if (idx >= 0) { + messages.set(idx, messageObject); + changed = true; + } + } + } + if (changed) { + chatAdapter.notifyDataSetChanged(); + } + } } } @@ -3098,15 +3150,26 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop()); } } else if (option == 1) { - ArrayList ids = new ArrayList<>(); - ids.add(selectedObject.messageOwner.id); - removeUnreadPlane(true); - ArrayList random_ids = null; - if (currentEncryptedChat != null && selectedObject.messageOwner.random_id != 0 && selectedObject.type != 10) { - random_ids = new ArrayList<>(); - random_ids.add(selectedObject.messageOwner.random_id); - } - MessagesController.getInstance().deleteMessages(ids, random_ids, currentEncryptedChat); + final MessageObject finalSelectedObject = selectedObject; + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setMessage(LocaleController.formatString("AreYouSureDeleteMessages", R.string.AreYouSureDeleteMessages, LocaleController.formatPluralString("messages", 1))); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + ArrayList ids = new ArrayList<>(); + ids.add(finalSelectedObject.messageOwner.id); + removeUnreadPlane(true); + ArrayList random_ids = null; + if (currentEncryptedChat != null && finalSelectedObject.messageOwner.random_id != 0 && finalSelectedObject.type != 10) { + random_ids = new ArrayList<>(); + random_ids.add(finalSelectedObject.messageOwner.random_id); + } + MessagesController.getInstance().deleteMessages(ids, random_ids, currentEncryptedChat); + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + showAlertDialog(builder); } else if (option == 2) { forwaringMessage = selectedObject; Bundle args = new Bundle(); diff --git a/TMessagesProj/src/main/res/values-ar/strings.xml b/TMessagesProj/src/main/res/values-ar/strings.xml index 40cfbce6..8298f3be 100644 --- a/TMessagesProj/src/main/res/values-ar/strings.xml +++ b/TMessagesProj/src/main/res/values-ar/strings.xml @@ -123,7 +123,7 @@ %1$s قام بإرسال موقع لك %1$s قام بإرسال مستند لك %1$s قام بإرسال مقطع صوتي لك - %1$s sent you an sticker + %1$s قام بإرسال ملصق %1$s @ %2$s: %3$s %1$s قام بإرسال رسالة للمجموعة %2$s %1$s قام بإرسال صورة للمجموعة %2$s @@ -132,7 +132,7 @@ %1$s قام بإرسال موقع للمجموعة %2$s %1$s قام بإرسال مستند للمجموعة %2$s %1$s قام بإرسال مقطع صوتي للمجموعة %2$s - %1$s sent an sticker to the group %2$s + %1$s قام بإرسال ملصق للمجموعة %2$s %1$s قام بدعوتك للمجموعة %2$s %1$s قام بتعديل اسم المجموعة %2$s %1$s قام بتغيير صورة المجموعة %2$s @@ -309,7 +309,7 @@ لا توجد صور حتى الآن فضلًا، قم بتنزيل الوسائط أولًا لا توجد صور حديثة - لا توجد صور حديثة + لا يوجد صور متحركة حديثة البحث على الإنترنت البحث عن صور متحركة البحث على الإنترنت @@ -419,7 +419,7 @@ موقع جهة اتصال مستند - Sticker + ملصق مقطع صوتي أنت أنت أخذت لقطة للشاشة ! diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index c083e6a2..e6da462b 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -123,7 +123,7 @@ %1$s sent you a location %1$s sent you a document %1$s sent you an audio - %1$s sent you an sticker + %1$s sent you a sticker %1$s @ %2$s: %3$s %1$s sent a message to the group %2$s %1$s sent a photo to the group %2$s @@ -132,7 +132,7 @@ %1$s sent a location to the group %2$s %1$s sent a document to the group %2$s %1$s sent an audio to the group %2$s - %1$s sent an sticker to the group %2$s + %1$s sent a sticker to the group %2$s %1$s invited you to the group %2$s %1$s edited the group\'s %2$s name %1$s edited the group\'s %2$s photo