Skip to content

Commit 36067f8

Browse files
committed
update to 10.0.5 (3804)
1 parent 534f9f6 commit 36067f8

15 files changed

+386
-48
lines changed

‎TMessagesProj/src/main/java/org/telegram/messenger/BillingController.java

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public String formatCurrency(long amount, String currency, int exp) {
101101

102102
@SuppressWarnings("ConstantConditions")
103103
public int getCurrencyExp(String currency) {
104+
BillingUtilities.extractCurrencyExp(currencyExpMap);
104105
return currencyExpMap.getOrDefault(currency, 0);
105106
}
106107

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class BuildVars {
2424
public static boolean USE_CLOUD_STRINGS = true;
2525
public static boolean CHECK_UPDATES = true;
2626
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
27-
public static int BUILD_VERSION = 3802;
28-
public static String BUILD_VERSION_STRING = "10.0.4";
27+
public static int BUILD_VERSION = 3804;
28+
public static String BUILD_VERSION_STRING = "10.0.5";
2929
public static int APP_ID = 4;
3030
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
3131

‎TMessagesProj/src/main/java/org/telegram/messenger/ImageReceiver.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class ImageReceiver implements NotificationCenter.NotificationCenterDeleg
5353

5454
List<ImageReceiver> preloadReceivers;
5555
private boolean allowCrossfadeWithImage = true;
56+
private boolean allowDrawWhileCacheGenerating;
5657

5758
public boolean updateThumbShaderMatrix() {
5859
if (currentThumbDrawable != null && thumbShader != null) {
@@ -84,6 +85,10 @@ public void updateStaticDrawableThump(Bitmap bitmap) {
8485
setStaticDrawable(new BitmapDrawable(bitmap));
8586
}
8687

88+
public void setAllowDrawWhileCacheGenerating(boolean allow) {
89+
allowDrawWhileCacheGenerating = allow;
90+
}
91+
8792
public interface ImageReceiverDelegate {
8893
void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb, boolean memCache);
8994

@@ -2249,7 +2254,11 @@ public boolean hasImageLoaded() {
22492254
}
22502255

22512256
public boolean hasNotThumb() {
2252-
return currentImageDrawable != null || currentMediaDrawable != null || staticThumbDrawable instanceof VectorAvatarThumbDrawable || (staticThumbDrawable != null && currentImageKey == null && currentMediaKey == null);
2257+
return currentImageDrawable != null || currentMediaDrawable != null || staticThumbDrawable instanceof VectorAvatarThumbDrawable;
2258+
}
2259+
2260+
public boolean hasNotThumbOrOnlyStaticThumb() {
2261+
return currentImageDrawable != null || currentMediaDrawable != null || staticThumbDrawable instanceof VectorAvatarThumbDrawable || (staticThumbDrawable != null && !(staticThumbDrawable instanceof AvatarDrawable) && currentImageKey == null && currentMediaKey == null);
22532262
}
22542263

22552264
public boolean hasStaticThumb() {
@@ -2824,6 +2833,7 @@ protected boolean setImageBitmapByKey(Drawable drawable, String key, int type, b
28242833
fileDrawable.setAutoRepeat(autoRepeat);
28252834
fileDrawable.setAutoRepeatCount(autoRepeatCount);
28262835
fileDrawable.setAutoRepeatTimeout(autoRepeatTimeout);
2836+
fileDrawable.setAllowDrawFramesWhileCacheGenerating(allowDrawWhileCacheGenerating);
28272837
animationReadySent = false;
28282838
}
28292839
invalidate();

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -3823,7 +3823,9 @@ private void updateMessageText(AbstractMap<Long, TLRPC.User> users, AbstractMap<
38233823
} else if (messageOwner.action instanceof TLRPC.TL_messageActionBotAllowed) {
38243824
String domain = ((TLRPC.TL_messageActionBotAllowed) messageOwner.action).domain;
38253825
TLRPC.BotApp botApp = ((TLRPC.TL_messageActionBotAllowed) messageOwner.action).app;
3826-
if (botApp != null) {
3826+
if (((TLRPC.TL_messageActionBotAllowed) messageOwner.action).from_request) {
3827+
messageText = LocaleController.getString(R.string.ActionBotAllowedWebapp);
3828+
} else if (botApp != null) {
38273829
String botAppTitle = botApp.title;
38283830
String text = LocaleController.getString("ActionBotAllowedApp", R.string.ActionBotAllowedApp);
38293831
int start = text.indexOf("%1$s");

‎TMessagesProj/src/main/java/org/telegram/tgnet/TLRPC.java

+54-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class TLRPC {
7474
public static final int MESSAGE_FLAG_HAS_BOT_ID = 0x00000800;
7575
public static final int MESSAGE_FLAG_EDITED = 0x00008000;
7676

77-
public static final int LAYER = 161;
77+
public static final int LAYER = 162;
7878

7979
public static class TL_stats_megagroupStats extends TLObject {
8080
public static int constructor = 0xef7ff916;
@@ -26688,12 +26688,14 @@ public static class TL_messageActionBotAllowed extends MessageAction {
2668826688
public static int constructor = 0xc516d679;
2668926689

2669026690
public boolean attach_menu;
26691+
public boolean from_request;
2669126692
public String domain;
2669226693
public BotApp app;
2669326694

2669426695
public void readParams(AbstractSerializedData stream, boolean exception) {
2669526696
flags = stream.readInt32(exception);
2669626697
attach_menu = (flags & 2) != 0;
26698+
from_request = (flags & 8) != 0;
2669726699
if ((flags & 1) != 0) {
2669826700
domain = stream.readString(exception);
2669926701
}
@@ -26705,6 +26707,7 @@ public void readParams(AbstractSerializedData stream, boolean exception) {
2670526707
public void serializeToStream(AbstractSerializedData stream) {
2670626708
stream.writeInt32(constructor);
2670726709
flags = attach_menu ? (flags | 2) : (flags &~ 2);
26710+
flags = from_request ? (flags | 8) : (flags &~ 8);
2670826711
stream.writeInt32(flags);
2670926712
if ((flags & 1) != 0) {
2671026713
stream.writeString(domain);
@@ -71082,6 +71085,56 @@ public void serializeToStream(AbstractSerializedData stream) {
7108271085
reaction.serializeToStream(stream);
7108371086
}
7108471087
}
71088+
71089+
public static class TL_bots_canSendMessage extends TLObject {
71090+
public static int constructor = 0x1359f4e6;
71091+
71092+
public InputUser bot;
71093+
71094+
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
71095+
return Bool.TLdeserialize(stream, constructor, exception);
71096+
}
71097+
71098+
public void serializeToStream(AbstractSerializedData stream) {
71099+
stream.writeInt32(constructor);
71100+
bot.serializeToStream(stream);
71101+
}
71102+
}
71103+
71104+
public static class TL_bots_allowSendMessage extends TLObject {
71105+
public static int constructor = 0xf132e3ef;
71106+
71107+
public InputUser bot;
71108+
71109+
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
71110+
return Updates.TLdeserialize(stream, constructor, exception);
71111+
}
71112+
71113+
public void serializeToStream(AbstractSerializedData stream) {
71114+
stream.writeInt32(constructor);
71115+
bot.serializeToStream(stream);
71116+
}
71117+
}
71118+
71119+
public static class TL_bots_invokeWebViewCustomMethod extends TLObject {
71120+
public static int constructor = 0x87fc5e7;
71121+
71122+
public InputUser bot;
71123+
public String custom_method;
71124+
public TL_dataJSON params;
71125+
71126+
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
71127+
return TL_dataJSON.TLdeserialize(stream, constructor, exception);
71128+
}
71129+
71130+
public void serializeToStream(AbstractSerializedData stream) {
71131+
stream.writeInt32(constructor);
71132+
bot.serializeToStream(stream);
71133+
stream.writeString(custom_method);
71134+
params.serializeToStream(stream);
71135+
}
71136+
}
71137+
7108571138
//functions
7108671139

7108771140
public static class Vector extends TLObject {

‎TMessagesProj/src/main/java/org/telegram/ui/ActionBar/FloatingToolbar.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ private void layoutOverflowPanelItems(List<MenuItem> menuItems) {
993993
final boolean premiumLocked = MessagesController.getInstance(UserConfig.selectedAccount).premiumLocked;
994994
for (int i = 0; i < size; i++) {
995995
final MenuItem menuItem = menuItems.get(i);
996-
if (!premiumOptions.contains(menuItem.getItemId()) || !premiumLocked) {
996+
if (premiumLockClickListener == null || premiumLocked && !premiumOptions.contains(menuItem.getItemId())) {
997997
overflowPanelAdapter.add(menuItem);
998998
}
999999
}

0 commit comments

Comments
 (0)