Skip to content

Commit 071d511

Browse files
committed
Update to 5.15.0 (1866)
1 parent 2eafc07 commit 071d511

File tree

15 files changed

+63
-36
lines changed

15 files changed

+63
-36
lines changed

TMessagesProj/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ android {
283283
}
284284
}
285285

286-
defaultConfig.versionCode = 1864
286+
defaultConfig.versionCode = 1866
287287

288288
applicationVariants.all { variant ->
289289
variant.outputs.all { output ->

TMessagesProj/jni/tgnet/ConnectionsManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,6 +3345,7 @@ void ConnectionsManager::pauseNetwork() {
33453345
}
33463346
lastMonotonicPauseTime = lastPauseTime = getCurrentTimeMonotonicMillis();
33473347
lastSystemPauseTime = getCurrentTime();
3348+
saveConfig();
33483349
}
33493350

33503351
void ConnectionsManager::setNetworkAvailable(bool value, int32_t type, bool slow) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ public static void checkDisplaySize(Context context, Configuration newConfigurat
13831383
roundMessageInset = dp(2);
13841384
}
13851385
if (BuildVars.LOGS_ENABLED) {
1386-
FileLog.e("display size = " + displaySize.x + " " + displaySize.y + " " + displayMetrics.xdpi + "x" + displayMetrics.ydpi);
1386+
FileLog.e("density = " + density + " display size = " + displaySize.x + " " + displaySize.y + " " + displayMetrics.xdpi + "x" + displayMetrics.ydpi);
13871387
}
13881388
} catch (Exception e) {
13891389
FileLog.e(e);

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 TON_WALLET_STANDALONE = false;
22-
public static int BUILD_VERSION = 1864;
22+
public static int BUILD_VERSION = 1866;
2323
public static String BUILD_VERSION_STRING = "5.15.0";
2424
public static int APP_ID = 4;
2525
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,8 @@ public static int getMediaType(TLRPC.Message message) {
20192019
return MEDIA_PHOTOVIDEO;
20202020
} else if (MessageObject.isStickerMessage(message) || MessageObject.isAnimatedStickerMessage(message)) {
20212021
return -1;
2022+
} else if (MessageObject.isNewGifMessage(message)) {
2023+
return -1;
20222024
} else if (MessageObject.isMusicMessage(message)) {
20232025
return MEDIA_MUSIC;
20242026
} else {
@@ -2051,7 +2053,7 @@ public static boolean canAddMessageToMedia(TLRPC.Message message) {
20512053
}
20522054
}
20532055
}
2054-
return false;
2056+
return MediaDataController.getMediaType(message) != -1;
20552057
}
20562058

20572059
private void processLoadedMedia(final TLRPC.messages_Messages res, final long uid, int count, int max_id, final int type, final int fromCache, final int classGuid, final boolean isChannel, final boolean topReached) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,7 +3213,7 @@ protected void deleteDialog(final long did, final boolean first, final int onlyH
32133213
} else {
32143214
TLRPC.TL_messages_deleteHistory req = new TLRPC.TL_messages_deleteHistory();
32153215
req.peer = peer;
3216-
req.max_id = (onlyHistory == 0 ? Integer.MAX_VALUE : max_id_delete);
3216+
req.max_id = max_id_delete > 0 ? max_id_delete : Integer.MAX_VALUE;
32173217
req.just_clear = onlyHistory != 0;
32183218
req.revoke = revoke;
32193219
final int max_id_delete_final = max_id_delete;
@@ -3444,7 +3444,7 @@ public void updateTimerProc() {
34443444
array.put(req.id.get(a1), (Integer) vector.objects.get(a1));
34453445
}
34463446
getMessagesStorage().putChannelViews(channelViews, req.peer instanceof TLRPC.TL_inputPeerChannel);
3447-
AndroidUtilities.runOnUIThread(() -> getNotificationCenter().postNotificationName(NotificationCenter.didUpdatedMessagesViews, channelViews));
3447+
AndroidUtilities.runOnUIThread(() -> getNotificationCenter().postNotificationName(NotificationCenter.didUpdateMessagesViews, channelViews));
34483448
}
34493449
});
34503450
}
@@ -10818,7 +10818,7 @@ public boolean processUpdateArray(ArrayList<TLRPC.Update> updates, final ArrayLi
1081810818
}
1081910819
}
1082010820
if (channelViewsFinal != null) {
10821-
getNotificationCenter().postNotificationName(NotificationCenter.didUpdatedMessagesViews, channelViewsFinal);
10821+
getNotificationCenter().postNotificationName(NotificationCenter.didUpdateMessagesViews, channelViewsFinal);
1082210822
}
1082310823
if (updateMask != 0) {
1082410824
getNotificationCenter().postNotificationName(NotificationCenter.updateInterfaces, updateMask);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class NotificationCenter {
7272
public static final int musicDidLoad = totalEvents++;
7373
public static final int needShowAlert = totalEvents++;
7474
public static final int needShowPlayServicesAlert = totalEvents++;
75-
public static final int didUpdatedMessagesViews = totalEvents++;
75+
public static final int didUpdateMessagesViews = totalEvents++;
7676
public static final int needReloadRecentDialogsSearch = totalEvents++;
7777
public static final int peerSettingsDidLoad = totalEvents++;
7878
public static final int wasUnableToFindCurrentLocation = totalEvents++;

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ public Drawable getBackgroundDrawable() {
243243
idx = 0;
244244
}
245245
int idx2 = isSelected ? 1 : 0;
246+
boolean forceSetColor = false;
246247
if (currentBackgroundDrawableRadius[idx2][idx] != newRad) {
247248
currentBackgroundDrawableRadius[idx2][idx] = newRad;
248249
try {
@@ -256,7 +257,7 @@ public Drawable getBackgroundDrawable() {
256257
draw(canvas, shadowPaint);
257258

258259
backgroundDrawable[idx2][idx] = new NinePatchDrawable(bitmap, getByteBuffer(bitmap.getWidth() / 2 - 1, bitmap.getWidth() / 2 + 1, bitmap.getHeight() / 2 - 1, bitmap.getHeight() / 2 + 1).array(), new Rect(), null);
259-
backgroundDrawableColor[idx2][idx] = 0;
260+
forceSetColor = true;
260261
setBounds(backupRect);
261262
} catch (Throwable ignore) {
262263

@@ -268,7 +269,7 @@ public Drawable getBackgroundDrawable() {
268269
} else {
269270
color = getColor(isOut ? key_chat_outBubble : key_chat_inBubble);
270271
}
271-
if (backgroundDrawable[idx2][idx] != null && backgroundDrawableColor[idx2][idx] != color) {
272+
if (backgroundDrawable[idx2][idx] != null && (backgroundDrawableColor[idx2][idx] != color || forceSetColor)) {
272273
backgroundDrawable[idx2][idx].setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY));
273274
backgroundDrawableColor[idx2][idx] = color;
274275
}
@@ -287,6 +288,7 @@ public Drawable getShadowDrawable() {
287288
} else {
288289
idx = 0;
289290
}
291+
boolean forceSetColor = false;
290292
if (currentShadowDrawableRadius[idx] != newRad) {
291293
currentShadowDrawableRadius[idx] = newRad;
292294
try {
@@ -315,13 +317,13 @@ public Drawable getShadowDrawable() {
315317
}
316318

317319
shadowDrawable[idx] = new NinePatchDrawable(bitmap, getByteBuffer(bitmap.getWidth() / 2 - 1, bitmap.getWidth() / 2 + 1, bitmap.getHeight() / 2 - 1, bitmap.getHeight() / 2 + 1).array(), new Rect(), null);
318-
shadowDrawableColor[idx] = 0;
320+
forceSetColor = true;
319321
} catch (Throwable ignore) {
320322

321323
}
322324
}
323325
int color = getColor(isOut ? key_chat_outBubbleShadow : key_chat_inBubbleShadow);
324-
if (shadowDrawable[idx] != null && shadowDrawableColor[idx] != color) {
326+
if (shadowDrawable[idx] != null && (shadowDrawableColor[idx] != color || forceSetColor)) {
325327
shadowDrawable[idx].setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY));
326328
shadowDrawableColor[idx] = color;
327329
}
@@ -527,6 +529,10 @@ public void setAlpha(int alpha) {
527529
if (isOut) {
528530
selectedPaint.setAlpha((int) (Color.alpha(getColor(key_chat_outBubbleGradientSelectedOverlay)) * (alpha / 255.0f)));
529531
}
532+
if (gradientShader == null) {
533+
Drawable background = getBackgroundDrawable();
534+
background.setAlpha(alpha);
535+
}
530536
}
531537

532538
@Override

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,7 @@ public void toggleSubMenu() {
36423642
progressView = new ContextProgressView(activity, 2);
36433643
progressView.setVisibility(View.GONE);
36443644
menuContainer.addView(progressView, LayoutHelper.createFrame(48, 56));
3645+
menuButton.setOnClickListener(v -> menuButton.toggleSubMenu());
36453646
menuButton.setDelegate(id -> {
36463647
if (currentPage == null || parentActivity == null) {
36473648
return;

TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedAudioCell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
450450
super.onInitializeAccessibilityNodeInfo(info);
451451
if (currentMessageObject.isMusic()) {
452452
info.setText(LocaleController.formatString("AccDescrMusicInfo", R.string.AccDescrMusicInfo, currentMessageObject.getMusicAuthor(), currentMessageObject.getMusicTitle()));
453-
} else { // voice message
453+
} else if (titleLayout != null && descriptionLayout != null) {
454454
info.setText(titleLayout.getText() + ", " + descriptionLayout.getText());
455455
}
456456
if (checkBox.isChecked()) {

0 commit comments

Comments
 (0)