Skip to content

Commit

Permalink
update to 10.14.3 (4927)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkaraush committed Jul 3, 2024
1 parent 59a0bc1 commit a982429
Show file tree
Hide file tree
Showing 69 changed files with 2,164 additions and 1,336 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/jni/gifvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ enum PARAM_NUM {
PARAM_NUM_COUNT = 11,
};

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

char const *srcString = env->GetStringUTFChars(src, 0);
Expand Down
13 changes: 13 additions & 0 deletions TMessagesProj/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="ton"/>
</intent>

<package android:name="com.android.chrome" />
<package android:name="org.mozilla.firefox" />
<package android:name="com.microsoft.emmx" />
<package android:name="com.opera.browser" />
<package android:name="com.opera.mini.native" />
<package android:name="com.brave.browser" />
<package android:name="com.duckduckgo.mobile.android" />
<package android:name="com.sec.android.app.sbrowser" />
<package android:name="com.vivaldi.browser" />
<package android:name="com.kiwibrowser.browser" />
<package android:name="com.UCMobile.intl" />
<package android:name="org.torproject.torbrowser" />
</queries>

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ public String getValue(boolean format) {
calendar.set(Calendar.YEAR, Utilities.parseInt(date[0]));
calendar.set(Calendar.MONTH, Utilities.parseInt(date[1]) - 1);
calendar.set(Calendar.DAY_OF_MONTH, Utilities.parseInt(date[2]));
return LocaleController.getInstance().formatterYearMax.format(calendar.getTime());
return LocaleController.getInstance().getFormatterYearMax().format(calendar.getTime());
}
}
}
Expand Down Expand Up @@ -5933,17 +5933,41 @@ public static boolean isWebAppLink(String url) {
case "http":
case "https": {
if (path.isEmpty()) return false;
ArrayList<String> segments = new ArrayList<>(uri.getPathSegments());
if (segments.size() > 0 && segments.get(0).equals("s")) {
segments.remove(0);
}
if (segments.size() > 0) {
if (segments.size() >= 3 && "s".equals(segments.get(1))) {
return false;
} else if (segments.size() > 1) {
return !TextUtils.isEmpty(segments.get(1));
} else if (segments.size() == 1) {
return !TextUtils.isEmpty(uri.getQueryParameter("startapp"));
String host = uri.getHost().toLowerCase();
Matcher prefixMatcher = LaunchActivity.PREFIX_T_ME_PATTERN.matcher(host);
boolean isPrefix = prefixMatcher.find();
if (host.equals("telegram.me") || host.equals("t.me") || host.equals("telegram.dog") || isPrefix) {
ArrayList<String> segments = new ArrayList<>(uri.getPathSegments());
if (segments.size() > 0 && segments.get(0).equals("s")) {
segments.remove(0);
}
if (segments.size() > 0) {
if (segments.size() >= 3 && "s".equals(segments.get(1))) {
return false;
} else if (segments.size() > 1) {
final String segment = segments.get(1);
if (TextUtils.isEmpty(segment)) return false;
switch (segment) {
case "joinchat":
case "login":
case "addstickers":
case "addemoji":
case "msg":
case "share":
case "confirmphone":
case "setlanguage":
case "addtheme":
case "boost":
case "c":
case "contact":
case "folder":
case "addlist":
return false;
}
return true;
} else if (segments.size() == 1) {
return !TextUtils.isEmpty(uri.getQueryParameter("startapp"));
}
}
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,48 +379,50 @@ public String getInviteText(int contacts) {
}

public void checkAppAccount() {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
try {
Account[] accounts = am.getAccountsByType("org.telegram.messenger");
systemAccount = null;
for (int a = 0; a < accounts.length; a++) {
Account acc = accounts[a];
boolean found = false;
for (int b = 0; b < UserConfig.MAX_ACCOUNT_COUNT; b++) {
TLRPC.User user = UserConfig.getInstance(b).getCurrentUser();
if (user != null) {
if (acc.name.equals("" + user.id)) {
if (b == currentAccount) {
systemAccount = acc;
systemAccount = null;
Utilities.globalQueue.postRunnable(() -> {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
try {
Account[] accounts = am.getAccountsByType("org.telegram.messenger");
for (int a = 0; a < accounts.length; a++) {
Account acc = accounts[a];
boolean found = false;
for (int b = 0; b < UserConfig.MAX_ACCOUNT_COUNT; b++) {
TLRPC.User user = UserConfig.getInstance(b).getCurrentUser();
if (user != null) {
if (acc.name.equals("" + user.id)) {
if (b == currentAccount) {
systemAccount = acc;
}
found = true;
break;
}
found = true;
break;
}
}
}
if (!found) {
try {
am.removeAccount(accounts[a], null, null);
} catch (Exception ignore) {
if (!found) {
try {
am.removeAccount(accounts[a], null, null);
} catch (Exception ignore) {

}
}

}
} catch (Throwable ignore) {

}
} catch (Throwable ignore) {

}
if (getUserConfig().isClientActivated()) {
readContacts();
if (systemAccount == null) {
try {
systemAccount = new Account("" + getUserConfig().getClientUserId(), "org.telegram.messenger");
am.addAccountExplicitly(systemAccount, "", null);
} catch (Exception ignore) {
if (getUserConfig().isClientActivated()) {
readContacts();
if (systemAccount == null) {
try {
systemAccount = new Account("" + getUserConfig().getClientUserId(), "org.telegram.messenger");
am.addAccountExplicitly(systemAccount, "", null);
} catch (Exception ignore) {

}
}
}
}
});
}

public void deleteUnknownAppAccounts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,11 @@ public void run() {
if ((isAnimatedAvatar(cacheImage.filter) || AUTOPLAY_FILTER.equals(cacheImage.filter)) && !(cacheImage.imageLocation.document instanceof TLRPC.TL_documentEncrypted) && !precache) {
TLRPC.Document document = cacheImage.imageLocation.document instanceof TLRPC.Document ? cacheImage.imageLocation.document : null;
long size = document != null ? cacheImage.size : cacheImage.imageLocation.currentSize;
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);
int cacheType = document != null ? 1 : 0;
if (cacheImage.cacheType > 1) {
cacheType = cacheImage.cacheType;
}
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);
fileDrawable.setIsWebmSticker(MessageObject.isWebM(document) || MessageObject.isVideoSticker(document) || isAnimatedAvatar(cacheImage.filter));
} else {

Expand Down
Loading

0 comments on commit a982429

Please sign in to comment.