mirror of
https://github.com/DrKLO/Telegram.git
synced 2025-01-13 13:17:57 +01:00
Update to 7.1.3 (2100)
This commit is contained in:
parent
75d0903666
commit
d3ad1316c4
21 changed files with 215 additions and 119 deletions
TMessagesProj
build.gradle
jni
src/main
AndroidManifest.xml
java
androidx/recyclerview/widget
org/telegram
res
|
@ -15,7 +15,7 @@ configurations.all {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.core:core:1.3.1'
|
||||
implementation 'androidx.core:core:1.3.2'
|
||||
implementation 'androidx.palette:palette:1.0.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.3.0'
|
||||
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
|
||||
|
@ -24,7 +24,7 @@ dependencies {
|
|||
|
||||
compileOnly 'org.checkerframework:checker-qual:2.5.2'
|
||||
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
|
||||
implementation 'com.google.firebase:firebase-messaging:20.2.4'
|
||||
implementation 'com.google.firebase:firebase-messaging:20.3.0'
|
||||
implementation 'com.google.firebase:firebase-config:19.2.0'
|
||||
implementation 'com.google.firebase:firebase-datatransport:17.0.8'
|
||||
implementation 'com.google.firebase:firebase-appindexing:19.1.0'
|
||||
|
@ -284,7 +284,7 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
defaultConfig.versionCode = 2098
|
||||
defaultConfig.versionCode = 2100
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
|
@ -319,7 +319,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionName "7.1.2"
|
||||
versionName "7.1.3"
|
||||
|
||||
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
||||
|
||||
|
|
|
@ -395,8 +395,10 @@ target_compile_definitions(sqlite PUBLIC
|
|||
#voip
|
||||
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)
|
||||
|
||||
set(NATIVE_LIB "tmessages.33")
|
||||
|
||||
#tmessages
|
||||
add_library(tmessages.32 SHARED
|
||||
add_library(${NATIVE_LIB} SHARED
|
||||
jni.c
|
||||
audio.c
|
||||
image.cpp
|
||||
|
@ -416,34 +418,34 @@ add_library(tmessages.32 SHARED
|
|||
genann.c
|
||||
secureid_ocr.cpp)
|
||||
|
||||
target_compile_options(tmessages.32 PUBLIC
|
||||
target_compile_options(${NATIVE_LIB} PUBLIC
|
||||
-ffast-math -Os -funroll-loops -ffast-math -fno-strict-aliasing -fno-math-errno)
|
||||
|
||||
target_compile_definitions(tmessages.32 PUBLIC
|
||||
target_compile_definitions(${NATIVE_LIB} PUBLIC
|
||||
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)
|
||||
|
||||
if (${ANDROID_ABI} STREQUAL "armeabi-v7a")
|
||||
set_target_properties(tmessages.32 PROPERTIES
|
||||
set_target_properties(${NATIVE_LIB} PROPERTIES
|
||||
ANDROID_ARM_NEON FALSE
|
||||
ANDROID_ARM_MODE arm)
|
||||
target_compile_definitions(tmessages.32 PUBLIC
|
||||
target_compile_definitions(${NATIVE_LIB} PUBLIC
|
||||
ANDROID_ARM_NEON=false)
|
||||
target_sources(tmessages.32 PRIVATE
|
||||
target_sources(${NATIVE_LIB} PRIVATE
|
||||
third_party/libyuv/source/compare_neon.cc
|
||||
third_party/libyuv/source/rotate_neon.cc
|
||||
third_party/libyuv/source/row_neon.cc
|
||||
third_party/libyuv/source/scale_neon.cc)
|
||||
else()
|
||||
set_target_properties(tmessages.32 PROPERTIES
|
||||
set_target_properties(${NATIVE_LIB} PROPERTIES
|
||||
ANDROID_ARM_NEON FALSE
|
||||
ANDROID_ARM_MODE arm)
|
||||
endif()
|
||||
|
||||
if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a")
|
||||
target_compile_definitions(tmessages.32 PUBLIC
|
||||
target_compile_definitions(${NATIVE_LIB} PUBLIC
|
||||
LIBYUV_NEON OPUS_HAVE_RTCD OPUS_ARM_ASM)
|
||||
|
||||
target_sources(tmessages.32 PRIVATE
|
||||
target_sources(${NATIVE_LIB} PRIVATE
|
||||
opus/celt/arm/celt_neon_intr.c
|
||||
opus/celt/arm/pitch_neon_intr.c
|
||||
opus/silk/arm/NSQ_neon.c
|
||||
|
@ -455,11 +457,11 @@ if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a"
|
|||
)
|
||||
|
||||
elseif(${ANDROID_ABI} STREQUAL "x86")
|
||||
target_compile_definitions(tmessages.32 PUBLIC
|
||||
target_compile_definitions(${NATIVE_LIB} PUBLIC
|
||||
x86fix)
|
||||
endif()
|
||||
|
||||
target_sources(tmessages.32 PRIVATE
|
||||
target_sources(${NATIVE_LIB} PRIVATE
|
||||
|
||||
opus/src/opus.c
|
||||
opus/src/opus_decoder.c
|
||||
|
@ -642,7 +644,7 @@ target_sources(tmessages.32 PRIVATE
|
|||
third_party/libyuv/source/scale.cc
|
||||
third_party/libyuv/source/video_common.cc)
|
||||
|
||||
target_include_directories(tmessages.32 PUBLIC
|
||||
target_include_directories(${NATIVE_LIB} PUBLIC
|
||||
opus/include
|
||||
opus/silk
|
||||
opus/silk/fixed
|
||||
|
@ -661,7 +663,7 @@ target_include_directories(tmessages.32 PUBLIC
|
|||
webrtc/
|
||||
lz4)
|
||||
|
||||
target_link_libraries(tmessages.32
|
||||
target_link_libraries(${NATIVE_LIB}
|
||||
-Wl,--whole-archive voipandroid -Wl,--no-whole-archive
|
||||
tgvoip
|
||||
tgcalls
|
||||
|
@ -689,12 +691,12 @@ target_link_libraries(tmessages.32
|
|||
cpufeatures)
|
||||
|
||||
if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
|
||||
target_link_libraries(tmessages.32
|
||||
target_link_libraries(${NATIVE_LIB}
|
||||
-Wl,--whole-archive libvpx_yasm -Wl,--no-whole-archive)
|
||||
endif()
|
||||
|
||||
#if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64")
|
||||
# target_link_libraries(tmessages.32
|
||||
# target_link_libraries(${NATIVE_LIB}
|
||||
# -Wl,--whole-archive vpxasm -Wl,--no-whole-archive
|
||||
# c)
|
||||
#endif()
|
||||
|
|
|
@ -403,6 +403,8 @@
|
|||
|
||||
<meta-data android:name="android.max_aspect" android:value="2.5" />
|
||||
|
||||
<meta-data android:name="com.google.android.actions" android:resource="@xml/actions" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
|
@ -703,9 +703,9 @@ public class LinearLayoutManager extends RecyclerView.LayoutManager implements
|
|||
mAnchorInfo.reset();
|
||||
}
|
||||
mLastStackFromEnd = mStackFromEnd;
|
||||
if (DEBUG) {
|
||||
validateChildOrder();
|
||||
}
|
||||
// if (DEBUG) {
|
||||
// validateChildOrder();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1612,9 +1612,9 @@ public class LinearLayoutManager extends RecyclerView.LayoutManager implements
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
validateChildOrder();
|
||||
}
|
||||
// if (DEBUG) {
|
||||
// validateChildOrder();
|
||||
// }
|
||||
return start - layoutState.mAvailable;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,8 +288,8 @@ public class AndroidUtilities {
|
|||
x = staticLayout.getPrimaryHorizontal(startHighlightedIndex + 1) - availableWidth * 0.3f;
|
||||
sub = str.subSequence(staticLayout.getOffsetForHorizontal(0, x), str.length());
|
||||
} else {
|
||||
if (charOf > 0 && charOf < str.length() - 1 && Character.isWhitespace(str.charAt(charOf))) {
|
||||
charOf--;
|
||||
if (charOf > 0 && charOf < str.length() - 2 && Character.isWhitespace(str.charAt(charOf))) {
|
||||
charOf++;
|
||||
}
|
||||
sub = str.subSequence(charOf, str.length());
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ public class AndroidUtilities {
|
|||
int i = s.indexOf(query);
|
||||
while (i >= 0) {
|
||||
try {
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_windowBackgroundWhiteBlueText4), i, i + query.length(), 0);
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpanThemable(Theme.key_windowBackgroundWhiteBlueText4), i, Math.min(i + query.length(), str.length()), 0);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class BuildVars {
|
|||
public static boolean LOGS_ENABLED = false;
|
||||
public static boolean USE_CLOUD_STRINGS = true;
|
||||
public static boolean CHECK_UPDATES = true;
|
||||
public static int BUILD_VERSION = 2098;
|
||||
public static int BUILD_VERSION = 2100;
|
||||
public static String BUILD_VERSION_STRING = "7.1.0";
|
||||
public static int APP_ID = 4;
|
||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||
|
|
|
@ -260,6 +260,31 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
|||
stickers = null;
|
||||
cropState = null;
|
||||
}
|
||||
|
||||
public void copyFrom(MediaEditState state) {
|
||||
caption = state.caption;
|
||||
|
||||
thumbPath = state.thumbPath;
|
||||
imagePath = state.imagePath;
|
||||
filterPath = state.filterPath;
|
||||
paintPath = state.paintPath;
|
||||
croppedPaintPath = state.croppedPaintPath;
|
||||
fullPaintPath = state.fullPaintPath;
|
||||
|
||||
entities = state.entities;
|
||||
savedFilterState = state.savedFilterState;
|
||||
mediaEntities = state.mediaEntities;
|
||||
croppedMediaEntities = state.croppedMediaEntities;
|
||||
stickers = state.stickers;
|
||||
editedInfo = state.editedInfo;
|
||||
averageDuration = state.averageDuration;
|
||||
isFiltered = state.isFiltered;
|
||||
isPainted = state.isPainted;
|
||||
isCropped = state.isCropped;
|
||||
ttl = state.ttl;
|
||||
|
||||
cropState = state.cropState;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PhotoEntry extends MediaEditState {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.zip.ZipFile;
|
|||
|
||||
public class NativeLoader {
|
||||
|
||||
private final static int LIB_VERSION = 32;
|
||||
private final static int LIB_VERSION = 33;
|
||||
private final static String LIB_NAME = "tmessages." + LIB_VERSION;
|
||||
private final static String LIB_SO_NAME = "lib" + LIB_NAME + ".so";
|
||||
private final static String LOCALE_LIB_SO_NAME = "lib" + LIB_NAME + "loc.so";
|
||||
|
|
|
@ -1314,7 +1314,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
newMsg.fwd_from.flags |= 8;
|
||||
newMsg.fwd_from.post_author = msgObj.messageOwner.fwd_from.post_author;
|
||||
}
|
||||
if ((msgObj.messageOwner.fwd_from.flags & 16) != 0) {
|
||||
if ((msgObj.messageOwner.fwd_from.flags & 16) != 0 && !UserObject.isReplyUser(msgObj.getDialogId())) {
|
||||
newMsg.fwd_from.flags |= 16;
|
||||
newMsg.fwd_from.saved_from_peer = msgObj.messageOwner.fwd_from.saved_from_peer;
|
||||
newMsg.fwd_from.saved_from_msg_id = msgObj.messageOwner.fwd_from.saved_from_msg_id;
|
||||
|
|
|
@ -84,7 +84,6 @@ public class SharedConfig {
|
|||
public static boolean directShare = true;
|
||||
public static boolean inappCamera = true;
|
||||
public static boolean roundCamera16to9 = true;
|
||||
public static boolean assistantSupport = false;
|
||||
public static boolean noSoundHintShowed = false;
|
||||
public static boolean streamMedia = true;
|
||||
public static boolean streamAllVideo = false;
|
||||
|
@ -251,7 +250,6 @@ public class SharedConfig {
|
|||
inappCamera = preferences.getBoolean("inappCamera", true);
|
||||
hasCameraCache = preferences.contains("cameraCache");
|
||||
roundCamera16to9 = true;//preferences.getBoolean("roundCamera16to9", false);
|
||||
assistantSupport = preferences.getBoolean("assistantSupport", false);
|
||||
repeatMode = preferences.getInt("repeatMode", 0);
|
||||
fontSize = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
|
||||
bubbleRadius = preferences.getInt("bubbleRadius", 10);
|
||||
|
@ -747,14 +745,6 @@ public class SharedConfig {
|
|||
editor.commit();
|
||||
}
|
||||
|
||||
public static void toggleAssistantSupport() {
|
||||
assistantSupport = !assistantSupport;
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putBoolean("assistantSupport", assistantSupport);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
public static void toggleRoundCamera16to9() {
|
||||
roundCamera16to9 = !roundCamera16to9;
|
||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||
|
|
|
@ -615,7 +615,6 @@ public class DrawerLayoutContainer extends FrameLayout {
|
|||
|
||||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
// adjustPanLayoutHelper.update();
|
||||
super.dispatchDraw(canvas);
|
||||
if (drawCurrentPreviewFragmentAbove && parentActionBarLayout != null) {
|
||||
if (previewBlurDrawable != null) {
|
||||
|
|
|
@ -351,7 +351,7 @@ public class DialogsSearchAdapter extends RecyclerListView.SelectionAdapter {
|
|||
}, ConnectionsManager.RequestFlagFailOnServerErrors);
|
||||
}
|
||||
|
||||
public boolean hasRecentRearch() {
|
||||
public boolean hasRecentSearch() {
|
||||
return dialogsType != 2 && dialogsType != 4 && dialogsType != 5 && dialogsType != 6 && (!recentSearchObjects.isEmpty() || !MediaDataController.getInstance(currentAccount).hints.isEmpty());
|
||||
}
|
||||
|
||||
|
|
|
@ -8791,7 +8791,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
currentUser.first_name = fwd_from.from_name;
|
||||
} else {
|
||||
int fromId = currentMessageObject.getFromChatId();
|
||||
if (fromId > 0) {
|
||||
if (fromId > 0 && !currentMessageObject.messageOwner.post) {
|
||||
currentUser = messagesController.getUser(fromId);
|
||||
} else if (fromId < 0) {
|
||||
currentChat = messagesController.getChat(-fromId);
|
||||
|
@ -10384,7 +10384,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
endX += AndroidUtilities.dp(14);
|
||||
buttonX -= AndroidUtilities.dp(10);
|
||||
}
|
||||
commentButtonRect.set(buttonX, (int) buttonY, endX - AndroidUtilities.dp(14), (int) (layoutHeight - AndroidUtilities.dp(h)));
|
||||
commentButtonRect.set(buttonX, (int) buttonY, endX - AndroidUtilities.dp(14), layoutHeight - AndroidUtilities.dp(h));
|
||||
if (selectorDrawable[1] != null && selectorDrawableMaskType[1] == 2) {
|
||||
selectorDrawable[1].setBounds(commentButtonRect);
|
||||
selectorDrawable[1].draw(canvas);
|
||||
|
|
|
@ -18444,7 +18444,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
|
||||
private void openChat(ChatMessageCell cell, TLRPC.Chat chat, int postId) {
|
||||
if (currentChat == null || chat.id != currentChat.id || isThreadChat()) {
|
||||
if (currentChat != null && chat.id == currentChat.id) {
|
||||
scrollToMessageId(postId, cell.getMessageObject().getId(), true, 0, true);
|
||||
} else if (currentChat == null || chat.id != currentChat.id || isThreadChat()) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("chat_id", chat.id);
|
||||
if (postId != 0) {
|
||||
|
|
|
@ -2116,7 +2116,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
|||
}
|
||||
if (searchingType != 0) {
|
||||
searchingType = 0;
|
||||
emojiView.closeSearch(true);
|
||||
if (emojiView != null) {
|
||||
emojiView.closeSearch(true);
|
||||
}
|
||||
messageEditText.requestFocus();
|
||||
} else {
|
||||
if (stickersExpanded) {
|
||||
|
|
|
@ -2805,9 +2805,14 @@ public class ChatAttachAlertPhotoLayout extends ChatAttachAlert.AttachAlertLayou
|
|||
cameraAttachAdapter.notifyDataSetChanged();
|
||||
if (!selectedPhotosOrder.isEmpty() && galleryAlbumEntry != null) {
|
||||
for (int a = 0, N = selectedPhotosOrder.size(); a < N; a++) {
|
||||
int imageId = (Integer) selectedPhotosOrder.get(a);
|
||||
Integer imageId = (Integer) selectedPhotosOrder.get(a);
|
||||
Object currentEntry = selectedPhotos.get(imageId);
|
||||
MediaController.PhotoEntry entry = galleryAlbumEntry.photosByIds.get(imageId);
|
||||
if (entry != null) {
|
||||
if (currentEntry instanceof MediaController.PhotoEntry) {
|
||||
MediaController.PhotoEntry photoEntry = (MediaController.PhotoEntry) currentEntry;
|
||||
entry.copyFrom(photoEntry);
|
||||
}
|
||||
selectedPhotos.put(imageId, entry);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1743,7 +1743,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
@Override
|
||||
public void onTextChanged(EditText editText) {
|
||||
String text = editText.getText().toString();
|
||||
if (text.length() != 0 || searchViewPager.dialogsSearchAdapter != null && searchViewPager.dialogsSearchAdapter.hasRecentRearch()) {
|
||||
if (text.length() != 0 || searchViewPager.dialogsSearchAdapter != null && searchViewPager.dialogsSearchAdapter.hasRecentSearch()) {
|
||||
searchWas = true;
|
||||
if (viewPages[0].listView.getVisibility() == View.VISIBLE) {
|
||||
showSearch(true, true);
|
||||
|
@ -3661,7 +3661,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
searchIsShowed = show;
|
||||
if (show) {
|
||||
int dialogsCount = getMessagesController().getTotalDialogsCount();
|
||||
boolean onlyDialogsAdapter = onlySelect || !searchViewPager.dialogsSearchAdapter.hasRecentRearch() || dialogsCount <= 10;
|
||||
boolean onlyDialogsAdapter = onlySelect || !searchViewPager.dialogsSearchAdapter.hasRecentSearch() || dialogsCount <= 10;
|
||||
searchViewPager.showOnlyDialogsAdapter(onlyDialogsAdapter);
|
||||
whiteActionBar = !onlyDialogsAdapter;
|
||||
ContentView contentView = (ContentView) fragmentView;
|
||||
|
@ -3707,7 +3707,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
}
|
||||
}
|
||||
|
||||
if (animated && searchViewPager.dialogsSearchAdapter.hasRecentRearch()) {
|
||||
if (animated && searchViewPager.dialogsSearchAdapter.hasRecentSearch()) {
|
||||
AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid);
|
||||
} else {
|
||||
AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
|
||||
|
|
|
@ -254,6 +254,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
}
|
||||
}
|
||||
|
||||
getWindow().setBackgroundDrawableResource(R.drawable.transparent);
|
||||
if (SharedConfig.passcodeHash.length() > 0 && !SharedConfig.allowScreenCapture) {
|
||||
try {
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
|
||||
|
@ -1142,6 +1143,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
boolean videoCallUser = false;
|
||||
boolean needCallAlert = false;
|
||||
boolean newContact = false;
|
||||
boolean newContactAlert = false;
|
||||
boolean scanQr = false;
|
||||
String searchQuery = null;
|
||||
String callSearchQuery = null;
|
||||
|
@ -1763,7 +1765,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
} else {
|
||||
open_settings = 1;
|
||||
}
|
||||
} else if ((url.startsWith("tg:search") || url.startsWith("tg://search")) && SharedConfig.assistantSupport) {
|
||||
} else if ((url.startsWith("tg:search") || url.startsWith("tg://search"))) {
|
||||
url = url.replace("tg:search", "tg://telegram.org").replace("tg://search", "tg://telegram.org");
|
||||
data = Uri.parse(url);
|
||||
searchQuery = data.getQueryParameter("query");
|
||||
|
@ -1772,9 +1774,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
} else {
|
||||
searchQuery = "";
|
||||
}
|
||||
} else if ((url.startsWith("tg:calllog") || url.startsWith("tg://calllog")) && SharedConfig.assistantSupport) {
|
||||
} else if ((url.startsWith("tg:calllog") || url.startsWith("tg://calllog"))) {
|
||||
showCallLog = true;
|
||||
} else if ((url.startsWith("tg:call") || url.startsWith("tg://call")) && SharedConfig.assistantSupport) {
|
||||
} else if ((url.startsWith("tg:call") || url.startsWith("tg://call"))) {
|
||||
if (UserConfig.getInstance(currentAccount).isClientActivated()) {
|
||||
final String extraForceCall = "extra_force_call";
|
||||
if (ContactsController.getInstance(currentAccount).contactsLoaded || intent.hasExtra(extraForceCall)) {
|
||||
|
@ -1783,21 +1785,27 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
final String callPhone = data.getQueryParameter("phone");
|
||||
final List<TLRPC.TL_contact> contacts = findContacts(callUserName, callPhone, false);
|
||||
|
||||
if (contacts.size() == 1) {
|
||||
push_user_id = contacts.get(0).user_id;
|
||||
}
|
||||
|
||||
if (push_user_id == 0) {
|
||||
callSearchQuery = callUserName != null ? callUserName : "";
|
||||
}
|
||||
|
||||
if ("video".equalsIgnoreCase(callFormat)) {
|
||||
videoCallUser = true;
|
||||
if (contacts.isEmpty() && callPhone != null) {
|
||||
newContactName = callUserName;
|
||||
newContactPhone = callPhone;
|
||||
newContactAlert = true;
|
||||
} else {
|
||||
audioCallUser = true;
|
||||
}
|
||||
if (contacts.size() == 1) {
|
||||
push_user_id = contacts.get(0).user_id;
|
||||
}
|
||||
|
||||
needCallAlert = true;
|
||||
if (push_user_id == 0) {
|
||||
callSearchQuery = callUserName != null ? callUserName : "";
|
||||
}
|
||||
|
||||
if ("video".equalsIgnoreCase(callFormat)) {
|
||||
videoCallUser = true;
|
||||
} else {
|
||||
audioCallUser = true;
|
||||
}
|
||||
|
||||
needCallAlert = true;
|
||||
}
|
||||
} else {
|
||||
final Intent copyIntent = new Intent(intent);
|
||||
copyIntent.removeExtra(EXTRA_ACTION_TOKEN);
|
||||
|
@ -1805,9 +1813,9 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
ContactsLoadingObserver.observe((contactsLoaded) -> handleIntent(copyIntent, true, false, false), 1000);
|
||||
}
|
||||
}
|
||||
} else if ((url.startsWith("tg:scanqr") || url.startsWith("tg://scanqr")) && SharedConfig.assistantSupport) {
|
||||
} else if ((url.startsWith("tg:scanqr") || url.startsWith("tg://scanqr"))) {
|
||||
scanQr = true;
|
||||
} else if ((url.startsWith("tg:addcontact") || url.startsWith("tg://addcontact")) && SharedConfig.assistantSupport) {
|
||||
} else if ((url.startsWith("tg:addcontact") || url.startsWith("tg://addcontact"))) {
|
||||
url = url.replace("tg:addcontact", "tg://telegram.org").replace("tg://addcontact", "tg://telegram.org");
|
||||
data = Uri.parse(url);
|
||||
newContactName = data.getQueryParameter("name");
|
||||
|
@ -2151,6 +2159,28 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
drawerLayoutContainer.setAllowOpenDrawer(true, false);
|
||||
}
|
||||
pushOpened = true;
|
||||
} else if (newContactAlert) {
|
||||
final BaseFragment lastFragment = actionBarLayout.getLastFragment();
|
||||
if (lastFragment != null && lastFragment.getParentActivity() != null) {
|
||||
final String finalNewContactName = newContactName;
|
||||
final String finalNewContactPhone = "+" + PhoneFormat.stripExceptNumbers(newContactPhone);
|
||||
final AlertDialog newContactAlertDialog = new AlertDialog.Builder(lastFragment.getParentActivity())
|
||||
.setTitle(LocaleController.getString("NewContactAlertTitle", R.string.NewContactAlertTitle))
|
||||
.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("NewContactAlertMessage", R.string.NewContactAlertMessage, PhoneFormat.getInstance().format(finalNewContactPhone))))
|
||||
.setPositiveButton(LocaleController.getString("NewContactAlertButton", R.string.NewContactAlertButton), (d, i) -> {
|
||||
final NewContactActivity fragment = new NewContactActivity();
|
||||
fragment.setInitialPhoneNumber(finalNewContactPhone, false);
|
||||
if (finalNewContactName != null) {
|
||||
final String[] names = finalNewContactName.split(" ", 2);
|
||||
fragment.setInitialName(names[0], names.length > 1 ? names[1] : null);
|
||||
}
|
||||
lastFragment.presentFragment(fragment);
|
||||
})
|
||||
.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null)
|
||||
.create();
|
||||
lastFragment.showDialog(newContactAlertDialog);
|
||||
pushOpened = true;
|
||||
}
|
||||
} else if (showCallLog) {
|
||||
actionBarLayout.presentFragment(new CallLogActivity(), false, true, true, false);
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
|
@ -2931,7 +2961,11 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
|
||||
if (userPhone != null) {
|
||||
userPhone = PhoneFormat.stripExceptNumbers(userPhone);
|
||||
final TLRPC.TL_contact contact = contactsController.contactsByPhone.get(userPhone);
|
||||
TLRPC.TL_contact contact = contactsController.contactsByPhone.get(userPhone);
|
||||
if (contact == null) {
|
||||
String shortUserPhone = userPhone.substring(Math.max(0, userPhone.length() - 7));
|
||||
contact = contactsController.contactsByShortPhone.get(shortUserPhone);
|
||||
}
|
||||
if (contact != null) {
|
||||
final TLRPC.User user = messagesController.getUser(contact.user_id);
|
||||
if (user != null && (!user.self || allowSelf)) {
|
||||
|
|
|
@ -1777,7 +1777,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
button.setTextColor(Theme.getColor(Theme.key_dialogTextRed2));
|
||||
}
|
||||
} else if (id == add_photo) {
|
||||
writeButton.callOnClick();
|
||||
onWriteButtonClick();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2279,7 +2279,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
getMessagesController().unblockPeer(user_id);
|
||||
AlertsCreator.showSimpleToast(ProfileActivity.this, LocaleController.getString("UserUnblocked", R.string.UserUnblocked));
|
||||
} else if (position == sendMessageRow) {
|
||||
writeButton.callOnClick();
|
||||
onWriteButtonClick();
|
||||
} else if (position == reportRow) {
|
||||
AlertsCreator.createReportAlert(getParentActivity(), getDialogId(), 0, ProfileActivity.this);
|
||||
} else if (position >= membersStartRow && position < membersEndRow) {
|
||||
|
@ -2385,7 +2385,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
} else if (position == numberRow) {
|
||||
presentFragment(new ActionIntroActivity(ActionIntroActivity.ACTION_TYPE_CHANGE_PHONE_NUMBER));
|
||||
} else if (position == setAvatarRow) {
|
||||
writeButton.callOnClick();
|
||||
onWriteButtonClick();
|
||||
} else {
|
||||
processOnClickOrPress(position);
|
||||
}
|
||||
|
@ -2417,8 +2417,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
LocaleController.getString("DebugMenuReadAllDialogs", R.string.DebugMenuReadAllDialogs),
|
||||
SharedConfig.pauseMusicOnRecord ? LocaleController.getString("DebugMenuDisablePauseMusic", R.string.DebugMenuDisablePauseMusic) : LocaleController.getString("DebugMenuEnablePauseMusic", R.string.DebugMenuEnablePauseMusic),
|
||||
BuildVars.DEBUG_VERSION && !AndroidUtilities.isTablet() && Build.VERSION.SDK_INT >= 23 ? (SharedConfig.smoothKeyboard ? LocaleController.getString("DebugMenuDisableSmoothKeyboard", R.string.DebugMenuDisableSmoothKeyboard) : LocaleController.getString("DebugMenuEnableSmoothKeyboard", R.string.DebugMenuEnableSmoothKeyboard)) : null,
|
||||
Build.VERSION.SDK_INT >= 29 ? (SharedConfig.chatBubbles ? "Disable chat bubbles" : "Enable chat bubbles") : null,
|
||||
SharedConfig.assistantSupport ? "Disable Google Assistant support" : "Enable Google Assistant Support"
|
||||
Build.VERSION.SDK_INT >= 29 ? (SharedConfig.chatBubbles ? "Disable chat bubbles" : "Enable chat bubbles") : null
|
||||
};
|
||||
builder.setItems(items, (dialog, which) -> {
|
||||
if (which == 0) {
|
||||
|
@ -2464,8 +2463,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
}
|
||||
} else if (which == 13) {
|
||||
SharedConfig.toggleChatBubbles();
|
||||
} else if (which == 14) {
|
||||
SharedConfig.toggleAssistantSupport();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
|
@ -2793,48 +2790,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
if (writeButton.getTag() != null) {
|
||||
return;
|
||||
}
|
||||
if (user_id != 0) {
|
||||
if (imageUpdater != null) {
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(UserConfig.getInstance(currentAccount).getClientUserId());
|
||||
if (user == null) {
|
||||
user = UserConfig.getInstance(currentAccount).getCurrentUser();
|
||||
}
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
imageUpdater.openMenu(user.photo != null && user.photo.photo_big != null && !(user.photo instanceof TLRPC.TL_userProfilePhotoEmpty), () -> MessagesController.getInstance(currentAccount).deleteUserPhoto(null));
|
||||
} else {
|
||||
if (playProfileAnimation != 0 && parentLayout.fragmentsStack.get(parentLayout.fragmentsStack.size() - 2) instanceof ChatActivity) {
|
||||
finishFragment();
|
||||
} else {
|
||||
TLRPC.User user = getMessagesController().getUser(user_id);
|
||||
if (user == null || user instanceof TLRPC.TL_userEmpty) {
|
||||
return;
|
||||
}
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("user_id", user_id);
|
||||
if (!getMessagesController().checkCanOpenChat(args, ProfileActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if (!AndroidUtilities.isTablet()) {
|
||||
getNotificationCenter().removeObserver(ProfileActivity.this, NotificationCenter.closeChats);
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.closeChats);
|
||||
}
|
||||
int distance = getArguments().getInt("nearby_distance", -1);
|
||||
if (distance >= 0) {
|
||||
args.putInt("nearby_distance", distance);
|
||||
}
|
||||
ChatActivity chatActivity = new ChatActivity(args);
|
||||
chatActivity.setPreloadedSticker(preloadedSticker);
|
||||
presentFragment(chatActivity, true);
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
finishFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
openDiscussion();
|
||||
}
|
||||
onWriteButtonClick();
|
||||
});
|
||||
needLayout(false);
|
||||
|
||||
|
@ -3021,6 +2977,51 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
}
|
||||
}
|
||||
|
||||
private void onWriteButtonClick() {
|
||||
if (user_id != 0) {
|
||||
if (imageUpdater != null) {
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(UserConfig.getInstance(currentAccount).getClientUserId());
|
||||
if (user == null) {
|
||||
user = UserConfig.getInstance(currentAccount).getCurrentUser();
|
||||
}
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
imageUpdater.openMenu(user.photo != null && user.photo.photo_big != null && !(user.photo instanceof TLRPC.TL_userProfilePhotoEmpty), () -> MessagesController.getInstance(currentAccount).deleteUserPhoto(null));
|
||||
} else {
|
||||
if (playProfileAnimation != 0 && parentLayout.fragmentsStack.get(parentLayout.fragmentsStack.size() - 2) instanceof ChatActivity) {
|
||||
finishFragment();
|
||||
} else {
|
||||
TLRPC.User user = getMessagesController().getUser(user_id);
|
||||
if (user == null || user instanceof TLRPC.TL_userEmpty) {
|
||||
return;
|
||||
}
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("user_id", user_id);
|
||||
if (!getMessagesController().checkCanOpenChat(args, ProfileActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if (!AndroidUtilities.isTablet()) {
|
||||
getNotificationCenter().removeObserver(ProfileActivity.this, NotificationCenter.closeChats);
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.closeChats);
|
||||
}
|
||||
int distance = getArguments().getInt("nearby_distance", -1);
|
||||
if (distance >= 0) {
|
||||
args.putInt("nearby_distance", distance);
|
||||
}
|
||||
ChatActivity chatActivity = new ChatActivity(args);
|
||||
chatActivity.setPreloadedSticker(preloadedSticker);
|
||||
presentFragment(chatActivity, true);
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
finishFragment();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
openDiscussion();
|
||||
}
|
||||
}
|
||||
|
||||
private void openDiscussion() {
|
||||
if (chatInfo == null || chatInfo.linked_chat_id == 0) {
|
||||
return;
|
||||
|
|
|
@ -1216,6 +1216,9 @@
|
|||
<string name="NoContactsYetLine1">Invite friends to try Telegram</string>
|
||||
<string name="NoContactsYetLine2">Find people nearby to chat with</string>
|
||||
<string name="NoContactsYetLine3">Search people by username</string>
|
||||
<string name="NewContactAlertTitle">New contact</string>
|
||||
<string name="NewContactAlertMessage">Phone number **%1$s** is not in your contact list. Do you want to add it?</string>
|
||||
<string name="NewContactAlertButton">Add contact</string>
|
||||
<!--group create view-->
|
||||
<string name="SendMessageTo">Add people...</string>
|
||||
<string name="SoftUserLimitAlert">You will be able to add more users after you finish creating the group and convert it to a supergroup.</string>
|
||||
|
|
31
TMessagesProj/src/main/res/xml/actions.xml
Normal file
31
TMessagesProj/src/main/res/xml/actions.xml
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<actions>
|
||||
<action intentName="actions.intent.GET_THING">
|
||||
<fulfillment urlTemplate="tg://search{?query}">
|
||||
<parameter-mapping urlParameter="query" intentParameter="thing.name" required="true"/>
|
||||
</fulfillment>
|
||||
<fulfillment urlTemplate="tg://search"/>
|
||||
</action>
|
||||
<action intentName="actions.intent.CREATE_CALL">
|
||||
<fulfillment urlTemplate="tg://call{?format,name,phone}">
|
||||
<parameter-mapping urlParameter="format" intentParameter="call.callFormat"/>
|
||||
<parameter-mapping urlParameter="name" intentParameter="call.participant.name"/>
|
||||
<parameter-mapping urlParameter="phone" intentParameter="call.participant.telephone"/>
|
||||
</fulfillment>
|
||||
</action>
|
||||
<action intentName="actions.intent.GET_ACCOUNT">
|
||||
<fulfillment urlTemplate="tg://settings"/>
|
||||
</action>
|
||||
<action intentName="actions.intent.GET_BARCODE">
|
||||
<fulfillment urlTemplate="tg://scanqr"/>
|
||||
</action>
|
||||
<action intentName="actions.intent.CREATE_CONTACT_POINT">
|
||||
<fulfillment urlTemplate="tg://addcontact{?name,phone}">
|
||||
<parameter-mapping urlParameter="name" intentParameter="contactPoint.contact.name"/>
|
||||
<parameter-mapping urlParameter="phone" intentParameter="contactPoint.telephone"/>
|
||||
</fulfillment>
|
||||
</action>
|
||||
<action intentName="actions.intent.GET_CALL">
|
||||
<fulfillment urlTemplate="tg://calllog"/>
|
||||
</action>
|
||||
</actions>
|
Loading…
Reference in a new issue