mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 06:25:14 +01:00
Update to 7.4.1 (2225)
This commit is contained in:
parent
eb94e31b4c
commit
fed0c139e7
10 changed files with 79 additions and 44 deletions
|
@ -290,7 +290,7 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
defaultConfig.versionCode = 2223
|
||||
defaultConfig.versionCode = 2225
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
|
@ -309,7 +309,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionName "7.4.0"
|
||||
versionName "7.4.1"
|
||||
|
||||
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
|
||||
|
||||
|
|
|
@ -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 = 2223;
|
||||
public static int BUILD_VERSION = 2225;
|
||||
public static String BUILD_VERSION_STRING = "7.4.0";
|
||||
public static int APP_ID = 4;
|
||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||
|
|
|
@ -4050,24 +4050,32 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
|||
}
|
||||
|
||||
public static String getFileName(Uri uri) {
|
||||
String result = null;
|
||||
if (uri.getScheme().equals("content")) {
|
||||
try (Cursor cursor = ApplicationLoader.applicationContext.getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null)) {
|
||||
if (cursor.moveToFirst()) {
|
||||
result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
|
||||
if (uri == null) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
String result = null;
|
||||
if (uri.getScheme().equals("content")) {
|
||||
try (Cursor cursor = ApplicationLoader.applicationContext.getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null)) {
|
||||
if (cursor.moveToFirst()) {
|
||||
result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
if (result == null) {
|
||||
result = uri.getPath();
|
||||
int cut = result.lastIndexOf('/');
|
||||
if (cut != -1) {
|
||||
result = result.substring(cut + 1);
|
||||
if (result == null) {
|
||||
result = uri.getPath();
|
||||
int cut = result.lastIndexOf('/');
|
||||
if (cut != -1) {
|
||||
result = result.substring(cut + 1);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
return result;
|
||||
return "";
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedPrivateApi")
|
||||
|
|
|
@ -730,12 +730,15 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
pendingSuggestions = new HashSet<>();
|
||||
}
|
||||
|
||||
exportUri = mainPreferences.getStringSet("exportUri", null);
|
||||
exportUri = mainPreferences.getStringSet("exportUri2", null);
|
||||
if (exportUri != null) {
|
||||
exportUri = new HashSet<>(exportUri);
|
||||
} else {
|
||||
exportUri = new HashSet<>();
|
||||
exportUri.add("content://com.whatsapp.provider.media/export_chat/");
|
||||
exportUri.add("content://(\\d+@)?com\\.whatsapp\\.provider\\.media/export_chat/");
|
||||
exportUri.add("content://(\\d+@)?com\\.whatsapp\\.w4b\\.provider\\.media/export_chat/");
|
||||
exportUri.add("content://jp\\.naver\\.line\\.android\\.line\\.common\\.FileProvider/export-chat/");
|
||||
exportUri.add(".*WhatsApp.*\\.txt$");
|
||||
}
|
||||
|
||||
exportGroupUri = mainPreferences.getStringSet("exportGroupUri", null);
|
||||
|
@ -1493,7 +1496,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
}
|
||||
break;
|
||||
}
|
||||
case "export_urls": {
|
||||
case "export_regex": {
|
||||
HashSet<String> newExport = new HashSet<>();
|
||||
if (value.value instanceof TLRPC.TL_jsonArray) {
|
||||
TLRPC.TL_jsonArray array = (TLRPC.TL_jsonArray) value.value;
|
||||
|
@ -1507,7 +1510,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
}
|
||||
if (!exportUri.equals(newExport)) {
|
||||
exportUri = newExport;
|
||||
editor.putStringSet("exportUri", exportUri);
|
||||
editor.putStringSet("exportUri2", exportUri);
|
||||
changed = true;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -676,7 +676,7 @@ public class NotificationsController extends BaseController {
|
|||
|
||||
for (int a = 0; a < messageObjects.size(); a++) {
|
||||
MessageObject messageObject = messageObjects.get(a);
|
||||
if (messageObject.messageOwner != null && messageObject.messageOwner.silent && (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionContactSignUp || messageObject.messageOwner.action instanceof TLRPC.TL_messageActionUserJoined)) {
|
||||
if (messageObject.messageOwner != null && (messageObject.isImportedForward() || messageObject.messageOwner.silent && (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionContactSignUp || messageObject.messageOwner.action instanceof TLRPC.TL_messageActionUserJoined))) {
|
||||
continue;
|
||||
}
|
||||
long mid = messageObject.getId();
|
||||
|
@ -991,7 +991,7 @@ public class NotificationsController extends BaseController {
|
|||
if (messages != null) {
|
||||
for (int a = 0; a < messages.size(); a++) {
|
||||
TLRPC.Message message = messages.get(a);
|
||||
if (message != null && message.silent && (message.action instanceof TLRPC.TL_messageActionContactSignUp || message.action instanceof TLRPC.TL_messageActionUserJoined)) {
|
||||
if (message != null && (message.fwd_from != null && message.fwd_from.imported || message.silent && (message.action instanceof TLRPC.TL_messageActionContactSignUp || message.action instanceof TLRPC.TL_messageActionUserJoined))) {
|
||||
continue;
|
||||
}
|
||||
long mid = message.id;
|
||||
|
|
|
@ -2909,6 +2909,11 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
}
|
||||
}
|
||||
} else {
|
||||
boolean canSendStickers = true;
|
||||
if (lower_id < 0) {
|
||||
TLRPC.Chat chat = getMessagesController().getChat(-lower_id);
|
||||
canSendStickers = ChatObject.canSendStickers(chat);
|
||||
}
|
||||
if (message != null) {
|
||||
if (encryptedChat != null) {
|
||||
newMsg = new TLRPC.TL_message_secret();
|
||||
|
@ -2924,7 +2929,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
webPage = null;
|
||||
}
|
||||
}
|
||||
if (message.length() < 30 && webPage == null && (entities == null || entities.isEmpty()) && getMessagesController().diceEmojies.contains(message.replace("\ufe0f", "")) && encryptedChat == null && scheduleDate == 0) {
|
||||
if (canSendStickers && message.length() < 30 && webPage == null && (entities == null || entities.isEmpty()) && getMessagesController().diceEmojies.contains(message.replace("\ufe0f", "")) && encryptedChat == null && scheduleDate == 0) {
|
||||
TLRPC.TL_messageMediaDice mediaDice = new TLRPC.TL_messageMediaDice();
|
||||
mediaDice.emoticon = message;
|
||||
mediaDice.value = -1;
|
||||
|
@ -3033,8 +3038,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
newMsg = new TLRPC.TL_message();
|
||||
}
|
||||
if (lower_id < 0) {
|
||||
TLRPC.Chat chat = getMessagesController().getChat(-lower_id);
|
||||
if (chat != null && !ChatObject.canSendStickers(chat)) {
|
||||
if (!canSendStickers) {
|
||||
for (int a = 0, N = document.attributes.size(); a < N; a++) {
|
||||
if (document.attributes.get(a) instanceof TLRPC.TL_documentAttributeAnimated) {
|
||||
document.attributes.remove(a);
|
||||
|
|
|
@ -1391,7 +1391,7 @@ public class DialogCell extends BaseCell {
|
|||
nameLeft += w;
|
||||
}
|
||||
} else if (drawScam != 0) {
|
||||
int w = AndroidUtilities.dp(6) + (drawScam == 0 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).getIntrinsicWidth();
|
||||
int w = AndroidUtilities.dp(6) + (drawScam == 1 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).getIntrinsicWidth();
|
||||
nameWidth -= w;
|
||||
if (LocaleController.isRTL) {
|
||||
nameLeft += w;
|
||||
|
@ -1610,7 +1610,7 @@ public class DialogCell extends BaseCell {
|
|||
} else if (drawVerified) {
|
||||
nameMuteLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - Theme.dialogs_verifiedDrawable.getIntrinsicWidth());
|
||||
} else if (drawScam != 0) {
|
||||
nameMuteLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - (drawScam == 0 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).getIntrinsicWidth());
|
||||
nameMuteLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - (drawScam == 1 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).getIntrinsicWidth());
|
||||
}
|
||||
if (left == 0) {
|
||||
if (widthpx < nameWidth) {
|
||||
|
@ -2508,8 +2508,8 @@ public class DialogCell extends BaseCell {
|
|||
Theme.dialogs_verifiedDrawable.draw(canvas);
|
||||
Theme.dialogs_verifiedCheckDrawable.draw(canvas);
|
||||
} else if (drawScam != 0) {
|
||||
setDrawableBounds((drawScam == 0 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable), nameMuteLeft, AndroidUtilities.dp(useForceThreeLines || SharedConfig.useThreeLinesLayout ? 12 : 15));
|
||||
(drawScam == 0 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).draw(canvas);
|
||||
setDrawableBounds((drawScam == 1 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable), nameMuteLeft, AndroidUtilities.dp(useForceThreeLines || SharedConfig.useThreeLinesLayout ? 12 : 15));
|
||||
(drawScam == 1 ? Theme.dialogs_scamDrawable : Theme.dialogs_fakeDrawable).draw(canvas);
|
||||
}
|
||||
|
||||
if (drawReorder || reorderIconProgress != 0) {
|
||||
|
|
|
@ -99,7 +99,7 @@ public class LinkActionView extends LinearLayout {
|
|||
copyView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
copyView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
copyView.setLines(1);
|
||||
linearLayout.addView(copyView, LayoutHelper.createLinear(0, LayoutHelper.WRAP_CONTENT, 1f, 0, 4, 0, 4, 0));
|
||||
linearLayout.addView(copyView, LayoutHelper.createLinear(0, 40, 1f, 0, 4, 0, 4, 0));
|
||||
|
||||
shareView = new TextView(context);
|
||||
shareView.setGravity(Gravity.CENTER_HORIZONTAL);
|
||||
|
@ -114,7 +114,7 @@ public class LinkActionView extends LinearLayout {
|
|||
shareView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
shareView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
|
||||
shareView.setLines(1);
|
||||
linearLayout.addView(shareView, LayoutHelper.createLinear(0, LayoutHelper.WRAP_CONTENT, 1f, 4, 0, 4, 0));
|
||||
linearLayout.addView(shareView, LayoutHelper.createLinear(0, 40, 1f, 4, 0, 4, 0));
|
||||
|
||||
|
||||
removeView = new TextView(context);
|
||||
|
|
|
@ -358,6 +358,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
|||
private float colorChangeProgress;
|
||||
private long lastUpdateTime;
|
||||
private float[] volumeAlphas = new float[3];
|
||||
private boolean dragging;
|
||||
|
||||
public VolumeSlider(Context context, TLRPC.TL_groupCallParticipant participant) {
|
||||
super(context);
|
||||
|
@ -446,14 +447,14 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
|||
} else if (thumbX > getMeasuredWidth()) {
|
||||
thumbX = getMeasuredWidth();
|
||||
}
|
||||
pressed = true;
|
||||
dragging = true;
|
||||
}
|
||||
}
|
||||
if (pressed) {
|
||||
if (dragging) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_UP) {
|
||||
onSeekBarDrag(thumbX / (double) getMeasuredWidth(), true);
|
||||
}
|
||||
pressed = false;
|
||||
dragging = false;
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
|
@ -473,13 +474,13 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
|||
} else if (thumbX > getMeasuredWidth()) {
|
||||
thumbX = getMeasuredWidth();
|
||||
}
|
||||
pressed = true;
|
||||
dragging = true;
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (pressed) {
|
||||
if (dragging) {
|
||||
thumbX = (int) ev.getX();
|
||||
if (thumbX < 0) {
|
||||
thumbX = 0;
|
||||
|
|
|
@ -142,6 +142,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class LaunchActivity extends Activity implements ActionBarLayout.ActionBarLayoutDelegate, NotificationCenter.NotificationCenterDelegate, DialogsActivity.DialogsActivityDelegate {
|
||||
|
||||
|
@ -1307,11 +1308,20 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
} else {
|
||||
String originalPath = uri.toString();
|
||||
if (dialogId == 0 && originalPath != null) {
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("export path = " + originalPath);
|
||||
}
|
||||
Set<String> exportUris = MessagesController.getInstance(intentAccount[0]).exportUri;
|
||||
String fileName = FileLoader.fixFileName(MediaController.getFileName(uri));
|
||||
for (String u : exportUris) {
|
||||
if (originalPath.startsWith(u)) {
|
||||
exportingChatUri = uri;
|
||||
break;
|
||||
try {
|
||||
Pattern pattern = Pattern.compile(u);
|
||||
if (pattern.matcher(originalPath).find() || pattern.matcher(fileName).find()) {
|
||||
exportingChatUri = uri;
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
if (exportingChatUri == null) {
|
||||
|
@ -1405,13 +1415,22 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
|||
originalPath = path;
|
||||
}
|
||||
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("export path = " + originalPath);
|
||||
}
|
||||
if (dialogId == 0 && originalPath != null && exportingChatUri == null) {
|
||||
boolean ok = false;
|
||||
String fileName = FileLoader.fixFileName(MediaController.getFileName(uri));
|
||||
for (String u : exportUris) {
|
||||
if (originalPath.startsWith(u)) {
|
||||
exportingChatUri = uri;
|
||||
ok = true;
|
||||
break;
|
||||
try {
|
||||
Pattern pattern = Pattern.compile(u);
|
||||
if (pattern.matcher(originalPath).find() || pattern.matcher(fileName).find()) {
|
||||
exportingChatUri = uri;
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
|
|
Loading…
Reference in a new issue