Skip to content

Commit

Permalink
update to 10.1.1 (3926)
Browse files Browse the repository at this point in the history
  • Loading branch information
xaxtix committed Sep 23, 2023
1 parent 750eedf commit fea5ca9
Show file tree
Hide file tree
Showing 55 changed files with 681 additions and 278 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ CMD mkdir -p /home/source/TMessagesProj/build/outputs/apk && \
cd /home/gradle && \
gradle :TMessagesProj_App:bundleBundleAfat_SDK23Release && \
gradle :TMessagesProj_App:bundleBundleAfatRelease && \
gradle :TMessagesProj_App:assembleAfatStandalone && \
gradle :TMessagesProj_AppStandalone:assembleAfatStandalone && \
gradle :TMessagesProj_App:assembleAfatRelease && \
gradle :TMessagesProj_AppHuawei:assembleAfatRelease && \
cp -R /home/gradle/TMessagesProj_App/build/outputs/apk/. /home/source/TMessagesProj/build/outputs/apk && \
cp -R /home/gradle/TMessagesProj_AppHuawei/build/outputs/apk/. /home/source/TMessagesProj/build/outputs/apk && \
cp -R /home/gradle/TMessagesProj_AppStandalone/build/outputs/apk/. /home/source/TMessagesProj/build/outputs/apk && \
cp -R /home/gradle/TMessagesProj_App/build/outputs/bundle/. /home/source/TMessagesProj/build/outputs/bundle && \
cp -R /home/gradle/TMessagesProj_App/build/outputs/native-debug-symbols/. /home/source/TMessagesProj/build/outputs/native-debug-symbols
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 3919;
public static String BUILD_VERSION_STRING = "10.1.0";
public static int BUILD_VERSION = 3926;
public static String BUILD_VERSION_STRING = "10.1.1";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1046,13 +1046,14 @@ private boolean onRequestComplete(String locationKey, String parentKey, TLObject
TLRPC.TL_stories_stories stories = (TLRPC.TL_stories_stories) response;
TLRPC.StoryItem newStoryItem = null;
if (!stories.stories.isEmpty()) {
if (stories.stories.get(0).media != null) {
newStoryItem = stories.stories.get(0);
if (stories.stories.get(0).media.photo != null) {
result = getFileReference(stories.stories.get(0).media.photo, requester.location, needReplacement, locationReplacement);
TLRPC.StoryItem storyItem = stories.stories.get(0);
if (storyItem.media != null) {
newStoryItem = storyItem;
if (storyItem.media.photo != null) {
result = getFileReference(storyItem.media.photo, requester.location, needReplacement, locationReplacement);
}
if (stories.stories.get(0).media.document != null) {
result = getFileReference(stories.stories.get(0).media.document, requester.location, needReplacement, locationReplacement);
if (storyItem.media.document != null) {
result = getFileReference(storyItem.media.document, requester.location, needReplacement, locationReplacement);
}
}
}
Expand All @@ -1075,6 +1076,14 @@ private boolean onRequestComplete(String locationKey, String parentKey, TLObject
MessagesController.getInstance(currentAccount).getStoriesController().getStoriesStorage().updateStoryItem(storyItem.dialogId, newStoryItem);
}
}
if (newStoryItem != null && result == null) {
TLRPC.TL_updateStory updateStory = new TLRPC.TL_updateStory();
updateStory.peer = MessagesController.getInstance(currentAccount).getPeer(storyItem.dialogId);
updateStory.story = newStoryItem;
ArrayList<TLRPC.Update> updates = new ArrayList<>();
updates.add(updateStory);
MessagesController.getInstance(currentAccount).processUpdateArray(updates, null, null, false, 0);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public class NotificationCenter {
public static final int uploadStoryEnd = totalEvents++;
public static final int customTypefacesLoaded = totalEvents++;
public static final int stealthModeChanged = totalEvents++;
public static final int onReceivedChannelDifference = totalEvents++;
public static final int onReceivedChannelDifference = totalEvents++;;

public static boolean alreadyLogged;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import android.media.SoundPool;
import android.net.Uri;
import android.os.Build;
import android.os.Looper;
import android.os.PowerManager;
import android.os.SystemClock;
import android.provider.Settings;
Expand Down Expand Up @@ -284,6 +285,24 @@ public static void checkOtherNotificationsChannel() {
private static final LongSparseArray<String> sharedPrefCachedKeys = new LongSparseArray<>();

public static String getSharedPrefKey(long dialog_id, int topicId) {
return getSharedPrefKey(dialog_id, topicId, false);
}

public static String getSharedPrefKey(long dialog_id, int topicId, boolean backgroundThread) {
if (backgroundThread) {
String key;
if (topicId != 0) {
key = String.format(Locale.US, "%d_%d",dialog_id, topicId);
} else {
key = String.valueOf(dialog_id);
}
return key;
}
// if (BuildVars.DEBUG_PRIVATE_VERSION) {
// if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
// throw new IllegalStateException("Not on main thread!");
// }
// }
long hash = dialog_id + ((long) topicId << 12);
int index = sharedPrefCachedKeys.indexOfKey(hash);
if (index >= 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public NotificationsSettingsFacade(int currentAccount) {


public boolean isDefault(long dialogId, int topicId) {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
return false;
}

public void clearPreference(long dialogId, int topicId) {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
getPreferences().edit()
.remove(PROPERTY_NOTIFY + key)
.remove(PROPERTY_CUSTOM + key)
Expand All @@ -44,20 +44,20 @@ public void clearPreference(long dialogId, int topicId) {


public int getProperty(String property, long dialogId, int topicId, int defaultValue) {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
if (getPreferences().contains(property + key)) {
return getPreferences().getInt(property + key, defaultValue);
}
key = NotificationsController.getSharedPrefKey(dialogId, 0);
key = NotificationsController.getSharedPrefKey(dialogId, 0, true);
return getPreferences().getInt(property + key, defaultValue);
}

public long getProperty(String property, long dialogId, int topicId, long defaultValue) {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
if (getPreferences().contains(property + key)) {
return getPreferences().getLong(property + key, defaultValue);
}
key = NotificationsController.getSharedPrefKey(dialogId, 0);
key = NotificationsController.getSharedPrefKey(dialogId, 0, true);
return getPreferences().getLong(property + key, defaultValue);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public void applyDialogNotificationsSettings(long dialogId, int topicId, TLRPC.P
return;
}
Utilities.globalQueue.postRunnable(() -> {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
MessagesController messagesController = MessagesController.getInstance(currentAccount);
ConnectionsManager connectionsManager = ConnectionsManager.getInstance(currentAccount);
MessagesStorage messagesStorage = MessagesStorage.getInstance(currentAccount);
Expand Down Expand Up @@ -191,7 +191,7 @@ public void applySoundSettings(TLRPC.NotificationSound settings, SharedPreferenc
String soundPathPref;
String soundDocPref;
if (dialogId != 0) {
String key = NotificationsController.getSharedPrefKey(dialogId, topicId);
String key = NotificationsController.getSharedPrefKey(dialogId, topicId, true);
soundPref = "sound_" + key;
soundPathPref = "sound_path_" + key;
soundDocPref = "sound_document_id_" + key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ public void preparePlayer(Uri uri, boolean audioDisabled) {
});
}

public void start(boolean paused, Uri uri, long t, boolean audioDisabled) {
public void start(boolean paused, Uri uri, long position, boolean audioDisabled) {
startTime = System.currentTimeMillis();
this.audioDisabled = audioDisabled;
this.paused = paused;
if (position > 0) {
currentPosition = position;
}
dispatchQueue.postRunnable(initRunnable = () -> {
if (released) {
return;
Expand All @@ -134,8 +137,8 @@ public void start(boolean paused, Uri uri, long t, boolean audioDisabled) {
videoPlayer.play();
}
}
if (t > 0) {
videoPlayer.seekTo(t);
if (position > 0) {
videoPlayer.seekTo(position);
}

// videoPlayer.setVolume(isInSilentMode ? 0 : 1f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ public void onPause() {
FileLog.e(e);
}
if (storyViewer != null) {
storyViewer.onPause();
storyViewer.updatePlayingMode();
}
if (overlayStoryViewer != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public static class PollButton {
private int descriptionX;
private int titleX;
private int authorX;
private boolean siteNameRtl;
private float siteNameLeft, siteNameLayoutWidth;
private int siteNameWidth;
private StaticLayout siteNameLayout;
private StaticLayout titleLayout;
Expand Down Expand Up @@ -5046,7 +5046,11 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
siteNameLayout = generateStaticLayout(site_name, Theme.chat_replyNamePaint, linkPreviewMaxWidth, linkPreviewMaxWidth - smallImageSide - smallSideMargin, restLinesCount, 1);
restLinesCount -= siteNameLayout.getLineCount();
}
siteNameRtl = Math.max(siteNameLayout.getLineLeft(0), 0) != 0;
siteNameLeft = siteNameLayoutWidth = 0;
for (int i = 0; i < siteNameLayout.getLineCount(); ++i) {
siteNameLeft = siteNameLayout.getLineLeft(i);
siteNameLayoutWidth = siteNameLayout.getLineWidth(i);
}
int height = siteNameLayout.getLineBottom(siteNameLayout.getLineCount() - 1);
linkPreviewHeight += height;
totalHeight += height;
Expand Down Expand Up @@ -7675,7 +7679,11 @@ private void setMessageContent(MessageObject messageObject, MessageObject.Groupe
try {
int width = siteNameWidth = (int) Math.ceil(Theme.chat_replyNamePaint.measureText(webPage.site_name) + 1);
siteNameLayout = new StaticLayout(webPage.site_name, Theme.chat_replyNamePaint, Math.min(width, linkPreviewMaxWidth), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
siteNameRtl = siteNameLayout.getLineLeft(0) != 0;
siteNameLeft = siteNameLayoutWidth = 0;
for (int i = 0; i < siteNameLayout.getLineCount(); ++i) {
siteNameLeft = siteNameLayout.getLineLeft(i);
siteNameLayoutWidth = siteNameLayout.getLineWidth(i);
}
int height = siteNameLayout.getLineBottom(siteNameLayout.getLineCount() - 1);
linkPreviewHeight += height;
totalHeight += height;
Expand Down Expand Up @@ -10233,12 +10241,7 @@ protected void onOpen() {
if (siteNameLayout != null) {
Theme.chat_replyNamePaint.setColor(getThemedColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outSiteNameText : Theme.key_chat_inSiteNameText));
canvas.save();
int x;
if (siteNameRtl) {
x = backgroundWidth - siteNameWidth - AndroidUtilities.dp(32);
} else {
x = (hasInvoicePreview ? 0 : AndroidUtilities.dp(10));
}
float x = -siteNameLeft + (hasInvoicePreview ? 0 : AndroidUtilities.dp(10));
canvas.translate(linkX + x, linkPreviewY - AndroidUtilities.dp(3));
siteNameLayout.draw(canvas);
canvas.restore();
Expand Down Expand Up @@ -10599,15 +10602,7 @@ public void drawLinkPreview(Canvas canvas, float alpha) {
Theme.chat_replyNamePaint.setAlpha((int) (alpha * Theme.chat_replyLinePaint.getAlpha()));
}
canvas.save();
int x;
if (siteNameRtl) {
x = backgroundWidth - siteNameWidth - AndroidUtilities.dp(32);
if (isSmallImage) {
x -= AndroidUtilities.dp(48 + 6);
}
} else {
x = (hasInvoicePreview ? 0 : AndroidUtilities.dp(10));
}
float x = -siteNameLeft + (hasInvoicePreview ? 0 : AndroidUtilities.dp(10));
canvas.translate(linkX + x, linkPreviewY - AndroidUtilities.dp(3));
siteNameLayout.draw(canvas);
canvas.restore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public FeaturedStickerSetCell2(Context context, Theme.ResourcesProvider resource
delButton.setText(LocaleController.getString("StickersRemove", R.string.StickersRemove));
addView(delButton, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, 28, Gravity.TOP | Gravity.END, 0, 16, 14, 0));

unlockButton = new PremiumButtonView(context, AndroidUtilities.dp(4), false);
unlockButton = new PremiumButtonView(context, AndroidUtilities.dp(4), false, resourcesProvider);
unlockButton.setIcon(R.raw.unlock_icon);
unlockButton.setButton(LocaleController.getString("Unlock", R.string.Unlock), e -> onPremiumButtonClick());
unlockButton.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public void openStory(long dialogId, Runnable onDone) {
public static final MessageSeenCheckDrawable reactDrawable = new MessageSeenCheckDrawable(R.drawable.msg_reactions, Theme.key_windowBackgroundWhiteGrayText, 16, 16, 5.66f);

public ReactedUserHolderView(int style, int currentAccount, @NonNull Context context, Theme.ResourcesProvider resourcesProvider) {
this(style, currentAccount, context, resourcesProvider, true);
}

public ReactedUserHolderView(int style, int currentAccount, @NonNull Context context, Theme.ResourcesProvider resourcesProvider, boolean useOverlaySelector) {
super(context);
this.style = style;
this.currentAccount = currentAccount;
Expand Down Expand Up @@ -145,9 +149,11 @@ public boolean setText(CharSequence value) {
reactView = new BackupImageView(context);
addView(reactView, LayoutHelper.createFrameRelatively(24, 24, Gravity.END | Gravity.CENTER_VERTICAL, 0, 0, 12, 0));

overlaySelectorView = new View(context);
overlaySelectorView.setBackground(Theme.getSelectorDrawable(false));
addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
if (useOverlaySelector) {
overlaySelectorView = new View(context);
overlaySelectorView.setBackground(Theme.getSelectorDrawable(false));
addView(overlaySelectorView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
}
}

public void setUserReaction(TLRPC.User user, TLRPC.Chat chat, TLRPC.Reaction reaction, boolean like, long date, boolean dateIsSeen, boolean animated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public StickerSetCell(Context context, Theme.ResourcesProvider resourcesProvider
removeButtonView.setOnClickListener(e -> onRemoveButtonClick());
sideButtons.addView(removeButtonView, LayoutHelper.createFrameRelatively(LayoutHelper.WRAP_CONTENT, 32, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 0, -2, 0, 0));

premiumButtonView = new PremiumButtonView(context, AndroidUtilities.dp(4), false);
premiumButtonView = new PremiumButtonView(context, AndroidUtilities.dp(4), false, resourcesProvider);
premiumButtonView.setIcon(R.raw.unlock_icon);
premiumButtonView.setButton(LocaleController.getString("Unlock", R.string.Unlock), e -> onPremiumButtonClick());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
StatisticActivity.OverviewCell overviewCell = (StatisticActivity.OverviewCell) holder.itemView;

overviewCell.setData(0, Integer.toString(boostsStatus.level), null, LocaleController.getString("BoostsLevel2", R.string.BoostsLevel2));
if (boostsStatus.premium_audience != null || boostsStatus.premium_audience.total == 0) {
overviewCell.setData(1, "~" + (int) boostsStatus.premium_audience.part, String.format(Locale.US, "%.1f", (float) boostsStatus.premium_audience.part / (float) boostsStatus.premium_audience.total) + "%", LocaleController.getString("PremiumSubscribers", R.string.PremiumSubscribers));
if (boostsStatus.premium_audience != null && boostsStatus.premium_audience.total == 0) {
float percent = (((float) boostsStatus.premium_audience.part / (float) boostsStatus.premium_audience.total) * 100f);
overviewCell.setData(1, "~" + (int) boostsStatus.premium_audience.part, String.format(Locale.US, "%.1f",percent) + "%", LocaleController.getString("PremiumSubscribers", R.string.PremiumSubscribers));
} else {
overviewCell.setData(1, "~0", "0%", LocaleController.getString("PremiumSubscribers", R.string.PremiumSubscribers));
}
Expand Down Expand Up @@ -303,6 +304,7 @@ private void loadUsers() {
usersLoading = false;
if (response != null) {
TLRPC.TL_stories_boostersList list = (TLRPC.TL_stories_boostersList) response;
MessagesController.getInstance(currentAccount).putUsers(list.users, false);
boosters.addAll(list.boosters);
hasNext = !TextUtils.isEmpty(list.next_offset) && boosters.size() < list.count;
nextRemaining = list.count - boosters.size();
Expand Down
Loading

1 comment on commit fea5ca9

@Suburbanno
Copy link

Choose a reason for hiding this comment

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

update repo to new version 😡

Please sign in to comment.