Skip to content

Commit dd2b001

Browse files
committed
Update to 7.8.0 (2360)
1 parent e8d88e5 commit dd2b001

File tree

18 files changed

+1869
-675
lines changed

18 files changed

+1869
-675
lines changed

TMessagesProj/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ android {
299299
}
300300
}
301301

302-
defaultConfig.versionCode = 2359
302+
defaultConfig.versionCode = 2360
303303

304304
applicationVariants.all { variant ->
305305
variant.outputs.all { output ->

TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class BuildVars {
1919
public static boolean USE_CLOUD_STRINGS = true;
2020
public static boolean CHECK_UPDATES = true;
2121
public static boolean NO_SCOPED_STORAGE = true/* || Build.VERSION.SDK_INT <= 28*/;
22-
public static int BUILD_VERSION = 2359;
22+
public static int BUILD_VERSION = 2360;
2323
public static String BUILD_VERSION_STRING = "7.8.0";
2424
public static int APP_ID = 4;
2525
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4012,7 +4012,7 @@ public static String getStickerExt(Uri uri) {
40124012
inputStream = ApplicationLoader.applicationContext.getContentResolver().openInputStream(uri);
40134013
byte[] header = new byte[12];
40144014
if (inputStream.read(header, 0, 12) == 12) {
4015-
if (header[0] == 0x89 && header[1] == 0x50 && header[2] == 0x4E && header[3] == 0x47 && header[4] == 0x0D && header[5] == 0x0A && header[6] == 0x1A && header[7] == 0x0A) {
4015+
if (header[0] == (byte) 0x89 && header[1] == (byte) 0x50 && header[2] == (byte) 0x4E && header[3] == (byte) 0x47 && header[4] == (byte) 0x0D && header[5] == (byte) 0x0A && header[6] == (byte) 0x1A && header[7] == (byte) 0x0A) {
40164016
return "png";
40174017
}
40184018
if (header[0] == 0x1f && header[1] == (byte) 0x8b) {

TMessagesProj/src/main/java/org/telegram/messenger/MessageObject.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,12 +2480,15 @@ private void updateMessageText(AbstractMap<Integer, TLRPC.User> users, AbstractM
24802480
}
24812481
messageText = LocaleController.formatString("ActionGroupCallEnded", R.string.ActionGroupCallEnded, time);
24822482
} else {
2483-
messageText = LocaleController.getString("ActionGroupCallJustStarted", R.string.ActionGroupCallJustStarted);
2484-
/*if (isOut()) {
2485-
messageText = LocaleController.getString("ActionGroupCallStartedByYou", R.string.ActionGroupCallStartedByYou);
2483+
if (isSupergroup()) {
2484+
if (isOut()) {
2485+
messageText = LocaleController.getString("ActionGroupCallStartedByYou", R.string.ActionGroupCallStartedByYou);
2486+
} else {
2487+
messageText = replaceWithLink(LocaleController.getString("ActionGroupCallStarted", R.string.ActionGroupCallStarted), "un1", fromObject);
2488+
}
24862489
} else {
2487-
messageText = replaceWithLink(LocaleController.getString("ActionGroupCallStarted", R.string.ActionGroupCallStarted), "un1", fromObject);
2488-
}*/
2490+
messageText = LocaleController.getString("ActionGroupCallJustStarted", R.string.ActionGroupCallJustStarted);
2491+
}
24892492
}
24902493
} else if (messageOwner.action instanceof TLRPC.TL_messageActionInviteToGroupCall) {
24912494
int singleUserId = messageOwner.action.user_id;

TMessagesProj/src/main/java/org/telegram/ui/ActionBar/Theme.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8210,7 +8210,8 @@ public static int getColor(String key, boolean[] isDefault, boolean ignoreAnimat
82108210
return color;
82118211
}
82128212
}
8213-
if (serviceBitmapShader != null && (key_chat_serviceText.equals(key) || key_chat_serviceLink.equals(key) || key_chat_serviceIcon.equals(key))) {
8213+
if (serviceBitmapShader != null && (key_chat_serviceText.equals(key) || key_chat_serviceLink.equals(key) || key_chat_serviceIcon.equals(key)
8214+
|| key_chat_stickerReplyLine.equals(key) || key_chat_stickerReplyNameText.equals(key) || key_chat_stickerReplyMessageText.equals(key))) {
82148215
return 0xffffffff;
82158216
}
82168217
if (currentTheme == defaultTheme) {

TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15097,10 +15097,6 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
1509715097
messageObject.localGroupId = localId;
1509815098
}
1509915099
if (messageObject.isOut()) {
15100-
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
15101-
if (wallpaper instanceof MotionBackgroundDrawable) {
15102-
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
15103-
}
1510415100
if (!notifiedSearch) {
1510515101
notifiedSearch = true;
1510615102
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.closeSearchByActiveAction);
@@ -15179,6 +15175,12 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
1517915175

1518015176
for (int a = 0; a < arr.size(); a++) {
1518115177
MessageObject obj = arr.get(a);
15178+
if (obj.isOut()) {
15179+
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
15180+
if (wallpaper instanceof MotionBackgroundDrawable) {
15181+
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
15182+
}
15183+
}
1518215184
if (threadMessageId != 0 && threadMessageId != obj.getReplyTopMsgId() && threadMessageId != obj.getReplyMsgId()) {
1518315185
continue;
1518415186
}
@@ -15274,6 +15276,12 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
1527415276
if (obj.scheduled != (chatMode == MODE_SCHEDULED) || threadMessageId != 0 && threadMessageId != obj.getReplyTopMsgId() && threadMessageId != obj.getReplyMsgId()) {
1527515277
continue;
1527615278
}
15279+
if (obj.isOut()) {
15280+
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
15281+
if (wallpaper instanceof MotionBackgroundDrawable) {
15282+
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
15283+
}
15284+
}
1527715285
int placeToPaste = -1;
1527815286
int messageId = obj.getId();
1527915287
if (chatMode == MODE_SCHEDULED && messagesDict[0].indexOfKey(messageId) >= 0) {
@@ -15613,7 +15621,6 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
1561315621
AndroidUtilities.runOnUIThread(() -> scrollToMessageId(mid, 0, false, 0, true, 0));
1561415622
}
1561515623
}
15616-
1561715624
}
1561815625
}
1561915626
if (!messages.isEmpty() && botUser != null && botUser.length() == 0) {

TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertDocumentLayout.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ private void searchGlobal(long dialogId, long minDate, long maxDate, FiltersView
14711471
localTipDates.clear();
14721472
localTipChats.clear();
14731473
updateFiltersView(false, null, null, true);
1474+
return;
14741475
}
14751476
requestIndex++;
14761477
final int requestId = requestIndex;

TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallMiniTextureView.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,21 +254,23 @@ protected void dispatchDraw(Canvas canvas) {
254254
if (animateToFullscreen || showingInFullscreen) {
255255
size += (AndroidUtilities.dp(10) + AndroidUtilities.dp(39) * parentContainer.progressToFullscreenMode);
256256
} else {
257-
size += AndroidUtilities.dp(10) * (1.0f - progressToFullscreen);
257+
size += AndroidUtilities.dp(10) * (1.0f - parentContainer.progressToFullscreenMode);
258258
}
259259

260260
int x = (getMeasuredWidth() - size) / 2;
261261
float smallProgress;
262262
float scrimProgress = (showingAsScrimView || animateToScrimView ? parentContainer.progressToScrimView : 0);
263-
264-
smallProgress = (showingAsScrimView || animateToScrimView) ? scrimProgress : progressToFullscreen;
265-
266-
int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(11) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * progressToFullscreen) * smallProgress);
263+
if (showingInFullscreen) {
264+
smallProgress = progressToFullscreen;
265+
} else {
266+
smallProgress = animateToFullscreen ? parentContainer.progressToFullscreenMode : scrimProgress;
267+
}
268+
int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(11) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * parentContainer.progressToFullscreenMode) * smallProgress);
267269
castingScreenDrawable.setBounds(x, y, x + size, y + size);
268270
castingScreenDrawable.draw(canvas);
269271

270272
if (parentContainer.progressToFullscreenMode > 0 || scrimProgress > 0) {
271-
float alpha = Math.max(progressToFullscreen, scrimProgress) * smallProgress;
273+
float alpha = Math.max(parentContainer.progressToFullscreenMode, scrimProgress) * smallProgress;
272274
textPaint2.setAlpha((int) (255 * alpha));
273275
if (animateToFullscreen || showingInFullscreen) {
274276
stopSharingTextView.setAlpha(alpha * (1.0f - scrimProgress));
@@ -281,8 +283,8 @@ protected void dispatchDraw(Canvas canvas) {
281283
}
282284
stopSharingTextView.setTranslationY(y + size + AndroidUtilities.dp(72) + swipeToBackDy - currentClipVertical);
283285
stopSharingTextView.setTranslationX((getMeasuredWidth() - stopSharingTextView.getMeasuredWidth()) / 2 - currentClipHorizontal);
284-
if (progressToFullscreen < 1 && scrimProgress < 1) {
285-
textPaint.setAlpha((int) (255 * (1.0 - Math.max(progressToFullscreen, scrimProgress))));
286+
if (parentContainer.progressToFullscreenMode < 1 && scrimProgress < 1) {
287+
textPaint.setAlpha((int) (255 * (1.0 - Math.max(parentContainer.progressToFullscreenMode, scrimProgress))));
286288
canvas.save();
287289
canvas.translate(x - AndroidUtilities.dp(400) / 2f + size / 2f, y + size + AndroidUtilities.dp(10));
288290
staticLayout.draw(canvas);

TMessagesProj/src/main/java/org/telegram/ui/Components/voip/GroupCallRenderersContainer.java

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,14 @@ public void requestFullscreen(ChatObject.VideoParticipant videoParticipant) {
579579
if ((videoParticipant == null && fullscreenParticipant == null) || (videoParticipant != null && videoParticipant.equals(fullscreenParticipant))) {
580580
return;
581581
}
582+
// if (videoParticipant != null && fullscreenParticipant != null && fullscreenTextureView != null) {
583+
// if (!fullscreenTextureView.hasVideo && MessageObject.getPeerId(fullscreenParticipant.participant.peer) == MessageObject.getPeerId(videoParticipant.participant.peer)) {
584+
// fullscreenTextureView.participant = videoParticipant;
585+
// fullscreenParticipant = videoParticipant;
586+
// fullscreenTextureView.updateAttachState(true);
587+
// return;
588+
// }
589+
// }
582590
int peerId = videoParticipant == null ? 0 : MessageObject.getPeerId(videoParticipant.participant.peer);
583591
if (fullscreenTextureView != null) {
584592
fullscreenTextureView.runDelayedAnimations();
@@ -939,6 +947,18 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
939947

940948
@Override
941949
public boolean onTouchEvent(MotionEvent ev) {
950+
if ((maybeSwipeToBackGesture || swipeToBackGesture) && (ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL)) {
951+
maybeSwipeToBackGesture = false;
952+
if (swipeToBackGesture) {
953+
if (ev.getActionMasked() == MotionEvent.ACTION_UP && Math.abs(swipeToBackDy) > AndroidUtilities.dp(120)) {
954+
groupCallActivity.fullscreenFor(null);
955+
} else {
956+
animateSwipeToBack(false);
957+
}
958+
}
959+
invalidate();
960+
}
961+
942962
if (!inFullscreenMode || (!maybeSwipeToBackGesture && !swipeToBackGesture && !tapGesture && !canZoomGesture && !isInPinchToZoomTouchMode && !zoomStarted && ev.getActionMasked() != MotionEvent.ACTION_DOWN) || fullscreenTextureView == null) {
943963
finishZoom();
944964
return false;
@@ -1021,18 +1041,6 @@ public boolean onTouchEvent(MotionEvent ev) {
10211041
invalidate();
10221042
}
10231043

1024-
if ((maybeSwipeToBackGesture || swipeToBackGesture) && ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) {
1025-
maybeSwipeToBackGesture = false;
1026-
if (swipeToBackGesture) {
1027-
if (ev.getActionMasked() == MotionEvent.ACTION_UP && Math.abs(swipeToBackDy) > AndroidUtilities.dp(120)) {
1028-
groupCallActivity.fullscreenFor(null);
1029-
} else {
1030-
animateSwipeToBack(false);
1031-
}
1032-
}
1033-
invalidate();
1034-
}
1035-
10361044
if (!fullscreenTextureView.hasVideo || swipeToBackGesture) {
10371045
finishZoom();
10381046
return tapGesture || swipeToBackGesture || maybeSwipeToBackGesture;

TMessagesProj/src/main/java/org/telegram/ui/ContentPreviewViewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public void run() {
236236
});
237237
visibleDialog.show();
238238
containerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
239-
if (delegate.needRemove()) {
239+
if (delegate != null && delegate.needRemove()) {
240240
BottomSheet.BottomSheetCell cell = visibleDialog.getItemViews().get(0);
241241
cell.setTextColor(Theme.getColor(Theme.key_dialogTextRed));
242242
cell.setIconColor(Theme.getColor(Theme.key_dialogRedIcon));

0 commit comments

Comments
 (0)