Skip to content

Commit

Permalink
Merge remote-tracking branch 'official/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Jul 3, 2024
2 parents 0a54673 + a982429 commit cefa37a
Show file tree
Hide file tree
Showing 71 changed files with 2,170 additions and 1,344 deletions.
6 changes: 3 additions & 3 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ repositories {
}

def verName = "10.14.2"
def verCode = 1183
def verCode = 1184


def officialVer = "10.14.2"
def officialCode = 4911
def officialVer = "10.14.3"
def officialCode = 4927

def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")

Expand Down
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 @@ -121,6 +121,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 @@ -1850,7 +1850,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 @@ -5917,17 +5917,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 @@ -389,19 +389,22 @@ public String getInviteText(int contacts) {
}

public void checkAppAccount() {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
if (getUserConfig().isClientActivated()) {
readContacts();
if (systemAccount == null && !NekoConfig.disableSystemAccount.Bool()) {
try {
TLRPC.User user = getUserConfig().getCurrentUser();
systemAccount = new Account(formatName(user.first_name, user.last_name), BuildConfig.APPLICATION_ID);
am.addAccountExplicitly(systemAccount, "", null);
} catch (Exception e) {
FileLog.e(e);
systemAccount = null;
Utilities.globalQueue.postRunnable(() -> {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
if (getUserConfig().isClientActivated()) {
readContacts();
if (systemAccount == null && !NekoConfig.disableSystemAccount.Bool()) {
try {
TLRPC.User user = getUserConfig().getCurrentUser();
systemAccount = new Account(formatName(user.first_name, user.last_name), BuildConfig.APPLICATION_ID);
am.addAccountExplicitly(systemAccount, "", null);
} catch (Exception e) {
FileLog.e(e);
}
}
}
}
});
}

public void deleteUnknownAppAccounts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,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 cefa37a

Please sign in to comment.