Skip to content

Commit 89b0e31

Browse files
committed
update to 9.6.0
1 parent 683c4e6 commit 89b0e31

File tree

305 files changed

+17032
-4902
lines changed

Some content is hidden

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

305 files changed

+17032
-4902
lines changed

TMessagesProj/jni/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ target_include_directories(breakpad PUBLIC
435435
#voip
436436
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)
437437

438-
set(NATIVE_LIB "tmessages.44")
438+
set(NATIVE_LIB "tmessages.45")
439439

440440
#tmessages
441441
add_library(${NATIVE_LIB} SHARED
40 Bytes
Binary file not shown.
44 Bytes
Binary file not shown.
44 Bytes
Binary file not shown.
40 Bytes
Binary file not shown.

TMessagesProj/jni/gifvideo.cpp

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static const std::string av_make_error_str(int errnum) {
4040
jclass jclass_AnimatedFileDrawableStream;
4141
jmethodID jclass_AnimatedFileDrawableStream_read;
4242
jmethodID jclass_AnimatedFileDrawableStream_cancel;
43+
jmethodID jclass_AnimatedFileDrawableStream_isCanceled;
4344
jmethodID jclass_AnimatedFileDrawableStream_isFinishedLoadingFile;
4445
jmethodID jclass_AnimatedFileDrawableStream_getFinishedFilePath;
4546

@@ -792,7 +793,7 @@ int readCallback(void *opaque, uint8_t *buf, int buf_size) {
792793
javaVm->DetachCurrentThread();
793794
}
794795
if (buf_size == 0) {
795-
return AVERROR_EOF;
796+
return AVERROR_EXIT;
796797
}
797798
int ret = (int) read(info->fd, buf, (size_t) buf_size);
798799
if (ret <= 0) {
@@ -1102,7 +1103,7 @@ extern "C" JNIEXPORT void JNICALL Java_org_telegram_ui_Components_AnimatedFileDr
11021103
return;
11031104
}
11041105
int got_frame = 0;
1105-
int32_t tries = 1000;
1106+
int32_t tries = 100;
11061107
while (tries > 0) {
11071108
if (info->pkt.size == 0) {
11081109
ret = av_read_frame(info->fmt_ctx, &info->pkt);
@@ -1235,6 +1236,26 @@ extern "C" JNIEXPORT int JNICALL Java_org_telegram_ui_Components_AnimatedFileDra
12351236
int32_t tries = 1000;
12361237
bool readNextPacket = true;
12371238
while (tries > 0) {
1239+
if (info->stream != nullptr) {
1240+
JNIEnv *jniEnv = nullptr;
1241+
JavaVMAttachArgs jvmArgs;
1242+
jvmArgs.version = JNI_VERSION_1_6;
1243+
1244+
bool attached;
1245+
if (JNI_EDETACHED == javaVm->GetEnv((void **) &jniEnv, JNI_VERSION_1_6)) {
1246+
javaVm->AttachCurrentThread(&jniEnv, &jvmArgs);
1247+
attached = true;
1248+
} else {
1249+
attached = false;
1250+
}
1251+
jboolean canceled = jniEnv->CallBooleanMethod(info->stream, jclass_AnimatedFileDrawableStream_isCanceled);
1252+
if (attached) {
1253+
javaVm->DetachCurrentThread();
1254+
}
1255+
if (canceled) {
1256+
return 0;
1257+
}
1258+
}
12381259
if (info->pkt.size == 0 && readNextPacket) {
12391260
ret = av_read_frame(info->fmt_ctx, &info->pkt);
12401261
if (ret >= 0) {
@@ -1309,6 +1330,26 @@ extern "C" JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_AnimatedFileDr
13091330
int32_t triesCount = preview ? 50 : 6;
13101331
//info->has_decoded_frames = false;
13111332
while (!info->stopped && triesCount != 0) {
1333+
if (info->stream != nullptr) {
1334+
JNIEnv *jniEnv = nullptr;
1335+
JavaVMAttachArgs jvmArgs;
1336+
jvmArgs.version = JNI_VERSION_1_6;
1337+
1338+
bool attached;
1339+
if (JNI_EDETACHED == javaVm->GetEnv((void **) &jniEnv, JNI_VERSION_1_6)) {
1340+
javaVm->AttachCurrentThread(&jniEnv, &jvmArgs);
1341+
attached = true;
1342+
} else {
1343+
attached = false;
1344+
}
1345+
jboolean canceled = jniEnv->CallBooleanMethod(info->stream, jclass_AnimatedFileDrawableStream_isCanceled);
1346+
if (attached) {
1347+
javaVm->DetachCurrentThread();
1348+
}
1349+
if (canceled) {
1350+
return 0;
1351+
}
1352+
}
13121353
if (info->pkt.size == 0) {
13131354
ret = av_read_frame(info->fmt_ctx, &info->pkt);
13141355
if (ret >= 0) {
@@ -1400,6 +1441,10 @@ extern "C" jint videoOnJNILoad(JavaVM *vm, JNIEnv *env) {
14001441
if (jclass_AnimatedFileDrawableStream_isFinishedLoadingFile == 0) {
14011442
return JNI_FALSE;
14021443
}
1444+
jclass_AnimatedFileDrawableStream_isCanceled = env->GetMethodID(jclass_AnimatedFileDrawableStream, "isCanceled", "()Z");
1445+
if (jclass_AnimatedFileDrawableStream_isCanceled == 0) {
1446+
return JNI_FALSE;
1447+
}
14031448
jclass_AnimatedFileDrawableStream_getFinishedFilePath = env->GetMethodID(jclass_AnimatedFileDrawableStream, "getFinishedFilePath", "()Ljava/lang/String;");
14041449
if (jclass_AnimatedFileDrawableStream_getFinishedFilePath == 0) {
14051450
return JNI_FALSE;

TMessagesProj/jni/tgnet/ConnectionsManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,12 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
12971297
request->serverFailureCount++;
12981298
}
12991299
discardResponse = true;
1300+
} else if (error->error_code == -504) {
1301+
discardResponse = (request->requestFlags & RequestFlagIgnoreFloodWait) == 0;
1302+
request->failedByFloodWait = 2;
1303+
request->startTime = 0;
1304+
request->startTimeMillis = 0;
1305+
request->minStartTime = (int32_t) (getCurrentTimeMonotonicMillis() / 1000 + 2);
13001306
} else if (error->error_code == 420) {
13011307
int32_t waitTime = 2;
13021308
static std::string floodWait = "FLOOD_WAIT_";

TMessagesProj/src/main/assets/arctic.attheme

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ avatar_actionBarSelectorGreen=-8684677
7979
chat_inLoaderSelected=-13394195
8080
chat_outLocationIcon=-452984833
8181
avatar_actionBarIconViolet=-8684677
82-
dialogTextRed=-1682082
82+
text_RedBold=-1682082
8383
chat_inBubbleShadow=1981626195
8484
chat_outAudioProgress=-10907938
8585
dialogProgressCircle=-12281108
@@ -308,7 +308,6 @@ chat_outMenu=-1862270977
308308
statisticChartActiveLine=335544320
309309
chats_secretName=-16734706
310310
chat_outReplyMediaMessageSelectedText=-1056964609
311-
chat_reportSpam=-704436
312311
avatar_subtitleInProfileCyan=-16777216
313312
chat_serviceText=-1
314313
chats_attachMessage=-13268780

TMessagesProj/src/main/assets/darkblue.attheme

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ avatar_actionBarSelectorGreen=-12758164
118118
chat_outLocationIcon=-1
119119
chat_inLoaderSelected=-10445358
120120
location_liveLocationProgress=-9919529
121-
dialogTextRed=-1152913
121+
text_RedBold=-1152913
122122
chat_inBubbleShadow=838860800
123123
chat_outAudioProgress=-1
124124
dialogProgressCircle=-10177041
@@ -132,9 +132,8 @@ dialogLineProgressBackground=-13548718
132132
chat_inReplyNameText=-8796932
133133
chat_outAudioPerfomerSelectedText=-4268038
134134
actionBarActionModeDefaultIcon=-1
135-
windowBackgroundWhiteRedText4=-3187617
136135
chat_goDownButtonIcon=-1
137-
windowBackgroundWhiteRedText5=-1152913
136+
text_RedRegular=-1152913
138137
chat_outAudioSelectedProgress=-1
139138
chat_messageTextOut=-328966
140139
chat_inInstant=-8796932
@@ -446,9 +445,7 @@ chats_secretName=-9316522
446445
chat_inMenu=2039722445
447446
chat_recordVoiceCancel=-9192978
448447
chat_outReplyMediaMessageSelectedText=-1
449-
chat_reportSpam=-1481631
450448
chat_messageTextIn=-328966
451-
dialogRedIcon=-554801041
452449
avatar_subtitleInProfileCyan=-7628894
453450
chats_attachMessage=-8548712
454451
chat_topPanelBackground=-14602949

TMessagesProj/src/main/assets/day.attheme

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ avatar_actionBarSelectorGreen=-8684677
8383
chat_inLoaderSelected=-13394195
8484
chat_outLocationIcon=-452984833
8585
avatar_actionBarIconViolet=-8684677
86-
dialogTextRed=-1682082
86+
text_RedBold=-1682082
8787
chat_inBubbleShadow=1914707
8888
chat_outAudioProgress=-12155183
8989
dialogProgressCircle=-12281108
@@ -334,7 +334,6 @@ chat_outMenu=-6500865
334334
statisticChartActiveLine=335544320
335335
chats_secretName=-16734706
336336
chat_outReplyMediaMessageSelectedText=-3676417
337-
chat_reportSpam=-704436
338337
avatar_subtitleInProfileCyan=-16777216
339338
chat_serviceText=-13092808
340339
chats_attachMessage=-14321214

0 commit comments

Comments
 (0)