Skip to content

Commit

Permalink
Update to 7.9.3 (2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Aug 6, 2021
1 parent fc12550 commit ab221da
Show file tree
Hide file tree
Showing 21 changed files with 548 additions and 182 deletions.
8 changes: 4 additions & 4 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations.all {
dependencies {
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.sharetarget:sharetarget:1.1.0"
Expand All @@ -29,7 +29,7 @@ dependencies {
implementation 'com.google.firebase:firebase-datatransport:18.0.1'
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth:19.2.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
implementation 'com.google.android.gms:play-services-wearable:17.1.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
Expand Down Expand Up @@ -299,7 +299,7 @@ android {
}
}

defaultConfig.versionCode = 2389
defaultConfig.versionCode = 2390

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand All @@ -318,7 +318,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionName "7.9.2"
versionName "7.9.3"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = true/* || Build.VERSION.SDK_INT <= 28*/;
public static int BUILD_VERSION = 2389;
public static String BUILD_VERSION_STRING = "7.9.2";
public static int BUILD_VERSION = 2390;
public static String BUILD_VERSION_STRING = "7.9.3";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
public static String APPCENTER_HASH = "a5b5c4f5-51da-dedc-9918-d9766a22ca7c";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4048,7 +4048,7 @@ public void loadReplyMessagesForMessages(final ArrayList<MessageObject> messages
}
}
}
AndroidUtilities.runOnUIThread(() -> getNotificationCenter().postNotificationName(NotificationCenter.replyMessagesDidLoad, dialogId, loadedMessages));
AndroidUtilities.runOnUIThread(() -> getNotificationCenter().postNotificationName(NotificationCenter.replyMessagesDidLoad, dialogId, loadedMessages, null));
if (callback != null) {
callback.run();
}
Expand Down Expand Up @@ -4270,7 +4270,7 @@ private void broadcastReplyMessages(ArrayList<TLRPC.Message> result, LongSparseA
}
}
if (changed) {
getNotificationCenter().postNotificationName(NotificationCenter.replyMessagesDidLoad, dialog_id, messageObjects);
getNotificationCenter().postNotificationName(NotificationCenter.replyMessagesDidLoad, dialog_id, messageObjects, replyMessageOwners);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3506,8 +3506,12 @@ public String getExtension() {
}

public String getFileName() {
return getFileName(messageOwner);
}

public static String getFileName(TLRPC.Message messageOwner) {
if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
return FileLoader.getAttachFileName(getDocument());
return FileLoader.getAttachFileName(getDocument(messageOwner));
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaPhoto) {
ArrayList<TLRPC.PhotoSize> sizes = messageOwner.media.photo.sizes;
if (sizes.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5875,27 +5875,41 @@ private void updatePrintingStrings() {
newPrintingStrings.put(threadId, LocaleController.getString("RecordingAudio", R.string.RecordingAudio));
}
newPrintingStringsTypes.put(threadId, 1);
} else if (pu.action instanceof TLRPC.TL_sendMessageRecordRoundAction || pu.action instanceof TLRPC.TL_sendMessageUploadRoundAction) {
} else if (pu.action instanceof TLRPC.TL_sendMessageRecordRoundAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsRecordingRound", R.string.IsRecordingRound, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("RecordingRound", R.string.RecordingRound));
}
newPrintingStringsTypes.put(threadId, 4);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadRoundAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSendingVideo", R.string.IsSendingVideo, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("SendingVideoStatus", R.string.SendingVideoStatus));
}
newPrintingStringsTypes.put(threadId, 4);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadAudioAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSendingAudio", R.string.IsSendingAudio, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("SendingAudio", R.string.SendingAudio));
}
newPrintingStringsTypes.put(threadId, 2);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadVideoAction || pu.action instanceof TLRPC.TL_sendMessageRecordVideoAction) {
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadVideoAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSendingVideo", R.string.IsSendingVideo, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("SendingVideoStatus", R.string.SendingVideoStatus));
}
newPrintingStringsTypes.put(threadId, 2);
} else if (pu.action instanceof TLRPC.TL_sendMessageRecordVideoAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsRecordingVideo", R.string.IsRecordingVideo, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("RecordingVideoStatus", R.string.RecordingVideoStatus));
}
newPrintingStringsTypes.put(threadId, 2);
} else if (pu.action instanceof TLRPC.TL_sendMessageUploadDocumentAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSendingFile", R.string.IsSendingFile, getUserNameForTyping(user)));
Expand All @@ -5917,6 +5931,20 @@ private void updatePrintingStrings() {
newPrintingStrings.put(threadId, LocaleController.getString("SendingGame", R.string.SendingGame));
}
newPrintingStringsTypes.put(threadId, 3);
} else if (pu.action instanceof TLRPC.TL_sendMessageGeoLocationAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSelectingLocation", R.string.IsSelectingLocation, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("SelectingLocation", R.string.SelectingLocation));
}
newPrintingStringsTypes.put(threadId, 0);
} else if (pu.action instanceof TLRPC.TL_sendMessageChooseContactAction) {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsSelectingContact", R.string.IsSelectingContact, getUserNameForTyping(user)));
} else {
newPrintingStrings.put(threadId, LocaleController.getString("SelectingContact", R.string.SelectingContact));
}
newPrintingStringsTypes.put(threadId, 0);
} else {
if (lower_id < 0) {
newPrintingStrings.put(threadId, LocaleController.formatString("IsTypingGroup", R.string.IsTypingGroup, getUserNameForTyping(user)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3725,6 +3725,9 @@ public void getNewTask(final ArrayList<Integer> oldTask, final int channelId, bo
arr.add(m);
}
cursor.dispose();
if (media == null) {
media = false;
}
getMessagesController().processLoadedDeleteTask(date, arr, media, channelId1);
} catch (Exception e) {
FileLog.e(e);
Expand Down Expand Up @@ -10369,7 +10372,9 @@ public void putMessages(final TLRPC.messages_Messages messages, final long dialo
data.reuse();
int send_state = cursor.intValue(5);
if (send_state != 3) {
message.attachPath = oldMessage.attachPath;
if (MessageObject.getFileName(oldMessage).equals(MessageObject.getFileName(message))) {
message.attachPath = oldMessage.attachPath;
}
message.ttl = cursor.intValue(2);
}
boolean sameMedia = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,9 @@ public int sendMessage(ArrayList<MessageObject> messages, final long peer, boole
}
}
}
if (chat != null) {
rank = getMessagesController().getAdminRank(chat.id, myId);
}
canSendStickers = ChatObject.canSendStickers(chat);
canSendMedia = ChatObject.canSendMedia(chat);
canSendPreview = ChatObject.canSendEmbed(chat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ public static class PollButton {
private int miniButtonPressed;
private int otherX;
private int otherY;
private int lastWidth;
private int lastHeight;
private int hasMiniProgress;
private int miniButtonState;
Expand Down Expand Up @@ -566,6 +567,7 @@ public static class PollButton {
private float hintButtonProgress;

private String lastPostAuthor;
private TLRPC.Message lastReplyMessage;

private boolean hasPsaHint;
private int psaHelpX;
Expand Down Expand Up @@ -3030,14 +3032,18 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
if (messageObject.checkLayout() || currentPosition != null && lastHeight != AndroidUtilities.displaySize.y) {
currentMessageObject = null;
}
boolean widthChanged = lastWidth != AndroidUtilities.displaySize.x;
lastHeight = AndroidUtilities.displaySize.y;
lastWidth = AndroidUtilities.displaySize.x;
isRoundVideo = messageObject != null && messageObject.isRoundVideo();
TLRPC.Message newReply = messageObject.hasValidReplyMessageObject() ? messageObject.replyMessageObject.messageOwner : null;
boolean messageIdChanged = currentMessageObject == null || currentMessageObject.getId() != messageObject.getId();
boolean messageChanged = currentMessageObject != messageObject || messageObject.forceUpdate || (isRoundVideo && isPlayingRound != (MediaController.getInstance().isPlayingMessage(currentMessageObject) && delegate != null && !delegate.keyboardIsOpened()));
boolean dataChanged = currentMessageObject != null && currentMessageObject.getId() == messageObject.getId() && lastSendState == MessageObject.MESSAGE_SEND_STATE_EDITING && messageObject.isSent()
|| currentMessageObject == messageObject && (isUserDataChanged() || photoNotSet)
|| lastPostAuthor != messageObject.messageOwner.post_author
|| wasPinned != isPinned;
boolean dataChanged = currentMessageObject != null && currentMessageObject.getId() == messageObject.getId() && lastSendState == MessageObject.MESSAGE_SEND_STATE_EDITING && messageObject.isSent() ||
currentMessageObject == messageObject && (isUserDataChanged() || photoNotSet) ||
lastPostAuthor != messageObject.messageOwner.post_author ||
wasPinned != isPinned ||
newReply != lastReplyMessage;
boolean groupChanged = groupedMessages != currentMessagesGroup;
boolean pollChanged = false;
if (drawCommentButton || drawSideButton == 3 && !((hasDiscussion && messageObject.isLinkedToChat(linkedChatId) || isRepliesChat) && (currentPosition == null || currentPosition.siblingHeights == null && (currentPosition.flags & MessageObject.POSITION_FLAG_BOTTOM) != 0 || currentPosition.siblingHeights != null && (currentPosition.flags & MessageObject.POSITION_FLAG_TOP) == 0))) {
Expand Down Expand Up @@ -3087,7 +3093,7 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
}
groupChanged = newPosition != currentPosition;
}
if (messageChanged || dataChanged || groupChanged || pollChanged || isPhotoDataChanged(messageObject) || pinnedBottom != bottomNear || pinnedTop != topNear) {
if (messageChanged || dataChanged || groupChanged || pollChanged || widthChanged && messageObject.isPoll() || isPhotoDataChanged(messageObject) || pinnedBottom != bottomNear || pinnedTop != topNear) {
wasPinned = isPinned;
pinnedBottom = bottomNear;
pinnedTop = topNear;
Expand Down Expand Up @@ -3144,6 +3150,7 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
adminLayout = null;
checkOnlyButtonPressed = false;
replyTextLayout = null;
lastReplyMessage = null;
hasEmbed = false;
autoPlayingMedia = false;
replyNameWidth = 0;
Expand Down Expand Up @@ -9643,12 +9650,12 @@ private void setMessageObjectInternal(MessageObject messageObject) {
int adminWidth;
String adminString;
String adminLabel;
if (isMegagroup && currentChat != null && currentMessageObject.isForwardedChannelPost()) {
adminString = LocaleController.getString("DiscussChannel", R.string.DiscussChannel);
if (isMegagroup && currentChat != null && messageObject.messageOwner.post_author != null && currentChat.id == -currentMessageObject.getFromChatId()) {
adminString = messageObject.messageOwner.post_author.replace("\n", "");
adminWidth = (int) Math.ceil(Theme.chat_adminPaint.measureText(adminString));
nameWidth -= adminWidth;
} else if (isMegagroup && currentChat != null && messageObject.messageOwner.post_author != null && currentChat.id == -currentMessageObject.getFromChatId()) {
adminString = messageObject.messageOwner.post_author.replace("\n", "");
} else if (isMegagroup && currentChat != null && currentMessageObject.isForwardedChannelPost()) {
adminString = LocaleController.getString("DiscussChannel", R.string.DiscussChannel);
adminWidth = (int) Math.ceil(Theme.chat_adminPaint.measureText(adminString));
nameWidth -= adminWidth;
} else if (currentUser != null && !currentMessageObject.isOutOwner() && !currentMessageObject.isAnyKindOfSticker() && currentMessageObject.type != 5 && delegate != null && (adminLabel = delegate.getAdminRank(currentUser.id)) != null) {
Expand Down Expand Up @@ -9749,6 +9756,8 @@ private void setMessageObjectInternal(MessageObject messageObject) {
if (currentForwardChannel != null) {
if (currentForwardUser != null) {
currentForwardNameString = String.format("%s (%s)", currentForwardChannel.title, UserObject.getUserName(currentForwardUser));
} else if (!TextUtils.isEmpty(messageObject.messageOwner.fwd_from.post_author)) {
currentForwardNameString = String.format("%s (%s)", currentForwardChannel.title, messageObject.messageOwner.fwd_from.post_author);
} else {
currentForwardNameString = currentForwardChannel.title;
}
Expand Down Expand Up @@ -9828,6 +9837,7 @@ private void setMessageObjectInternal(MessageObject messageObject) {

String name = null;
if ((!isThreadChat || messageObject.getReplyTopMsgId() != 0) && messageObject.hasValidReplyMessageObject()) {
lastReplyMessage = messageObject.replyMessageObject.messageOwner;
int cacheType = 1;
int size = 0;
TLObject photoObject;
Expand Down Expand Up @@ -10792,18 +10802,18 @@ public int getBackgroundDrawableBottom() {
return getBackgroundDrawableTop() + layoutHeight - offsetBottom + additionalBottom;
}

public void drawBackground(Canvas canvas, int left, int top, int right, int bottom, boolean pinnedTop, boolean pinnedBottom) {
public void drawBackground(Canvas canvas, int left, int top, int right, int bottom, boolean pinnedTop, boolean pinnedBottom, boolean selected) {
if (currentMessageObject.isOutOwner()) {
if (!mediaBackground && !pinnedBottom) {
currentBackgroundDrawable = Theme.chat_msgOutDrawable;
currentBackgroundDrawable = selected ? Theme.chat_msgOutSelectedDrawable : Theme.chat_msgOutDrawable;
} else {
currentBackgroundDrawable = Theme.chat_msgOutMediaDrawable;
currentBackgroundDrawable = selected ? Theme.chat_msgOutMediaSelectedDrawable : Theme.chat_msgOutMediaDrawable;
}
} else {
if (!mediaBackground && !pinnedBottom) {
currentBackgroundDrawable = Theme.chat_msgInDrawable;
currentBackgroundDrawable = selected ? Theme.chat_msgInSelectedDrawable : Theme.chat_msgInDrawable;
} else {
currentBackgroundDrawable = Theme.chat_msgInMediaDrawable;
currentBackgroundDrawable = selected ? Theme.chat_msgInMediaSelectedDrawable : Theme.chat_msgInMediaDrawable;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public StickerSetNameCell(Context context, boolean emoji, boolean supportRtl) {
textView.setEllipsize(TextUtils.TruncateAt.END);
textView.setSingleLine(true);
if (supportRtl) {
lp = LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.START, emoji ? 15 : 17, 4, 57, 0);
lp = LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.START, emoji ? 15 : 17, 2, 57, 0);
} else {
lp = LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.LEFT, emoji ? 15 : 17, 4, 57, 0);
lp = LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP | Gravity.LEFT, emoji ? 15 : 17, 2, 57, 0);
}
addView(textView, lp);

Expand Down
Loading

1 comment on commit ab221da

@AlexandrKozlovskiy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrKLO Please pay attention on my pullrequest,because i did several accessibility improvements. If you have a question,you can communicate with me via github,or my telegram. Thank you very much for merging of my pull request and please pay attention on this channel.

Please sign in to comment.