mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
update to 8.9.3
This commit is contained in:
parent
172335d189
commit
43fe75b46b
9 changed files with 41 additions and 23 deletions
|
@ -20,8 +20,8 @@ public class BuildVars {
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
||||||
public static int BUILD_VERSION = 2756;
|
public static int BUILD_VERSION = 2757;
|
||||||
public static String BUILD_VERSION_STRING = "8.9.2";
|
public static String BUILD_VERSION_STRING = "8.9.3";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,12 @@ public class GoogleLocationProvider implements ILocationServiceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getLastLocation(Consumer<Location> callback) {
|
public void getLastLocation(Consumer<Location> callback) {
|
||||||
locationProviderClient.getLastLocation().addOnCompleteListener(task -> callback.accept(task.getResult()));
|
locationProviderClient.getLastLocation().addOnCompleteListener(task -> {
|
||||||
|
if (task.getException() != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback.accept(task.getResult());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6682,7 +6682,7 @@ public class MediaDataController extends BaseController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
String aliasFinal = alias;
|
String aliasFinal = alias;
|
||||||
if (allowAnimated) {
|
if (allowAnimated && SharedConfig.suggestAnimatedEmoji) {
|
||||||
fillWithAnimatedEmoji(result, null, () -> {
|
fillWithAnimatedEmoji(result, null, () -> {
|
||||||
if (sync != null) {
|
if (sync != null) {
|
||||||
callback.run(result, aliasFinal);
|
callback.run(result, aliasFinal);
|
||||||
|
|
|
@ -3883,6 +3883,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
||||||
update.channel_id = dialog.peer.channel_id;
|
update.channel_id = dialog.peer.channel_id;
|
||||||
update.max_id = dialog.read_inbox_max_id;
|
update.max_id = dialog.read_inbox_max_id;
|
||||||
|
update.still_unread_count = dialog.unread_count;
|
||||||
arrayList.add(update);
|
arrayList.add(update);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();
|
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();
|
||||||
|
@ -4026,6 +4027,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||||
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
||||||
update.channel_id = chatId;
|
update.channel_id = chatId;
|
||||||
update.max_id = res.full_chat.read_inbox_max_id;
|
update.max_id = res.full_chat.read_inbox_max_id;
|
||||||
|
update.still_unread_count = res.full_chat.unread_count;
|
||||||
arrayList.add(update);
|
arrayList.add(update);
|
||||||
processUpdateArray(arrayList, null, null, false, 0);
|
processUpdateArray(arrayList, null, null, false, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5755,7 +5755,7 @@ public class MessagesStorage extends BaseController {
|
||||||
int messageId = inbox.get(key);
|
int messageId = inbox.get(key);
|
||||||
boolean canCountByMessageId = true;
|
boolean canCountByMessageId = true;
|
||||||
|
|
||||||
if (stillUnreadMessagesCount != null && stillUnreadMessagesCount.get(key, -1) != -1) {
|
if (stillUnreadMessagesCount != null && stillUnreadMessagesCount.get(key, -2) != -2) {
|
||||||
SQLiteCursor checkHolesCursor = database.queryFinalized(String.format(Locale.US, "SELECT start, end FROM messages_holes WHERE uid = %d AND end > %d", key, messageId));
|
SQLiteCursor checkHolesCursor = database.queryFinalized(String.format(Locale.US, "SELECT start, end FROM messages_holes WHERE uid = %d AND end > %d", key, messageId));
|
||||||
while (checkHolesCursor.next()) {
|
while (checkHolesCursor.next()) {
|
||||||
canCountByMessageId = false;
|
canCountByMessageId = false;
|
||||||
|
@ -5771,8 +5771,8 @@ public class MessagesStorage extends BaseController {
|
||||||
}
|
}
|
||||||
cursor.dispose();
|
cursor.dispose();
|
||||||
} else {
|
} else {
|
||||||
int unread = stillUnreadMessagesCount.get(key);
|
int unread = stillUnreadMessagesCount.get(key, -1);
|
||||||
if (unread > 0) {
|
if (unread >= 0) {
|
||||||
dialogsToUpdate.put(key, unread);
|
dialogsToUpdate.put(key, unread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,7 @@ public class PushListenerController {
|
||||||
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
TLRPC.TL_updateReadChannelInbox update = new TLRPC.TL_updateReadChannelInbox();
|
||||||
update.channel_id = channel_id;
|
update.channel_id = channel_id;
|
||||||
update.max_id = max_id;
|
update.max_id = max_id;
|
||||||
|
update.still_unread_count = -1;
|
||||||
updates.add(update);
|
updates.add(update);
|
||||||
} else {
|
} else {
|
||||||
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();
|
TLRPC.TL_updateReadHistoryInbox update = new TLRPC.TL_updateReadHistoryInbox();
|
||||||
|
|
|
@ -22,7 +22,6 @@ import android.graphics.Shader;
|
||||||
import android.graphics.drawable.Animatable;
|
import android.graphics.drawable.Animatable;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import org.telegram.messenger.AndroidUtilities;
|
import org.telegram.messenger.AndroidUtilities;
|
||||||
|
@ -34,7 +33,6 @@ import org.telegram.messenger.ImageLocation;
|
||||||
import org.telegram.messenger.ImageReceiver;
|
import org.telegram.messenger.ImageReceiver;
|
||||||
import org.telegram.messenger.utils.BitmapsCache;
|
import org.telegram.messenger.utils.BitmapsCache;
|
||||||
import org.telegram.tgnet.TLRPC;
|
import org.telegram.tgnet.TLRPC;
|
||||||
import org.telegram.ui.ActionBar.Theme;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -971,6 +969,8 @@ public class AnimatedFileDrawable extends BitmapDrawable implements Animatable,
|
||||||
long cacheGenerateTimestamp;
|
long cacheGenerateTimestamp;
|
||||||
Bitmap generatingCacheBitmap;
|
Bitmap generatingCacheBitmap;
|
||||||
long cacheGenerateNativePtr;
|
long cacheGenerateNativePtr;
|
||||||
|
int tryCount;
|
||||||
|
int lastMetadata;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void prepareForGenerateCache() {
|
public void prepareForGenerateCache() {
|
||||||
|
@ -994,9 +994,16 @@ public class AnimatedFileDrawable extends BitmapDrawable implements Animatable,
|
||||||
generatingCacheBitmap = Bitmap.createBitmap(metaData[0], metaData[1], Bitmap.Config.ARGB_8888);
|
generatingCacheBitmap = Bitmap.createBitmap(metaData[0], metaData[1], Bitmap.Config.ARGB_8888);
|
||||||
}
|
}
|
||||||
getVideoFrame(cacheGenerateNativePtr, generatingCacheBitmap, metaData, generatingCacheBitmap.getRowBytes(), false, startTime, endTime);
|
getVideoFrame(cacheGenerateNativePtr, generatingCacheBitmap, metaData, generatingCacheBitmap.getRowBytes(), false, startTime, endTime);
|
||||||
if (cacheGenerateTimestamp != 0 && metaData[3] == 0 || cacheGenerateTimestamp > metaData[3]) {
|
if (cacheGenerateTimestamp != 0 && (metaData[3] == 0 || cacheGenerateTimestamp > metaData[3])) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (lastMetadata == metaData[3]) {
|
||||||
|
tryCount++;
|
||||||
|
if (tryCount > 5) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lastMetadata = metaData[3];
|
||||||
bitmap.eraseColor(Color.TRANSPARENT);
|
bitmap.eraseColor(Color.TRANSPARENT);
|
||||||
canvas.save();
|
canvas.save();
|
||||||
float s = (float) renderingWidth / generatingCacheBitmap.getWidth();
|
float s = (float) renderingWidth / generatingCacheBitmap.getWidth();
|
||||||
|
|
|
@ -20,7 +20,6 @@ import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ import org.telegram.messenger.ImageReceiver;
|
||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
import org.telegram.messenger.Utilities;
|
import org.telegram.messenger.Utilities;
|
||||||
import org.telegram.messenger.utils.BitmapsCache;
|
import org.telegram.messenger.utils.BitmapsCache;
|
||||||
import org.telegram.ui.ActionBar.Theme;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -892,7 +890,7 @@ public class RLottieDrawable extends BitmapDrawable implements Animatable, Bitma
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (generatingCache) {
|
if (generatingCache) {
|
||||||
// return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!newColorUpdates.isEmpty()) {
|
if (!newColorUpdates.isEmpty()) {
|
||||||
pendingColorUpdates.putAll(newColorUpdates);
|
pendingColorUpdates.putAll(newColorUpdates);
|
||||||
|
|
|
@ -32,17 +32,22 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ILocationRequest onCreateLocationRequest() {
|
public ILocationRequest onCreateLocationRequest() {
|
||||||
return new GoogleLocationRequest(LocationRequest.create());
|
return new HuaweiLocationRequest(LocationRequest.create());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getLastLocation(Consumer<Location> callback) {
|
public void getLastLocation(Consumer<Location> callback) {
|
||||||
locationProviderClient.getLastLocation().addOnCompleteListener(task -> callback.accept(task.getResult()));
|
locationProviderClient.getLastLocation().addOnCompleteListener(task -> {
|
||||||
|
if (task.getException() != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback.accept(task.getResult());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void requestLocationUpdates(ILocationRequest request, ILocationListener locationListener) {
|
public void requestLocationUpdates(ILocationRequest request, ILocationListener locationListener) {
|
||||||
locationProviderClient.requestLocationUpdates(((GoogleLocationRequest) request).request, new LocationCallback() {
|
locationProviderClient.requestLocationUpdates(((HuaweiLocationRequest) request).request, new LocationCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onLocationResult(@NonNull LocationResult locationResult) {
|
public void onLocationResult(@NonNull LocationResult locationResult) {
|
||||||
locationListener.onLocationChanged(locationResult.getLastLocation());
|
locationListener.onLocationChanged(locationResult.getLastLocation());
|
||||||
|
@ -62,7 +67,7 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkLocationSettings(ILocationRequest request, Consumer<Integer> callback) {
|
public void checkLocationSettings(ILocationRequest request, Consumer<Integer> callback) {
|
||||||
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(((GoogleLocationRequest) request).request);
|
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(((HuaweiLocationRequest) request).request);
|
||||||
|
|
||||||
settingsClient.checkLocationSettings(builder.build()).addOnCompleteListener(task -> {
|
settingsClient.checkLocationSettings(builder.build()).addOnCompleteListener(task -> {
|
||||||
try {
|
try {
|
||||||
|
@ -83,7 +88,7 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IMapApiClient onCreateLocationServicesAPI(Context context, IAPIConnectionCallbacks connectionCallbacks, IAPIOnConnectionFailedListener failedListener) {
|
public IMapApiClient onCreateLocationServicesAPI(Context context, IAPIConnectionCallbacks connectionCallbacks, IAPIOnConnectionFailedListener failedListener) {
|
||||||
return new GoogleApiClientImpl(new HuaweiApiClient.Builder(ApplicationLoader.applicationContext)
|
return new HuaweiApiClientImpl(new HuaweiApiClient.Builder(ApplicationLoader.applicationContext)
|
||||||
.addConnectionCallbacks(new HuaweiApiClient.ConnectionCallbacks() {
|
.addConnectionCallbacks(new HuaweiApiClient.ConnectionCallbacks() {
|
||||||
@Override
|
@Override
|
||||||
public void onConnected() {
|
public void onConnected() {
|
||||||
|
@ -101,13 +106,13 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkServices() {
|
public boolean checkServices() {
|
||||||
return PushListenerController.GooglePushListenerServiceProvider.INSTANCE.hasServices();
|
return HuaweiPushListenerProvider.INSTANCE.hasServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class GoogleLocationRequest implements ILocationRequest {
|
public final static class HuaweiLocationRequest implements ILocationRequest {
|
||||||
private LocationRequest request;
|
private LocationRequest request;
|
||||||
|
|
||||||
private GoogleLocationRequest(LocationRequest request) {
|
private HuaweiLocationRequest(LocationRequest request) {
|
||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,10 +148,10 @@ public class HuaweiLocationProvider implements ILocationServiceProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static class GoogleApiClientImpl implements IMapApiClient {
|
public final static class HuaweiApiClientImpl implements IMapApiClient {
|
||||||
private HuaweiApiClient apiClient;
|
private HuaweiApiClient apiClient;
|
||||||
|
|
||||||
private GoogleApiClientImpl(HuaweiApiClient apiClient) {
|
private HuaweiApiClientImpl(HuaweiApiClient apiClient) {
|
||||||
this.apiClient = apiClient;
|
this.apiClient = apiClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue