Skip to content

Commit

Permalink
update to 9.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xaxtix committed Mar 8, 2023
1 parent 1ac56c6 commit d374d48
Show file tree
Hide file tree
Showing 962 changed files with 6,930 additions and 5,765 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations.all {
}

dependencies {
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.core:core:1.9.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
Expand Down
22 changes: 14 additions & 8 deletions TMessagesProj/jni/tgnet/ApiScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,19 @@ void TL_config::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &
notify_default_delay_ms = stream->readInt32(&error);
push_chat_period_ms = stream->readInt32(&error);
push_chat_limit = stream->readInt32(&error);
saved_gifs_limit = stream->readInt32(&error);
// saved_gifs_limit = stream->readInt32(&error);
edit_time_limit = stream->readInt32(&error);
revoke_time_limit = stream->readInt32(&error);
revoke_pm_time_limit = stream->readInt32(&error);
rating_e_decay = stream->readInt32(&error);
stickers_recent_limit = stream->readInt32(&error);
stickers_faved_limit = stream->readInt32(&error);
// stickers_faved_limit = stream->readInt32(&error);
channels_read_media_period = stream->readInt32(&error);
if ((flags & 1) != 0) {
tmp_sessions = stream->readInt32(&error);
}
pinned_dialogs_count_max = stream->readInt32(&error);
pinned_infolder_count_max = stream->readInt32(&error);
// pinned_dialogs_count_max = stream->readInt32(&error);
// pinned_infolder_count_max = stream->readInt32(&error);
call_receive_timeout_ms = stream->readInt32(&error);
call_ring_timeout_ms = stream->readInt32(&error);
call_connect_timeout_ms = stream->readInt32(&error);
Expand Down Expand Up @@ -244,6 +244,9 @@ void TL_config::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &
if ((flags & 32768) != 0) {
reactions_default = std::unique_ptr<Reaction>(Reaction::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
}
if ((flags & 65536) != 0) {
autologin_token = stream->readString(&error);
}
}

void TL_config::serializeToStream(NativeByteBuffer *stream) {
Expand Down Expand Up @@ -271,19 +274,19 @@ void TL_config::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(notify_default_delay_ms);
stream->writeInt32(push_chat_period_ms);
stream->writeInt32(push_chat_limit);
stream->writeInt32(saved_gifs_limit);
// stream->writeInt32(saved_gifs_limit);
stream->writeInt32(edit_time_limit);
stream->writeInt32(revoke_time_limit);
stream->writeInt32(revoke_pm_time_limit);
stream->writeInt32(rating_e_decay);
stream->writeInt32(stickers_recent_limit);
stream->writeInt32(stickers_faved_limit);
// stream->writeInt32(stickers_faved_limit);
stream->writeInt32(channels_read_media_period);
if ((flags & 1) != 0) {
stream->writeInt32(tmp_sessions);
}
stream->writeInt32(pinned_dialogs_count_max);
stream->writeInt32(pinned_infolder_count_max);
// stream->writeInt32(pinned_dialogs_count_max);
// stream->writeInt32(pinned_infolder_count_max);
stream->writeInt32(call_receive_timeout_ms);
stream->writeInt32(call_ring_timeout_ms);
stream->writeInt32(call_connect_timeout_ms);
Expand Down Expand Up @@ -319,6 +322,9 @@ void TL_config::serializeToStream(NativeByteBuffer *stream) {
if ((flags & 32768) != 0 && reactions_default != nullptr) {
reactions_default->serializeToStream(stream);
}
if ((flags & 65536) != 0) {
stream->writeString(autologin_token);
}
}

TLObject *TL_help_getConfig::deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
Expand Down
11 changes: 6 additions & 5 deletions TMessagesProj/jni/tgnet/ApiScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Reaction : public TLObject {
class TL_config : public TLObject {

public:
static const uint32_t constructor = 0x232566ac;
static const uint32_t constructor = 0xcc1a241e;

int32_t flags;
int32_t date;
Expand All @@ -125,17 +125,17 @@ class TL_config : public TLObject {
int32_t notify_default_delay_ms;
int32_t push_chat_period_ms;
int32_t push_chat_limit;
int32_t saved_gifs_limit;
// int32_t saved_gifs_limit;
int32_t edit_time_limit;
int32_t revoke_time_limit;
int32_t revoke_pm_time_limit;
int32_t rating_e_decay;
int32_t stickers_recent_limit;
int32_t stickers_faved_limit;
// int32_t stickers_faved_limit;
int32_t channels_read_media_period;
int32_t tmp_sessions;
int32_t pinned_dialogs_count_max;
int32_t pinned_infolder_count_max;
// int32_t pinned_dialogs_count_max;
// int32_t pinned_infolder_count_max;
int32_t call_receive_timeout_ms;
int32_t call_ring_timeout_ms;
int32_t call_connect_timeout_ms;
Expand All @@ -153,6 +153,7 @@ class TL_config : public TLObject {
int32_t lang_pack_version;
int32_t base_lang_pack_version;
std::unique_ptr<Reaction> reactions_default;
std::string autologin_token;

static TL_config *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
Expand Down
4 changes: 4 additions & 0 deletions TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,7 @@ int32_t ConnectionsManager::sendRequestInternal(TLObject *object, onCompleteFunc
request->rpcRequest = wrapInLayer(object, getDatacenterWithId(datacenterId), request);
auto cancelledIterator = tokensToBeCancelled.find(request->requestToken);
if (cancelledIterator != tokensToBeCancelled.end()) {
if (LOGS_ENABLED) DEBUG_D("(3) request is cancelled before sending, token %d", request->requestToken);
tokensToBeCancelled.erase(cancelledIterator);
delete request;
return request->requestToken;
Expand Down Expand Up @@ -1801,6 +1802,7 @@ int32_t ConnectionsManager::sendRequest(TLObject *object, onCompleteFunc onCompl
request->rpcRequest = wrapInLayer(object, getDatacenterWithId(datacenterId), request);
auto cancelledIterator = tokensToBeCancelled.find(request->requestToken);
if (cancelledIterator != tokensToBeCancelled.end()) {
if (LOGS_ENABLED) DEBUG_D("(1) request is cancelled before sending, token %d", requestToken);
tokensToBeCancelled.erase(cancelledIterator);
delete request;
}
Expand Down Expand Up @@ -1847,6 +1849,7 @@ void ConnectionsManager::sendRequest(TLObject *object, onCompleteFunc onComplete
if (LOGS_ENABLED) DEBUG_D("send request wrapped %p - %s", request->rpcRequest.get(), typeid(*(request->rpcRequest.get())).name());
auto cancelledIterator = tokensToBeCancelled.find(request->requestToken);
if (cancelledIterator != tokensToBeCancelled.end()) {
if (LOGS_ENABLED) DEBUG_D("(2) request is cancelled before sending, token %d", requestToken);
tokensToBeCancelled.erase(cancelledIterator);
delete request;
return;
Expand Down Expand Up @@ -1981,6 +1984,7 @@ bool ConnectionsManager::cancelRequestInternal(int32_t token, int64_t messageId,
}

if (token != 0 && connectionState == ConnectionStateWaitingForNetwork) {
if (LOGS_ENABLED) DEBUG_D("request is tried to be cancelled, but it does not even exist, token %d", token);
tokensToBeCancelled.insert(token);
}

Expand Down
13 changes: 12 additions & 1 deletion TMessagesProj/jni/voip/org_telegram_messenger_voip_Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,24 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeNati
bool isRtc = endpointObject.getBooleanField("isRtc");
if (isRtc) {
RtcServer rtcServer;
rtcServer.id = static_cast<uint8_t>(endpointObject.getIntField("reflectorId"));
rtcServer.host = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("ipv4"));
rtcServer.port = static_cast<uint16_t>(endpointObject.getIntField("port"));
rtcServer.login = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("username"));
rtcServer.password = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("password"));
rtcServer.isTurn = endpointObject.getBooleanField("turn");
descriptor.rtcServers.push_back(std::move(rtcServer));
} else {
RtcServer rtcServer;
rtcServer.id = static_cast<uint8_t>(endpointObject.getIntField("reflectorId"));
rtcServer.host = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("ipv4"));
rtcServer.port = static_cast<uint16_t>(endpointObject.getIntField("port"));
rtcServer.login = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("username"));
rtcServer.password = tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("password"));
rtcServer.isTurn = true;
rtcServer.isTcp = endpointObject.getBooleanField("tcp");
descriptor.rtcServers.push_back(std::move(rtcServer));

Endpoint endpoint;
endpoint.endpointId = endpointObject.getLongField("id");
endpoint.host = EndpointHost{tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("ipv4")), tgvoip::jni::JavaStringToStdString(env, endpointObject.getStringField("ipv6"))};
Expand All @@ -744,7 +755,7 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeNati
memcpy(endpoint.peerTag, peerTagBytes, 16);
env->ReleaseByteArrayElements(peerTag, peerTagBytes, JNI_ABORT);
}
descriptor.endpoints.push_back(std::move(endpoint));
descriptor.endpoints.push_back(std::move(endpoint));
}
}

Expand Down
4 changes: 3 additions & 1 deletion TMessagesProj/jni/voip/tgcalls/v2/InstanceV2Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,9 @@ class InstanceV2ImplInternal : public std::enable_shared_from_this<InstanceV2Imp
beginQualityTimer(0);
beginLogTimer(0);


NativeNetworkingImpl::State initialNetworkState;
initialNetworkState.isReadyToSendData = false;
onNetworkStateUpdated(initialNetworkState);
}

void beginQualityTimer(int delayMs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int32_t AudioTrackJni::StartPlayout() {
int32_t AudioTrackJni::StopPlayout() {
RTC_LOG(LS_INFO) << "StopPlayout";
RTC_DCHECK(thread_checker_.IsCurrent());
if (!initialized_ || !playing_) {
if (!initialized_ || !playing_ || j_audio_track_ == nullptr) {
return 0;
}
if (!j_audio_track_->StopPlayout()) {
Expand Down
6 changes: 6 additions & 0 deletions TMessagesProj/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity-alias
Expand All @@ -124,6 +125,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity-alias
Expand All @@ -139,6 +141,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity-alias
Expand All @@ -154,6 +157,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity-alias
Expand All @@ -169,6 +173,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity-alias
Expand All @@ -184,6 +189,7 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
</activity-alias>

<activity
Expand Down
17 changes: 0 additions & 17 deletions TMessagesProj/src/main/assets/arctic.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ chats_menuPhone=-1006632961
avatar_actionBarIconOrange=-8684677
chat_outViews=-1258291201
avatar_actionBarSelectorCyan=-8684677
chat_secretTimerBackground=1375731712
chat_outViaBotNameText=-1
profile_actionPressedBackground=-13924376
chat_inPreviewInstantSelectedText=-13464859
location_sendLocationBackground=-11492107
avatar_nameInMessageViolet=-8163354
chat_inAudioSelectedProgress=-2034434
Expand All @@ -38,7 +36,6 @@ chats_menuPhoneCats=-1
chat_outPreviewLine=-1
chat_inViaBotNameText=-13464859
chat_outVoiceSeekbar=1895825407
chat_outFileIcon=-6113593
chats_menuTopShadowCats=2924287
chats_nameMessage_threeLines=-12434359
chat_inFileProgress=-1
Expand Down Expand Up @@ -67,7 +64,6 @@ chat_topPanelLine=-364404226
chat_outInstantSelected=-1
chat_outSentCheck=-922746881
key_graySectionText=-8156525
chat_outFileSelectedIcon=-7883067
dialogButton=-13987604
actionBarDefaultSubtitle=-7630182
contextProgressInner2=-826024458
Expand Down Expand Up @@ -107,16 +103,13 @@ chat_messagePanelSend=-12935426
windowBackgroundWhiteRedText2=-1817262
avatar_backgroundBlue=-11491866
chat_inSentClock=-5195068
chat_outLoaderPhoto=-6113080
chat_botSwitchToInlineText=-13464859
chats_nameMessageArchived=-7237231
dialogTextRed2=-1354403
chats_tabUnreadUnactiveBackground=-13655305
avatar_subtitleInProfileOrange=-16777216
chat_outSentCheckSelected=-1191182337
chat_inVenueInfoSelectedText=-7099204
dialogTextBlue2=-14772773
dialogTextBlue3=-14839830
dialogTextBlue4=-15625752
actionBarTabActiveText=-13590803
chat_topPanelMessage=-8354167
Expand Down Expand Up @@ -206,7 +199,6 @@ wallpaperFileOffset=-1
chat_outBubbleShadow=868467
chat_outVenueNameText=-11822380
chat_outTextSelectionHighlight=1802747885
chats_menuCloudBackgroundCats=-12545584
chats_verifiedBackground=-12998152
chat_inTimeSelectedText=-7099204
chat_outFileBackgroundSelected=1351271669
Expand All @@ -223,7 +215,6 @@ chat_outFileNameText=-1
picker_enabledButton=-14180619
avatar_nameInMessagePink=-3453050
windowBackgroundWhiteGrayText=-7629665
musicPicker_buttonBackground=-12212482
chat_serviceIcon=-1
avatar_actionBarSelectorViolet=-8684677
avatar_nameInMessageBlue=-13464859
Expand All @@ -238,10 +229,8 @@ chat_inVenueInfoText=-6182221
chat_replyPanelIcons=-12086038
chat_outSentClockSelected=1895825407
featuredStickers_addedIcon=-13325569
musicPicker_checkbox=-12405250
chat_outFileBackground=1351271669
chat_attachSendBackground=-12608006
dialogBadgeBackground=-13852434
chat_outBubbleSelected=-13332255
avatar_backgroundInProfileBlue=-13330708
chat_lockIcon=-9211021
Expand All @@ -253,7 +242,6 @@ chat_inFileInfoSelectedText=-7099204
chat_wallpaper=-2562829
chat_outMenuSelected=-1862270977
fastScrollActive=-12409618
chat_outLoaderPhotoSelected=-6113593
chat_muteIcon=1718842227
chat_selectedBackground=756261375
chat_recordedVoiceBackground=-12675093
Expand All @@ -263,7 +251,6 @@ chat_addContact=-14775579
switchTrackChecked=-11884552
chat_inLoader=-12015626
chat_adminSelectedText=-6769974
chat_outPreviewInstantSelectedText=-1
avatar_actionBarIconBlue=-12433070
chat_outTimeText=-1056964609
chat_attachAudioText=-2209977
Expand All @@ -277,16 +264,13 @@ chat_outReplyMediaMessageText=-1056964609
chat_textSelectBackground=1027252973
actionBarTabSelector=136982325
player_buttonActive=-13851650
chat_outLoaderPhotoIcon=-1
chat_attachFileText=-15423260
chat_outContactBackground=-1
sharedMedia_linkPlaceholder=-723724
windowBackgroundWhiteBlueText7=-12149279
chat_outLocationBackground=1352257013
windowBackgroundWhiteBlueText3=-13530406
windowBackgroundWhiteBlueText5=-12935951
windowBackgroundWhiteBlueText4=-12675352
chat_replyPanelMessage=-13355980
chat_inViewsSelected=-6373686
windowBackgroundWhiteLinkSelection=560114147
inappPlayerClose=-7563878
Expand All @@ -304,7 +288,6 @@ chat_sentError=-65536
avatar_actionBarSelectorRed=-8684677
chat_inAudioDurationSelectedText=-7099204
chat_outAudioSeekbarSelected=1487394047
chat_outLoaderPhotoIconSelected=-1314571
avatar_actionBarIconGreen=-8291461
chat_outReplyMessageText=-1
chat_recordedVoiceDot=-833978
Expand Down
Loading

0 comments on commit d374d48

Please sign in to comment.