Skip to content

Commit

Permalink
fix: merge 9.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Aug 11, 2023
1 parent 1d357ca commit 3facd9f
Show file tree
Hide file tree
Showing 20 changed files with 156 additions and 274 deletions.
1 change: 1 addition & 0 deletions TMessagesProj/jni/TgNetWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ static JNINativeMethod ConnectionsManagerMethods[] = {
{"native_setNetworkAvailable", "(IZIZ)V", (void *) setNetworkAvailable},
{"native_setPushConnectionEnabled", "(IZ)V", (void *) setPushConnectionEnabled},
{"native_setJava", "(Z)V", (void *) setJava},
{"native_setJava", "(I)V", (void *) setJava1},
{"native_applyDnsConfig", "(IJLjava/lang/String;I)V", (void *) applyDnsConfig},
{"native_checkProxy", "(ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/telegram/tgnet/RequestTimeDelegate;)J", (void *) checkProxy},
{"native_onHostNameResolved", "(Ljava/lang/String;JLjava/lang/String;Z)V", (void *) onHostNameResolved},
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/jni/ffmpeg
Submodule ffmpeg added at 4bc4ca
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
import static android.os.Build.VERSION.SDK_INT;

public class ApplicationLoader extends Application {

private static ApplicationLoader applicationLoaderInstance;

private static PendingIntent pendingIntent;

@SuppressLint("StaticFieldLeak")
Expand Down Expand Up @@ -285,6 +288,7 @@ public ApplicationLoader() {

@Override
public void onCreate() {
applicationLoaderInstance = this;
try {
applicationContext = getApplicationContext();
} catch (Throwable ignore) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import com.google.android.exoplayer2.util.Util;

import org.telegram.messenger.utils.BillingUtilities;
//import org.telegram.messenger.utils.BillingUtilities;
import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.PremiumPreviewFragment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17533,7 +17533,6 @@ public boolean canAddToForward(TLRPC.Dialog d) {
}
}
return canAddToForward;
>>>>>>> off/master
}

public void sortDialogs(LongSparseArray<TLRPC.Chat> chatsDict) {
Expand Down Expand Up @@ -18522,7 +18521,7 @@ public StoriesController getStoriesController() {
if (storiesController != null) {
return storiesController;
}
synchronized (lockObjects[currentAccount]) {
synchronized (lockObject) {
if (storiesController != null) {
return storiesController;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9188,16 +9188,12 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
if (timeTextWidth < 0) {
timeTextWidth = AndroidUtilities.dp(10);
}
<<<<<<< HEAD
CharSequence currentTime = Emoji.replaceEmoji(currentTimeString, Theme.chat_timePaint.getFontMetricsInt(), AndroidUtilities.dp(12), false);
timeLayout = new StaticLayout(currentTime, Theme.chat_timePaint, timeTextWidth + AndroidUtilities.dp(100), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
=======
if (currentTimeString != null) {
timeLayout = new StaticLayout(currentTimeString, Theme.chat_timePaint, timeTextWidth + AndroidUtilities.dp(100), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
CharSequence currentTime = Emoji.replaceEmoji(currentTimeString, Theme.chat_timePaint.getFontMetricsInt(), AndroidUtilities.dp(12), false);
timeLayout = new StaticLayout(currentTime, Theme.chat_timePaint, timeTextWidth + AndroidUtilities.dp(100), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
} else {
timeLayout = null;
}
>>>>>>> off/master
if (mediaBackground) {
if (currentMessageObject.isOutOwner()) {
timeX = layoutWidth - timeWidth - AndroidUtilities.dp(42.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ public void setTextAndCheck(String text, boolean checked, boolean divider) {
setWillNotDraw(!divider);
}

public void setColors(String key, String switchKey, String switchKeyChecked, String switchThumb, String switchThumbChecked) {
textView.setTextColor(Theme.getColor(key));
checkBox.setColors(switchKey, switchKeyChecked, switchThumb, switchThumbChecked);
textView.setTag(key);
}

public void setTypeface(Typeface typeface) {
textView.setTypeface(typeface);
}
Expand Down
9 changes: 4 additions & 5 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4244,7 +4244,7 @@ private void processTouchEvent(MotionEvent e) {
currentEncryptedChat == null && message.getId() < 0 ||
bottomOverlayChat != null && bottomOverlayChat.getVisibility() == View.VISIBLE && !(bottomOverlayChatWaitsReply && allowReplyOnOpenTopic || message.wasJustSent) ||
currentChat != null && (ChatObject.isNotInChat(currentChat) && !isThreadChat() || ChatObject.isChannel(currentChat) && !ChatObject.canPost(currentChat) && !currentChat.megagroup || !ChatObject.canSendMessages(currentChat)) ||
textSelectionHelper.isSelectionMode()) {
textSelectionHelper.isInSelectionMode()) {
if (!canSendInCommentGroup()) {
slidingView.setSlidingOffset(0);
slidingView = null;
Expand Down Expand Up @@ -24922,7 +24922,7 @@ public void setAutoDeleteHistory(int time, int action) {
} else if (type == 21) {
items.add(LocaleController.getString("ImportProxyList", R.string.ImportProxyList));
options.add(5);
icons.add(R.drawable.proxy_on);
icons.add(R.drawable.msg2_proxy_on);
} else if (type == 7) {
items.add(LocaleController.getString("AddToStickers", R.string.AddToStickers));
options.add(OPTION_ADD_TO_STICKERS_OR_MASKS);
Expand Down Expand Up @@ -28864,7 +28864,6 @@ private void didPressMessageUrl(CharacterStyle url, boolean longPress, MessageOb
},
(which, text, __) -> {
if (which == 0) {
logSponsoredClicked(finalMessageObject);
processExternalUrl(1, urlFinal, url, finalCell, false);
} else if (which == 1 || which == 3) {
// Copy / ShareMessage
Expand Down Expand Up @@ -34152,7 +34151,7 @@ private void doRepeatMessage(boolean isLongClick, ArrayList<MessageObject> messa
}
} else if ((selectedObject.isSticker() || selectedObject.isAnimatedSticker()) && selectedObject.getDocument() != null) {
SendMessagesHelper.getInstance(currentAccount)
.sendSticker(selectedObject.getDocument(), null, dialog_id, replyTo, getThreadMessage(), null, null, true, 0, false);
.sendSticker(selectedObject.getDocument(), null, dialog_id, replyTo, getThreadMessage(), null, null, true, 0, false, null);
}
return;
}
Expand Down Expand Up @@ -34202,7 +34201,7 @@ public void invertReplyMessage(boolean isLongClick) {
} else if ((selectedObject.isSticker() || selectedObject.isAnimatedSticker()) && selectedObject.getDocument() != null) {
SendMessagesHelper.getInstance(currentAccount)
.sendSticker(selectedObject.getDocument(), null, dialog_id, replyTo, getThreadMessage(), null
, null, true, 0, false);
, null, true, 0, false, null);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11716,7 +11716,7 @@ protected void dispatchDraw(Canvas canvas) {
}
}

private int getThemedColor(int key) {
int getThemedColor(int key) {
Integer color = resourcesProvider != null ? resourcesProvider.getColor(key) : null;
return color != null ? color : Theme.getColor(key);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
marginLayoutParams = (MarginLayoutParams) backButtonView.getLayoutParams();
marginLayoutParams.topMargin = AndroidUtilities.dp(16) + statusBarHeight;

marginLayoutParams = (MarginLayoutParams) proxyButtonView.getLayoutParams();
marginLayoutParams.topMargin = AndroidUtilities.dp(16) + statusBarHeight;

marginLayoutParams = (MarginLayoutParams) radialProgressView.getLayoutParams();
marginLayoutParams.topMargin = AndroidUtilities.dp(16) + statusBarHeight;

Expand Down Expand Up @@ -7949,10 +7946,6 @@ private void updateColors() {
backButtonView.setColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
backButtonView.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector)));

proxyDrawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText), PorterDuff.Mode.SRC_IN));
proxyDrawable.setColorKey(Theme.key_windowBackgroundWhiteBlackText);
proxyButtonView.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector)));

radialProgressView.setProgressColor(Theme.getColor(Theme.key_chats_actionBackground));

floatingButtonIcon.setColor(Theme.getColor(Theme.key_chats_actionIcon));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9958,7 +9958,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
} else if (position == privacyRow) {
textCell.setTextAndIcon(LocaleController.getString("PrivacySettings", R.string.PrivacySettings), R.drawable.msg_secret, true);
} else if (position == dataRow) {
textCell.setTextAndIcon(LocaleController.getString("DataSettings", R.string.DataSettings), R.drawable.baseline_data_usage_24, true);
textCell.setTextAndIcon(LocaleController.getString("DataSettings", R.string.DataSettings), R.drawable.msg_filled_storageusage, true);
} else if (position == chatRow) {
textCell.setTextAndIcon(LocaleController.getString("ChatSettings", R.string.ChatSettings), R.drawable.msg_msgbubble3, true);
} else if (position == stickersRow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2976,7 +2976,7 @@ public void preload(int type, int account) {
}
}

private static boolean[] preloaded = new boolean[UserConfig.MAX_ACCOUNT_COUNT];
private static boolean[] preloaded = new boolean[SharedConfig.activeAccounts.size()];

public static void preload(int account) {
if (preloaded[account] || MediaDataController.getInstance(account) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.MessagesStorage;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.SharedConfig;
import org.telegram.messenger.UserConfig;
import org.telegram.messenger.support.LongSparseLongArray;
import org.telegram.tgnet.ConnectionsManager;
Expand All @@ -21,7 +22,7 @@

public class UserListPoller {

private static UserListPoller[] istances = new UserListPoller[UserConfig.MAX_ACCOUNT_COUNT];
private static UserListPoller[] istances = new UserListPoller[SharedConfig.activeAccounts.size()];

final int currentAccount;

Expand Down
Loading

0 comments on commit 3facd9f

Please sign in to comment.