Skip to content

Commit

Permalink
Update to 7.5.0 (2244)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Feb 23, 2021
1 parent 92cfded commit 31b5801
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 50 deletions.
4 changes: 1 addition & 3 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ dependencies {
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation "com.microsoft.appcenter:appcenter-distribute:3.3.1"
implementation "com.microsoft.appcenter:appcenter-crashes:3.3.1"
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
implementation files('libs/libgsaverification-client.aar')
Expand Down Expand Up @@ -290,7 +288,7 @@ android {
}
}

defaultConfig.versionCode = 2243
defaultConfig.versionCode = 2244

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@
import com.google.android.gms.auth.api.phone.SmsRetriever;
import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
import com.google.android.gms.tasks.Task;
import com.microsoft.appcenter.AppCenter;
import com.microsoft.appcenter.crashes.Crashes;
import com.microsoft.appcenter.distribute.Distribute;

import org.telegram.PhoneFormat.PhoneFormat;
import org.telegram.messenger.browser.Browser;
Expand Down Expand Up @@ -2184,33 +2181,12 @@ public void onAnimationEnd(Animator animation) {
}*/

public static void startAppCenter(Activity context) {
if (BuildConfig.DEBUG) {
return;
}
try {
if (BuildVars.DEBUG_VERSION) {
Distribute.setEnabledForDebuggableBuild(true);
AppCenter.start(context.getApplication(), BuildVars.DEBUG_VERSION ? BuildVars.APPCENTER_HASH_DEBUG : BuildVars.APPCENTER_HASH, Distribute.class, Crashes.class);
AppCenter.setUserId("uid=" + UserConfig.getInstance(UserConfig.selectedAccount).clientUserId);
}
} catch (Throwable e) {
FileLog.e(e);
}

}

private static long lastUpdateCheckTime;
public static void checkForUpdates() {
try {
if (BuildVars.DEBUG_VERSION) {
if (SystemClock.elapsedRealtime() - lastUpdateCheckTime < 60 * 60 * 1000) {
return;
}
lastUpdateCheckTime = SystemClock.elapsedRealtime();
Distribute.checkForUpdate();
}
} catch (Throwable e) {
FileLog.e(e);
}

}

public static void addToClipboard(CharSequence str) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2243;
public static int BUILD_VERSION = 2244;
public static String BUILD_VERSION_STRING = "7.5.0";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,6 @@ public void start() {
AndroidUtilities.cancelRunOnUIThread(locationQueryCancelRunnable);
}
locationQueryCancelRunnable = () -> {
if (locationQueryCancelRunnable != this) {
return;
}
if (delegate != null) {
if (lastKnownLocation != null) {
delegate.onLocationAcquired(lastKnownLocation);
Expand Down Expand Up @@ -5604,7 +5601,7 @@ private static boolean prepareSendingDocumentInternal(AccountInstance accountIns
MimeTypeMap myMime = MimeTypeMap.getSingleton();
TLRPC.TL_documentAttributeAudio attributeAudio = null;
String extension = null;
if (uri != null) {
if (uri != null && path == null) {
boolean hasExt = false;
if (mime != null) {
extension = myMime.getExtensionFromMimeType(mime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8923,7 +8923,11 @@ private void measureTime(MessageObject messageObject) {
} else if (messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.post_author != null) {
signString = messageObject.messageOwner.fwd_from.post_author.replace("\n", "");
} else if (messageObject.messageOwner.fwd_from != null && messageObject.messageOwner.fwd_from.imported) {
signString = LocaleController.formatImportedDate(messageObject.messageOwner.fwd_from.date) + " " + LocaleController.getString("ImportedMessage", R.string.ImportedMessage);
if (messageObject.messageOwner.fwd_from.date == messageObject.messageOwner.date) {
signString = LocaleController.getString("ImportedMessage", R.string.ImportedMessage);
} else {
signString = LocaleController.formatImportedDate(messageObject.messageOwner.fwd_from.date) + " " + LocaleController.getString("ImportedMessage", R.string.ImportedMessage);
}
} else if (!messageObject.isOutOwner() && fromId > 0 && messageObject.messageOwner.post) {
TLRPC.User signUser = MessagesController.getInstance(currentAccount).getUser(fromId);
if (signUser != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20214,7 +20214,14 @@ private void openDiscussionMessageChat(int chatId, MessageObject originalMessage
}
} else {
if ("CHANNEL_PRIVATE".equals(error.text)) {
getNotificationCenter().postNotificationName(NotificationCenter.chatInfoCantLoad, currentChat.id, 3);
if (getParentActivity() != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(LocaleController.getString("JoinByPeekChannelText", R.string.JoinByPeekChannelText));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
AlertDialog alertDialog = builder.create();
showDialog(builder.create());
}
return;
}
savedNoHistory = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
Expand Down Expand Up @@ -259,12 +260,25 @@ protected void onDraw(Canvas canvas) {
canvas.drawColor(0x33000000);
getPointOnScreen(frameLayout, finalContainer, point);
canvas.save();
float clipTop = ((View) frameLayout.getParent()).getY() + frameLayout.getY();
if (clipTop < 1) {
canvas.clipRect(0, point[1] - clipTop + 1, getMeasuredWidth(), getMeasuredHeight());
}
canvas.translate(point[0], point[1]);

frameLayout.draw(canvas);
canvas.restore();
}
};

ViewTreeObserver.OnPreDrawListener preDrawListener = new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
dimView.invalidate();
return true;
}
};
finalContainer.getViewTreeObserver().addOnPreDrawListener(preDrawListener);
container.addView(dimView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
dimView.setAlpha(0);
dimView.animate().alpha(1f).setDuration(150);
Expand All @@ -283,6 +297,7 @@ public void onAnimationEnd(Animator animation) {
if (dimView.getParent() != null) {
finalContainer.removeView(dimView);
}
finalContainer.getViewTreeObserver().removeOnPreDrawListener(preDrawListener);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public class ManageLinksActivity extends BaseFragment implements NotificationCen

private ArrayList<TLRPC.TL_chatAdminWithInvites> admins = new ArrayList<>();


long timeDif;

private boolean isPublic;
Expand Down Expand Up @@ -407,6 +406,9 @@ private void loadLinks() {
resumeDelayedFragmentAnimation();
}

if (loadNext) {
loadLinks();
}
if (updateByDiffUtils && isOpened && listViewAdapter != null && listView.getChildCount() > 0) {
updateRows(false);
callback.fillPositions(callback.newPositionToItem);
Expand All @@ -415,9 +417,6 @@ private void loadLinks() {
} else {
updateRows(true);
}
if (loadNext) {
loadLinks();
}
});
});
});
Expand Down Expand Up @@ -453,7 +452,6 @@ private void updateRows(boolean notify) {
linksHeaderRow = -1;
dividerRow = -1;


rowCount = 0;

boolean otherAdmin = adminId != getAccountInstance().getUserConfig().clientUserId;
Expand All @@ -467,7 +465,6 @@ private void updateRows(boolean notify) {
permanentLinkHeaderRow = rowCount++;
permanentLinkRow = rowCount++;


if (!otherAdmin) {
dividerRow = rowCount++;
createNewLinkRow = rowCount++;
Expand Down Expand Up @@ -496,8 +493,6 @@ private void updateRows(boolean notify) {
adminsEndRow = rowCount;
}



if (!revokedInvites.isEmpty()) {
if (adminsStartRow >= 0) {
revokedDivider = rowCount++;
Expand Down Expand Up @@ -962,7 +957,6 @@ private void revokePermanent() {
TLRPC.TL_chatInviteExported oldInvite = invite;
invite = null;
info.exported_invite = null;
listViewAdapter.notifyItemChanged(permanentLinkRow);
final int reqId = getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
if (error == null) {
invite = (TLRPC.TL_chatInviteExported) response;
Expand All @@ -974,7 +968,6 @@ private void revokePermanent() {
return;
}

listViewAdapter.notifyItemChanged(permanentLinkRow);
oldInvite.revoked = true;
DiffCallback callback = saveListState();
revokedInvites.add(0, oldInvite);
Expand All @@ -986,6 +979,7 @@ private void revokePermanent() {
}

}));
AndroidUtilities.updateVisibleRows(listView);
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
} else {
revokeLink(invite);
Expand Down Expand Up @@ -1255,9 +1249,7 @@ protected void onDraw(Canvas canvas) {
if (progress <= 0) {
invite.expired = true;
drawState = LINK_STATE_RED;
if (listViewAdapter != null) {
listViewAdapter.notifyItemChanged(position);
}
AndroidUtilities.updateVisibleRows(listView);
} else {
drawState = LINK_STATE_GREEN;
}
Expand Down Expand Up @@ -1485,7 +1477,6 @@ public void revokeLink(TLRPC.TL_chatInviteExported invite) {
TLRPC.TL_messages_exportedChatInviteReplaced replaced = (TLRPC.TL_messages_exportedChatInviteReplaced) response;
if (!isPublic) {
ManageLinksActivity.this.invite = (TLRPC.TL_chatInviteExported) replaced.new_invite;
listViewAdapter.notifyItemChanged(permanentLinkRow);
}

invite.revoked = true;
Expand All @@ -1498,6 +1489,7 @@ public void revokeLink(TLRPC.TL_chatInviteExported invite) {
updateRows(false);

if (getParentActivity() == null) {
listViewAdapter.notifyDataSetChanged();
return;
}
callback.fillPositions(callback.newPositionToItem);
Expand Down
Binary file modified TMessagesProj/src/main/res/drawable/chats_widget_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 31b5801

Please sign in to comment.