Merge official 8.7.4

This commit is contained in:
luvletter2333 2022-05-08 15:01:14 +08:00
commit 37c2793e69
No known key found for this signature in database
GPG Key ID: A26A8880836E1978
6 changed files with 87 additions and 30 deletions

View File

@ -3,15 +3,15 @@ import cn.hutool.core.util.RuntimeUtil
apply plugin: "com.android.application" apply plugin: "com.android.application"
apply plugin: "kotlin-android" apply plugin: "kotlin-android"
def verName = "8.7.2-preview01" def verName = "8.7.4-preview01"
def verCode = 625 def verCode = 630
if (System.getenv("DEBUG_BUILD") == "true") { if (System.getenv("DEBUG_BUILD") == "true") {
verName += "-" + RuntimeUtil.execForStr("git log --pretty=format:'%h' -n 1").trim() verName += "-" + RuntimeUtil.execForStr("git log --pretty=format:'%h' -n 1").trim()
} }
def officialVer = "8.7.2" def officialVer = "8.7.4"
def officialCode = 2634 def officialCode = 2636
def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json") def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")

View File

@ -2582,7 +2582,7 @@ public class ImageLoader {
img.imageType = FileLoader.IMAGE_TYPE_LOTTIE; img.imageType = FileLoader.IMAGE_TYPE_LOTTIE;
} else if ("application/x-tgwallpattern".equals(imageLocation.document.mime_type)) { } else if ("application/x-tgwallpattern".equals(imageLocation.document.mime_type)) {
img.imageType = FileLoader.IMAGE_TYPE_SVG; img.imageType = FileLoader.IMAGE_TYPE_SVG;
} else if (BuildVars.DEBUG_PRIVATE_VERSION) { } else {
String name = FileLoader.getDocumentFileName(imageLocation.document); String name = FileLoader.getDocumentFileName(imageLocation.document);
if (name.endsWith(".svg")) { if (name.endsWith(".svg")) {
img.imageType = FileLoader.IMAGE_TYPE_SVG; img.imageType = FileLoader.IMAGE_TYPE_SVG;
@ -2616,7 +2616,7 @@ public class ImageLoader {
img.imageType = FileLoader.IMAGE_TYPE_LOTTIE; img.imageType = FileLoader.IMAGE_TYPE_LOTTIE;
} else if ("application/x-tgwallpattern".equals(document.mime_type)) { } else if ("application/x-tgwallpattern".equals(document.mime_type)) {
img.imageType = FileLoader.IMAGE_TYPE_SVG; img.imageType = FileLoader.IMAGE_TYPE_SVG;
} else if (BuildVars.DEBUG_PRIVATE_VERSION) { } else {
String name = FileLoader.getDocumentFileName(imageLocation.document); String name = FileLoader.getDocumentFileName(imageLocation.document);
if (name.endsWith(".svg")) { if (name.endsWith(".svg")) {
img.imageType = FileLoader.IMAGE_TYPE_SVG; img.imageType = FileLoader.IMAGE_TYPE_SVG;

View File

@ -89,6 +89,7 @@ import org.telegram.messenger.BuildConfig;
import org.telegram.messenger.BuildVars; import org.telegram.messenger.BuildVars;
import org.telegram.messenger.ChatObject; import org.telegram.messenger.ChatObject;
import org.telegram.messenger.ContactsController; import org.telegram.messenger.ContactsController;
import org.telegram.messenger.DownloadController;
import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog; import org.telegram.messenger.FileLog;
import org.telegram.messenger.ImageLoader; import org.telegram.messenger.ImageLoader;
@ -3410,15 +3411,62 @@ public class VoIPService extends Service implements SensorEventListener, AudioMa
req.peer = new TLRPC.TL_inputPhoneCall(); req.peer = new TLRPC.TL_inputPhoneCall();
req.peer.access_hash = privateCall.access_hash; req.peer.access_hash = privateCall.access_hash;
req.peer.id = privateCall.id; req.peer.id = privateCall.id;
File file = new File(VoIPHelper.getLogFilePath(privateCall.id, true));
String cachedFile = MediaController.copyFileToCache(Uri.fromFile(file), "log");
ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> { ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {
if (BuildVars.LOGS_ENABLED) { if (BuildVars.LOGS_ENABLED) {
FileLog.d("Sent debug logs, response = " + response); FileLog.d("Sent debug logs, response = " + response);
} }
try {
if (response instanceof TLRPC.TL_boolFalse) {
AndroidUtilities.runOnUIThread(() -> {
uploadLogFile(cachedFile);
});
} else {
File cacheFile = new File(cachedFile);
cacheFile.delete();
}
} catch (Exception e) {
FileLog.e(e);
}
}); });
needSendDebugLog = false; needSendDebugLog = false;
} }
} }
private void uploadLogFile(String filePath) {
NotificationCenter.NotificationCenterDelegate uploadDelegate = new NotificationCenter.NotificationCenterDelegate() {
@Override
public void didReceivedNotification(int id, int account, Object... args) {
if (id == NotificationCenter.fileUploaded || id == NotificationCenter.fileUploadFailed) {
final String location = (String) args[0];
if (location.equals(filePath)) {
if (id == NotificationCenter.fileUploaded) {
TLRPC.TL_phone_saveCallLog req = new TLRPC.TL_phone_saveCallLog();
final TLRPC.InputFile file = (TLRPC.InputFile) args[1];
req.file = file;
req.peer = new TLRPC.TL_inputPhoneCall();
req.peer.access_hash = privateCall.access_hash;
req.peer.id = privateCall.id;
ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("Sent debug file log, response = " + response);
}
});
}
NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.fileUploaded);
NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.fileUploadFailed);
}
}
}
};
NotificationCenter.getInstance(currentAccount).addObserver(uploadDelegate, NotificationCenter.fileUploaded);
NotificationCenter.getInstance(currentAccount).addObserver(uploadDelegate, NotificationCenter.fileUploadFailed);
FileLoader.getInstance(currentAccount).uploadFile(filePath, false, true, ConnectionsManager.FileTypeFile);
}
private void initializeAccountRelatedThings() { private void initializeAccountRelatedThings() {
updateServerConfig(); updateServerConfig();
NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.appDidLogout); NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.appDidLogout);

View File

@ -52533,6 +52533,23 @@ public class TLRPC {
} }
} }
public static class TL_phone_saveCallLog extends TLObject {
public static int constructor = 0x41248786;
public TL_inputPhoneCall peer;
public InputFile file;
public TLObject deserializeResponse(AbstractSerializedData stream, int constructor, boolean exception) {
return Bool.TLdeserialize(stream, constructor, exception);
}
public void serializeToStream(AbstractSerializedData stream) {
stream.writeInt32(constructor);
peer.serializeToStream(stream);
file.serializeToStream(stream);
}
}
public static class TL_phone_sendSignalingData extends TLObject { public static class TL_phone_sendSignalingData extends TLObject {
public static int constructor = 0xff7a9383; public static int constructor = 0xff7a9383;

View File

@ -32,20 +32,16 @@ public class AttachBotIntroTopView extends View {
public AttachBotIntroTopView(Context context) { public AttachBotIntroTopView(Context context) {
super(context); super(context);
imageReceiver = new ImageReceiver(this) { imageReceiver = new ImageReceiver(this);
@Override
protected boolean setImageBitmapByKey(Drawable drawable, String key, int type, boolean memCache, int guid) {
boolean set = super.setImageBitmapByKey(drawable, key, type, memCache, guid);
ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(150);
anim.addUpdateListener(animation -> {
imageReceiver.setAlpha((Float) animation.getAnimatedValue());
invalidate();
});
anim.start();
return set;
}
};
imageReceiver.setAlpha(0); imageReceiver.setAlpha(0);
imageReceiver.setDelegate((imageReceiver1, set, thumb, memCache) -> {
ValueAnimator anim = ValueAnimator.ofFloat(0, 1).setDuration(150);
anim.addUpdateListener(animation -> {
imageReceiver.setAlpha((Float) animation.getAnimatedValue());
invalidate();
});
anim.start();
});
attachDrawable = ContextCompat.getDrawable(context, R.drawable.input_attach).mutate().getConstantState().newDrawable(); attachDrawable = ContextCompat.getDrawable(context, R.drawable.input_attach).mutate().getConstantState().newDrawable();
paint.setStyle(Paint.Style.STROKE); paint.setStyle(Paint.Style.STROKE);

View File

@ -72,7 +72,6 @@ import org.telegram.messenger.ChatObject;
import org.telegram.messenger.ContactsController; import org.telegram.messenger.ContactsController;
import org.telegram.messenger.Emoji; import org.telegram.messenger.Emoji;
import org.telegram.messenger.ImageLocation; import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.ImageReceiver;
import org.telegram.messenger.LocaleController; import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MediaController; import org.telegram.messenger.MediaController;
import org.telegram.messenger.MediaDataController; import org.telegram.messenger.MediaDataController;
@ -761,17 +760,14 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
imageView = new BackupImageView(context) { imageView = new BackupImageView(context) {
{ {
imageReceiver = new ImageReceiver(this) { imageReceiver.setDelegate((imageReceiver1, set, thumb, memCache) -> {
@Override Drawable drawable = imageReceiver1.getDrawable();
protected boolean setImageBitmapByKey(Drawable drawable, String key, int type, boolean memCache, int guid) { if (drawable instanceof RLottieDrawable) {
if (drawable instanceof RLottieDrawable) { ((RLottieDrawable) drawable).setCustomEndFrame(0);
((RLottieDrawable) drawable).setCustomEndFrame(0); ((RLottieDrawable) drawable).stop();
((RLottieDrawable) drawable).stop(); ((RLottieDrawable) drawable).setProgress(0, false);
((RLottieDrawable) drawable).setProgress(0, false);
}
return super.setImageBitmapByKey(drawable, key, type, memCache, guid);
} }
}; });
} }
@Override @Override