Skip to content

Commit d3ad131

Browse files
committed
Update to 7.1.3 (2100)
1 parent 75d0903 commit d3ad131

21 files changed

+214
-118
lines changed

Diff for: TMessagesProj/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ configurations.all {
1515
}
1616

1717
dependencies {
18-
implementation 'androidx.core:core:1.3.1'
18+
implementation 'androidx.core:core:1.3.2'
1919
implementation 'androidx.palette:palette:1.0.0'
2020
implementation 'androidx.exifinterface:exifinterface:1.3.0'
2121
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
@@ -24,7 +24,7 @@ dependencies {
2424

2525
compileOnly 'org.checkerframework:checker-qual:2.5.2'
2626
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
27-
implementation 'com.google.firebase:firebase-messaging:20.2.4'
27+
implementation 'com.google.firebase:firebase-messaging:20.3.0'
2828
implementation 'com.google.firebase:firebase-config:19.2.0'
2929
implementation 'com.google.firebase:firebase-datatransport:17.0.8'
3030
implementation 'com.google.firebase:firebase-appindexing:19.1.0'
@@ -284,7 +284,7 @@ android {
284284
}
285285
}
286286

287-
defaultConfig.versionCode = 2098
287+
defaultConfig.versionCode = 2100
288288

289289
applicationVariants.all { variant ->
290290
variant.outputs.all { output ->
@@ -319,7 +319,7 @@ android {
319319
defaultConfig {
320320
minSdkVersion 16
321321
targetSdkVersion 28
322-
versionName "7.1.2"
322+
versionName "7.1.3"
323323

324324
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
325325

Diff for: TMessagesProj/jni/CMakeLists.txt

+17-15
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,10 @@ target_compile_definitions(sqlite PUBLIC
395395
#voip
396396
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)
397397

398+
set(NATIVE_LIB "tmessages.33")
399+
398400
#tmessages
399-
add_library(tmessages.32 SHARED
401+
add_library(${NATIVE_LIB} SHARED
400402
jni.c
401403
audio.c
402404
image.cpp
@@ -416,34 +418,34 @@ add_library(tmessages.32 SHARED
416418
genann.c
417419
secureid_ocr.cpp)
418420

419-
target_compile_options(tmessages.32 PUBLIC
421+
target_compile_options(${NATIVE_LIB} PUBLIC
420422
-ffast-math -Os -funroll-loops -ffast-math -fno-strict-aliasing -fno-math-errno)
421423

422-
target_compile_definitions(tmessages.32 PUBLIC
424+
target_compile_definitions(${NATIVE_LIB} PUBLIC
423425
BSD=1 NULL=0 SOCKLEN_T=socklen_t ANDROID_NDK DISABLE_IMPORTGL AVOID_TABLES ANDROID_TILE_BASED_DECODE __STDC_CONSTANT_MACROS ANDROID_ARMV6_IDCT OPUS_BUILD FIXED_POINT USE_ALLOCA restrict= __EMX__ LOCALE_NOT_USED HAVE_LRINT HAVE_LRINTF)
424426

425427
if (${ANDROID_ABI} STREQUAL "armeabi-v7a")
426-
set_target_properties(tmessages.32 PROPERTIES
428+
set_target_properties(${NATIVE_LIB} PROPERTIES
427429
ANDROID_ARM_NEON FALSE
428430
ANDROID_ARM_MODE arm)
429-
target_compile_definitions(tmessages.32 PUBLIC
431+
target_compile_definitions(${NATIVE_LIB} PUBLIC
430432
ANDROID_ARM_NEON=false)
431-
target_sources(tmessages.32 PRIVATE
433+
target_sources(${NATIVE_LIB} PRIVATE
432434
third_party/libyuv/source/compare_neon.cc
433435
third_party/libyuv/source/rotate_neon.cc
434436
third_party/libyuv/source/row_neon.cc
435437
third_party/libyuv/source/scale_neon.cc)
436438
else()
437-
set_target_properties(tmessages.32 PROPERTIES
439+
set_target_properties(${NATIVE_LIB} PROPERTIES
438440
ANDROID_ARM_NEON FALSE
439441
ANDROID_ARM_MODE arm)
440442
endif()
441443

442444
if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a")
443-
target_compile_definitions(tmessages.32 PUBLIC
445+
target_compile_definitions(${NATIVE_LIB} PUBLIC
444446
LIBYUV_NEON OPUS_HAVE_RTCD OPUS_ARM_ASM)
445447

446-
target_sources(tmessages.32 PRIVATE
448+
target_sources(${NATIVE_LIB} PRIVATE
447449
opus/celt/arm/celt_neon_intr.c
448450
opus/celt/arm/pitch_neon_intr.c
449451
opus/silk/arm/NSQ_neon.c
@@ -455,11 +457,11 @@ if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a"
455457
)
456458

457459
elseif(${ANDROID_ABI} STREQUAL "x86")
458-
target_compile_definitions(tmessages.32 PUBLIC
460+
target_compile_definitions(${NATIVE_LIB} PUBLIC
459461
x86fix)
460462
endif()
461463

462-
target_sources(tmessages.32 PRIVATE
464+
target_sources(${NATIVE_LIB} PRIVATE
463465

464466
opus/src/opus.c
465467
opus/src/opus_decoder.c
@@ -642,7 +644,7 @@ target_sources(tmessages.32 PRIVATE
642644
third_party/libyuv/source/scale.cc
643645
third_party/libyuv/source/video_common.cc)
644646

645-
target_include_directories(tmessages.32 PUBLIC
647+
target_include_directories(${NATIVE_LIB} PUBLIC
646648
opus/include
647649
opus/silk
648650
opus/silk/fixed
@@ -661,7 +663,7 @@ target_include_directories(tmessages.32 PUBLIC
661663
webrtc/
662664
lz4)
663665

664-
target_link_libraries(tmessages.32
666+
target_link_libraries(${NATIVE_LIB}
665667
-Wl,--whole-archive voipandroid -Wl,--no-whole-archive
666668
tgvoip
667669
tgcalls
@@ -689,12 +691,12 @@ target_link_libraries(tmessages.32
689691
cpufeatures)
690692

691693
if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
692-
target_link_libraries(tmessages.32
694+
target_link_libraries(${NATIVE_LIB}
693695
-Wl,--whole-archive libvpx_yasm -Wl,--no-whole-archive)
694696
endif()
695697

696698
#if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
697-
# target_link_libraries(tmessages.32
699+
# target_link_libraries(${NATIVE_LIB}
698700
# -Wl,--whole-archive vpxasm -Wl,--no-whole-archive
699701
# c)
700702
#endif()

Diff for: TMessagesProj/src/main/AndroidManifest.xml

+2
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@
403403

404404
<meta-data android:name="android.max_aspect" android:value="2.5" />
405405

406+
<meta-data android:name="com.google.android.actions" android:resource="@xml/actions" />
407+
406408
</application>
407409

408410
</manifest>

Diff for: TMessagesProj/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,9 @@ public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State
703703
mAnchorInfo.reset();
704704
}
705705
mLastStackFromEnd = mStackFromEnd;
706-
if (DEBUG) {
707-
validateChildOrder();
708-
}
706+
// if (DEBUG) {
707+
// validateChildOrder();
708+
// }
709709
}
710710

711711
@Override
@@ -1612,9 +1612,9 @@ int fill(RecyclerView.Recycler recycler, LayoutState layoutState,
16121612
break;
16131613
}
16141614
}
1615-
if (DEBUG) {
1616-
validateChildOrder();
1617-
}
1615+
// if (DEBUG) {
1616+
// validateChildOrder();
1617+
// }
16181618
return start - layoutState.mAvailable;
16191619
}
16201620

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ public static CharSequence ellipsizeCenterEnd(CharSequence str, String query, in
288288
x = staticLayout.getPrimaryHorizontal(startHighlightedIndex + 1) - availableWidth * 0.3f;
289289
sub = str.subSequence(staticLayout.getOffsetForHorizontal(0, x), str.length());
290290
} else {
291-
if (charOf > 0 && charOf < str.length() - 1 && Character.isWhitespace(str.charAt(charOf))) {
292-
charOf--;
291+
if (charOf > 0 && charOf < str.length() - 2 && Character.isWhitespace(str.charAt(charOf))) {
292+
charOf++;
293293
}
294294
sub = str.subSequence(charOf, str.length());
295295
}
@@ -329,7 +329,7 @@ public static CharSequence highlightText(CharSequence str, String query) {
329329
int i = s.indexOf(query);
330330
while (i >= 0) {
331331
try {
332-
spannableStringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_windowBackgroundWhiteBlueText4), i, i + query.length(), 0);
332+
spannableStringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_windowBackgroundWhiteBlueText4), i, Math.min(i + query.length(), str.length()), 0);
333333
} catch (Exception e) {
334334
FileLog.e(e);
335335
}

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class BuildVars {
1818
public static boolean LOGS_ENABLED = false;
1919
public static boolean USE_CLOUD_STRINGS = true;
2020
public static boolean CHECK_UPDATES = true;
21-
public static int BUILD_VERSION = 2098;
21+
public static int BUILD_VERSION = 2100;
2222
public static String BUILD_VERSION_STRING = "7.1.0";
2323
public static int APP_ID = 4;
2424
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java

+25
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,31 @@ public void reset() {
260260
stickers = null;
261261
cropState = null;
262262
}
263+
264+
public void copyFrom(MediaEditState state) {
265+
caption = state.caption;
266+
267+
thumbPath = state.thumbPath;
268+
imagePath = state.imagePath;
269+
filterPath = state.filterPath;
270+
paintPath = state.paintPath;
271+
croppedPaintPath = state.croppedPaintPath;
272+
fullPaintPath = state.fullPaintPath;
273+
274+
entities = state.entities;
275+
savedFilterState = state.savedFilterState;
276+
mediaEntities = state.mediaEntities;
277+
croppedMediaEntities = state.croppedMediaEntities;
278+
stickers = state.stickers;
279+
editedInfo = state.editedInfo;
280+
averageDuration = state.averageDuration;
281+
isFiltered = state.isFiltered;
282+
isPainted = state.isPainted;
283+
isCropped = state.isCropped;
284+
ttl = state.ttl;
285+
286+
cropState = state.cropState;
287+
}
263288
}
264289

265290
public static class PhotoEntry extends MediaEditState {

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public class NativeLoader {
2424

25-
private final static int LIB_VERSION = 32;
25+
private final static int LIB_VERSION = 33;
2626
private final static String LIB_NAME = "tmessages." + LIB_VERSION;
2727
private final static String LIB_SO_NAME = "lib" + LIB_NAME + ".so";
2828
private final static String LOCALE_LIB_SO_NAME = "lib" + LIB_NAME + "loc.so";

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ public int sendMessage(ArrayList<MessageObject> messages, final long peer, boole
13141314
newMsg.fwd_from.flags |= 8;
13151315
newMsg.fwd_from.post_author = msgObj.messageOwner.fwd_from.post_author;
13161316
}
1317-
if ((msgObj.messageOwner.fwd_from.flags & 16) != 0) {
1317+
if ((msgObj.messageOwner.fwd_from.flags & 16) != 0 && !UserObject.isReplyUser(msgObj.getDialogId())) {
13181318
newMsg.fwd_from.flags |= 16;
13191319
newMsg.fwd_from.saved_from_peer = msgObj.messageOwner.fwd_from.saved_from_peer;
13201320
newMsg.fwd_from.saved_from_msg_id = msgObj.messageOwner.fwd_from.saved_from_msg_id;

Diff for: TMessagesProj/src/main/java/org/telegram/messenger/SharedConfig.java

-10
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public class SharedConfig {
8484
public static boolean directShare = true;
8585
public static boolean inappCamera = true;
8686
public static boolean roundCamera16to9 = true;
87-
public static boolean assistantSupport = false;
8887
public static boolean noSoundHintShowed = false;
8988
public static boolean streamMedia = true;
9089
public static boolean streamAllVideo = false;
@@ -251,7 +250,6 @@ public static void loadConfig() {
251250
inappCamera = preferences.getBoolean("inappCamera", true);
252251
hasCameraCache = preferences.contains("cameraCache");
253252
roundCamera16to9 = true;//preferences.getBoolean("roundCamera16to9", false);
254-
assistantSupport = preferences.getBoolean("assistantSupport", false);
255253
repeatMode = preferences.getInt("repeatMode", 0);
256254
fontSize = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
257255
bubbleRadius = preferences.getInt("bubbleRadius", 10);
@@ -747,14 +745,6 @@ public static void toggleInappCamera() {
747745
editor.commit();
748746
}
749747

750-
public static void toggleAssistantSupport() {
751-
assistantSupport = !assistantSupport;
752-
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
753-
SharedPreferences.Editor editor = preferences.edit();
754-
editor.putBoolean("assistantSupport", assistantSupport);
755-
editor.commit();
756-
}
757-
758748
public static void toggleRoundCamera16to9() {
759749
roundCamera16to9 = !roundCamera16to9;
760750
SharedPreferences preferences = MessagesController.getGlobalMainSettings();

Diff for: TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java

-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ public void setBehindKeyboardColor(int color) {
615615

616616
@Override
617617
protected void dispatchDraw(Canvas canvas) {
618-
// adjustPanLayoutHelper.update();
619618
super.dispatchDraw(canvas);
620619
if (drawCurrentPreviewFragmentAbove && parentActionBarLayout != null) {
621620
if (previewBlurDrawable != null) {

Diff for: TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ private void searchMessagesInternal(final String query, int searchId) {
351351
}, ConnectionsManager.RequestFlagFailOnServerErrors);
352352
}
353353

354-
public boolean hasRecentRearch() {
354+
public boolean hasRecentSearch() {
355355
return dialogsType != 2 && dialogsType != 4 && dialogsType != 5 && dialogsType != 6 && (!recentSearchObjects.isEmpty() || !MediaDataController.getInstance(currentAccount).hints.isEmpty());
356356
}
357357

Diff for: TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8791,7 +8791,7 @@ private void updateCurrentUserAndChat() {
87918791
currentUser.first_name = fwd_from.from_name;
87928792
} else {
87938793
int fromId = currentMessageObject.getFromChatId();
8794-
if (fromId > 0) {
8794+
if (fromId > 0 && !currentMessageObject.messageOwner.post) {
87958795
currentUser = messagesController.getUser(fromId);
87968796
} else if (fromId < 0) {
87978797
currentChat = messagesController.getChat(-fromId);
@@ -10384,7 +10384,7 @@ private void drawCaptionLayout(Canvas canvas, StaticLayout captionLayout, boolea
1038410384
endX += AndroidUtilities.dp(14);
1038510385
buttonX -= AndroidUtilities.dp(10);
1038610386
}
10387-
commentButtonRect.set(buttonX, (int) buttonY, endX - AndroidUtilities.dp(14), (int) (layoutHeight - AndroidUtilities.dp(h)));
10387+
commentButtonRect.set(buttonX, (int) buttonY, endX - AndroidUtilities.dp(14), layoutHeight - AndroidUtilities.dp(h));
1038810388
if (selectorDrawable[1] != null && selectorDrawableMaskType[1] == 2) {
1038910389
selectorDrawable[1].setBounds(commentButtonRect);
1039010390
selectorDrawable[1].draw(canvas);

Diff for: TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -18444,7 +18444,9 @@ private void openDialog(ChatMessageCell cell, TLRPC.User user) {
1844418444
}
1844518445

1844618446
private void openChat(ChatMessageCell cell, TLRPC.Chat chat, int postId) {
18447-
if (currentChat == null || chat.id != currentChat.id || isThreadChat()) {
18447+
if (currentChat != null && chat.id == currentChat.id) {
18448+
scrollToMessageId(postId, cell.getMessageObject().getId(), true, 0, true);
18449+
} else if (currentChat == null || chat.id != currentChat.id || isThreadChat()) {
1844818450
Bundle args = new Bundle();
1844918451
args.putInt("chat_id", chat.id);
1845018452
if (postId != 0) {

Diff for: TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,9 @@ public boolean onKey(View view, int i, KeyEvent keyEvent) {
21162116
}
21172117
if (searchingType != 0) {
21182118
searchingType = 0;
2119-
emojiView.closeSearch(true);
2119+
if (emojiView != null) {
2120+
emojiView.closeSearch(true);
2121+
}
21202122
messageEditText.requestFocus();
21212123
} else {
21222124
if (stickersExpanded) {

Diff for: TMessagesProj/src/main/java/org/telegram/ui/Components/ChatAttachAlertPhotoLayout.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -2805,9 +2805,14 @@ public void didReceivedNotification(int id, int account, Object... args) {
28052805
cameraAttachAdapter.notifyDataSetChanged();
28062806
if (!selectedPhotosOrder.isEmpty() && galleryAlbumEntry != null) {
28072807
for (int a = 0, N = selectedPhotosOrder.size(); a < N; a++) {
2808-
int imageId = (Integer) selectedPhotosOrder.get(a);
2808+
Integer imageId = (Integer) selectedPhotosOrder.get(a);
2809+
Object currentEntry = selectedPhotos.get(imageId);
28092810
MediaController.PhotoEntry entry = galleryAlbumEntry.photosByIds.get(imageId);
28102811
if (entry != null) {
2812+
if (currentEntry instanceof MediaController.PhotoEntry) {
2813+
MediaController.PhotoEntry photoEntry = (MediaController.PhotoEntry) currentEntry;
2814+
entry.copyFrom(photoEntry);
2815+
}
28112816
selectedPhotos.put(imageId, entry);
28122817
}
28132818
}

Diff for: TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ public void onSearchCollapse() {
17431743
@Override
17441744
public void onTextChanged(EditText editText) {
17451745
String text = editText.getText().toString();
1746-
if (text.length() != 0 || searchViewPager.dialogsSearchAdapter != null && searchViewPager.dialogsSearchAdapter.hasRecentRearch()) {
1746+
if (text.length() != 0 || searchViewPager.dialogsSearchAdapter != null && searchViewPager.dialogsSearchAdapter.hasRecentSearch()) {
17471747
searchWas = true;
17481748
if (viewPages[0].listView.getVisibility() == View.VISIBLE) {
17491749
showSearch(true, true);
@@ -3661,7 +3661,7 @@ private void showSearch(boolean show, boolean animated) {
36613661
searchIsShowed = show;
36623662
if (show) {
36633663
int dialogsCount = getMessagesController().getTotalDialogsCount();
3664-
boolean onlyDialogsAdapter = onlySelect || !searchViewPager.dialogsSearchAdapter.hasRecentRearch() || dialogsCount <= 10;
3664+
boolean onlyDialogsAdapter = onlySelect || !searchViewPager.dialogsSearchAdapter.hasRecentSearch() || dialogsCount <= 10;
36653665
searchViewPager.showOnlyDialogsAdapter(onlyDialogsAdapter);
36663666
whiteActionBar = !onlyDialogsAdapter;
36673667
ContentView contentView = (ContentView) fragmentView;
@@ -3707,7 +3707,7 @@ private void showSearch(boolean show, boolean animated) {
37073707
}
37083708
}
37093709

3710-
if (animated && searchViewPager.dialogsSearchAdapter.hasRecentRearch()) {
3710+
if (animated && searchViewPager.dialogsSearchAdapter.hasRecentSearch()) {
37113711
AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid);
37123712
} else {
37133713
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);

0 commit comments

Comments
 (0)