Skip to content

Commit a982429

Browse files
committed
update to 10.14.3 (4927)
1 parent 59a0bc1 commit a982429

File tree

69 files changed

+2164
-1336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2164
-1336
lines changed

TMessagesProj/jni/gifvideo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ enum PARAM_NUM {
840840
PARAM_NUM_COUNT = 11,
841841
};
842842

843-
extern "C" JNIEXPORT void JNICALL Java_org_telegram_ui_Components_AnimatedFileDrawable_getVideoInfo(JNIEnv *env, jclass clazz,jint sdkVersion, jstring src, jintArray data) {
843+
extern "C" JNIEXPORT void JNICALL Java_org_telegram_ui_Components_AnimatedFileDrawable_getVideoInfo(JNIEnv *env, jclass clazz, jint sdkVersion, jstring src, jintArray data) {
844844
VideoInfo *info = new VideoInfo();
845845

846846
char const *srcString = env->GetStringUTFChars(src, 0);

TMessagesProj/src/main/AndroidManifest.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@
8787
<action android:name="android.intent.action.VIEW"/>
8888
<data android:scheme="ton"/>
8989
</intent>
90+
91+
<package android:name="com.android.chrome" />
92+
<package android:name="org.mozilla.firefox" />
93+
<package android:name="com.microsoft.emmx" />
94+
<package android:name="com.opera.browser" />
95+
<package android:name="com.opera.mini.native" />
96+
<package android:name="com.brave.browser" />
97+
<package android:name="com.duckduckgo.mobile.android" />
98+
<package android:name="com.sec.android.app.sbrowser" />
99+
<package android:name="com.vivaldi.browser" />
100+
<package android:name="com.kiwibrowser.browser" />
101+
<package android:name="com.UCMobile.intl" />
102+
<package android:name="org.torproject.torbrowser" />
90103
</queries>
91104

92105
<application

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

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ public String getValue(boolean format) {
18431843
calendar.set(Calendar.YEAR, Utilities.parseInt(date[0]));
18441844
calendar.set(Calendar.MONTH, Utilities.parseInt(date[1]) - 1);
18451845
calendar.set(Calendar.DAY_OF_MONTH, Utilities.parseInt(date[2]));
1846-
return LocaleController.getInstance().formatterYearMax.format(calendar.getTime());
1846+
return LocaleController.getInstance().getFormatterYearMax().format(calendar.getTime());
18471847
}
18481848
}
18491849
}
@@ -5933,17 +5933,41 @@ public static boolean isWebAppLink(String url) {
59335933
case "http":
59345934
case "https": {
59355935
if (path.isEmpty()) return false;
5936-
ArrayList<String> segments = new ArrayList<>(uri.getPathSegments());
5937-
if (segments.size() > 0 && segments.get(0).equals("s")) {
5938-
segments.remove(0);
5939-
}
5940-
if (segments.size() > 0) {
5941-
if (segments.size() >= 3 && "s".equals(segments.get(1))) {
5942-
return false;
5943-
} else if (segments.size() > 1) {
5944-
return !TextUtils.isEmpty(segments.get(1));
5945-
} else if (segments.size() == 1) {
5946-
return !TextUtils.isEmpty(uri.getQueryParameter("startapp"));
5936+
String host = uri.getHost().toLowerCase();
5937+
Matcher prefixMatcher = LaunchActivity.PREFIX_T_ME_PATTERN.matcher(host);
5938+
boolean isPrefix = prefixMatcher.find();
5939+
if (host.equals("telegram.me") || host.equals("t.me") || host.equals("telegram.dog") || isPrefix) {
5940+
ArrayList<String> segments = new ArrayList<>(uri.getPathSegments());
5941+
if (segments.size() > 0 && segments.get(0).equals("s")) {
5942+
segments.remove(0);
5943+
}
5944+
if (segments.size() > 0) {
5945+
if (segments.size() >= 3 && "s".equals(segments.get(1))) {
5946+
return false;
5947+
} else if (segments.size() > 1) {
5948+
final String segment = segments.get(1);
5949+
if (TextUtils.isEmpty(segment)) return false;
5950+
switch (segment) {
5951+
case "joinchat":
5952+
case "login":
5953+
case "addstickers":
5954+
case "addemoji":
5955+
case "msg":
5956+
case "share":
5957+
case "confirmphone":
5958+
case "setlanguage":
5959+
case "addtheme":
5960+
case "boost":
5961+
case "c":
5962+
case "contact":
5963+
case "folder":
5964+
case "addlist":
5965+
return false;
5966+
}
5967+
return true;
5968+
} else if (segments.size() == 1) {
5969+
return !TextUtils.isEmpty(uri.getQueryParameter("startapp"));
5970+
}
59475971
}
59485972
}
59495973
break;

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

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -379,48 +379,50 @@ public String getInviteText(int contacts) {
379379
}
380380

381381
public void checkAppAccount() {
382-
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
383-
try {
384-
Account[] accounts = am.getAccountsByType("org.telegram.messenger");
385-
systemAccount = null;
386-
for (int a = 0; a < accounts.length; a++) {
387-
Account acc = accounts[a];
388-
boolean found = false;
389-
for (int b = 0; b < UserConfig.MAX_ACCOUNT_COUNT; b++) {
390-
TLRPC.User user = UserConfig.getInstance(b).getCurrentUser();
391-
if (user != null) {
392-
if (acc.name.equals("" + user.id)) {
393-
if (b == currentAccount) {
394-
systemAccount = acc;
382+
systemAccount = null;
383+
Utilities.globalQueue.postRunnable(() -> {
384+
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
385+
try {
386+
Account[] accounts = am.getAccountsByType("org.telegram.messenger");
387+
for (int a = 0; a < accounts.length; a++) {
388+
Account acc = accounts[a];
389+
boolean found = false;
390+
for (int b = 0; b < UserConfig.MAX_ACCOUNT_COUNT; b++) {
391+
TLRPC.User user = UserConfig.getInstance(b).getCurrentUser();
392+
if (user != null) {
393+
if (acc.name.equals("" + user.id)) {
394+
if (b == currentAccount) {
395+
systemAccount = acc;
396+
}
397+
found = true;
398+
break;
395399
}
396-
found = true;
397-
break;
398400
}
399401
}
400-
}
401-
if (!found) {
402-
try {
403-
am.removeAccount(accounts[a], null, null);
404-
} catch (Exception ignore) {
402+
if (!found) {
403+
try {
404+
am.removeAccount(accounts[a], null, null);
405+
} catch (Exception ignore) {
405406

407+
}
406408
}
409+
407410
}
411+
} catch (Throwable ignore) {
408412

409413
}
410-
} catch (Throwable ignore) {
411-
412-
}
413-
if (getUserConfig().isClientActivated()) {
414-
readContacts();
415-
if (systemAccount == null) {
416-
try {
417-
systemAccount = new Account("" + getUserConfig().getClientUserId(), "org.telegram.messenger");
418-
am.addAccountExplicitly(systemAccount, "", null);
419-
} catch (Exception ignore) {
414+
if (getUserConfig().isClientActivated()) {
415+
readContacts();
416+
if (systemAccount == null) {
417+
try {
418+
systemAccount = new Account("" + getUserConfig().getClientUserId(), "org.telegram.messenger");
419+
am.addAccountExplicitly(systemAccount, "", null);
420+
} catch (Exception ignore) {
420421

422+
}
421423
}
422424
}
423-
}
425+
});
424426
}
425427

426428
public void deleteUnknownAppAccounts() {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,11 @@ public void run() {
11031103
if ((isAnimatedAvatar(cacheImage.filter) || AUTOPLAY_FILTER.equals(cacheImage.filter)) && !(cacheImage.imageLocation.document instanceof TLRPC.TL_documentEncrypted) && !precache) {
11041104
TLRPC.Document document = cacheImage.imageLocation.document instanceof TLRPC.Document ? cacheImage.imageLocation.document : null;
11051105
long size = document != null ? cacheImage.size : cacheImage.imageLocation.currentSize;
1106-
fileDrawable = new AnimatedFileDrawable(cacheImage.finalFilePath, fistFrame, notCreateStream ? 0 : size, cacheImage.priority, notCreateStream ? null : document, document == null && !notCreateStream ? cacheImage.imageLocation : null, cacheImage.parentObject, seekTo, cacheImage.currentAccount, false, cacheOptions);
1106+
int cacheType = document != null ? 1 : 0;
1107+
if (cacheImage.cacheType > 1) {
1108+
cacheType = cacheImage.cacheType;
1109+
}
1110+
fileDrawable = new AnimatedFileDrawable(cacheImage.finalFilePath, fistFrame, notCreateStream ? 0 : size, cacheImage.priority, notCreateStream ? null : document, document == null && !notCreateStream ? cacheImage.imageLocation : null, cacheImage.parentObject, seekTo, cacheImage.currentAccount, false, 0, 0, cacheOptions, cacheType);
11071111
fileDrawable.setIsWebmSticker(MessageObject.isWebM(document) || MessageObject.isVideoSticker(document) || isAnimatedAvatar(cacheImage.filter));
11081112
} else {
11091113

0 commit comments

Comments
 (0)