mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 06:25:14 +01:00
Update to 7.3.0 (2197)
This commit is contained in:
parent
4b588b90aa
commit
d333b1f956
11 changed files with 74 additions and 34 deletions
|
@ -290,7 +290,7 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
defaultConfig.versionCode = 2196
|
||||
defaultConfig.versionCode = 2197
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
|
|
|
@ -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 = 2196;
|
||||
public static int BUILD_VERSION = 2197;
|
||||
public static String BUILD_VERSION_STRING = "7.3.0";
|
||||
public static int APP_ID = 4;
|
||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||
|
|
|
@ -4254,7 +4254,8 @@ public class MessageObject {
|
|||
}
|
||||
int selfUserId = UserConfig.getInstance(currentAccount).getClientUserId();
|
||||
if (getDialogId() == selfUserId) {
|
||||
return messageOwner.fwd_from.from_id instanceof TLRPC.TL_peerUser && messageOwner.fwd_from.from_id.user_id == selfUserId && (messageOwner.fwd_from.saved_from_peer == null || messageOwner.fwd_from.saved_from_peer.user_id == selfUserId) || messageOwner.fwd_from.saved_from_peer != null && messageOwner.fwd_from.saved_from_peer.user_id == selfUserId;
|
||||
return messageOwner.fwd_from.from_id instanceof TLRPC.TL_peerUser && messageOwner.fwd_from.from_id.user_id == selfUserId && (messageOwner.fwd_from.saved_from_peer == null || messageOwner.fwd_from.saved_from_peer.user_id == selfUserId)
|
||||
|| messageOwner.fwd_from.saved_from_peer != null && messageOwner.fwd_from.saved_from_peer.user_id == selfUserId && (messageOwner.fwd_from.from_id == null || messageOwner.fwd_from.from_id.user_id == selfUserId);
|
||||
}
|
||||
return messageOwner.fwd_from.saved_from_peer == null || messageOwner.fwd_from.saved_from_peer.user_id == selfUserId;
|
||||
}
|
||||
|
|
|
@ -9744,7 +9744,6 @@ public class MessagesStorage extends BaseController {
|
|||
public void putMessages(final TLRPC.messages_Messages messages, final long dialog_id, final int load_type, final int max_id, final boolean createDialog, final boolean scheduled) {
|
||||
storageQueue.postRunnable(() -> {
|
||||
try {
|
||||
FileLog.d("put messages to " + dialog_id);
|
||||
if (scheduled) {
|
||||
database.executeFast(String.format(Locale.US, "DELETE FROM scheduled_messages WHERE uid = %d AND mid > 0", dialog_id)).stepThis().dispose();
|
||||
SQLitePreparedStatement state_messages = database.executeFast("REPLACE INTO scheduled_messages VALUES(?, ?, ?, ?, ?, ?, NULL)");
|
||||
|
|
|
@ -1239,9 +1239,9 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
int lower_id = (int) peer;
|
||||
int sendResult = 0;
|
||||
int myId = getUserConfig().getClientUserId();
|
||||
boolean isChannel = false;
|
||||
if (lower_id != 0) {
|
||||
final TLRPC.Peer peer_id = getMessagesController().getPeer((int) peer);
|
||||
boolean isMegagroup = false;
|
||||
boolean isSignature = false;
|
||||
boolean canSendStickers = true;
|
||||
boolean canSendMedia = true;
|
||||
|
@ -1259,10 +1259,10 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
} else {
|
||||
chat = getMessagesController().getChat(-lower_id);
|
||||
if (ChatObject.isChannel(chat)) {
|
||||
isMegagroup = chat.megagroup;
|
||||
isSignature = chat.signatures;
|
||||
isChannel = !chat.megagroup;
|
||||
|
||||
if (!isMegagroup && chat.has_link) {
|
||||
if (isChannel && chat.has_link) {
|
||||
TLRPC.ChatFull chatFull = getMessagesController().getChatFull(chat.id);
|
||||
if (chatFull != null) {
|
||||
linkedToGroup = chatFull.linked_chat_id;
|
||||
|
@ -1331,7 +1331,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 && !UserObject.isReplyUser(msgObj.getDialogId())) {
|
||||
if ((peer == myId || isChannel) && (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;
|
||||
|
@ -1457,7 +1457,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
newMsg.grouped_id = gId;
|
||||
newMsg.flags |= 131072;
|
||||
}
|
||||
if (peer_id.channel_id != 0 && !isMegagroup) {
|
||||
if (peer_id.channel_id != 0 && isChannel) {
|
||||
if (isSignature) {
|
||||
newMsg.from_id = new TLRPC.TL_peerUser();
|
||||
newMsg.from_id.user_id = myId;
|
||||
|
@ -1483,7 +1483,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
messagesByRandomIds.put(newMsg.random_id, newMsg);
|
||||
ids.add(newMsg.fwd_msg_id);
|
||||
newMsg.date = scheduleDate != 0 ? scheduleDate : getConnectionsManager().getCurrentTime();
|
||||
if (inputPeer instanceof TLRPC.TL_inputPeerChannel && !isMegagroup) {
|
||||
if (inputPeer instanceof TLRPC.TL_inputPeerChannel && isChannel) {
|
||||
if (scheduleDate == 0) {
|
||||
newMsg.views = 1;
|
||||
newMsg.flags |= TLRPC.MESSAGE_FLAG_HAS_VIEWS;
|
||||
|
@ -5063,7 +5063,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
|||
}
|
||||
}
|
||||
}
|
||||
sentMessage.message = newMsg.message;
|
||||
newMsg.message = sentMessage.message;
|
||||
sentMessage.attachPath = newMsg.attachPath;
|
||||
newMsg.media.photo.id = sentMessage.media.photo.id;
|
||||
newMsg.media.photo.dc_id = sentMessage.media.photo.dc_id;
|
||||
|
|
|
@ -845,6 +845,20 @@ public class BottomSheet extends Dialog {
|
|||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
public void setUseLightStatusBar(boolean value) {
|
||||
useLightStatusBar = value;
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
int color = Theme.getColor(Theme.key_actionBarDefault, null, true);
|
||||
int flags = container.getSystemUiVisibility();
|
||||
if (useLightStatusBar && color == 0xffffffff) {
|
||||
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
} else {
|
||||
flags &=~ View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
||||
}
|
||||
container.setSystemUiVisibility(flags);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFocusable() {
|
||||
return focusable;
|
||||
}
|
||||
|
|
|
@ -11910,26 +11910,35 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
endReached[loadIndex] = true;
|
||||
}
|
||||
|
||||
if (isThreadChat() && load_type == 0 && forwardEndReached[0] && !pendingSendMessages.isEmpty()) {
|
||||
int pasteIndex = 0;
|
||||
int date = pendingSendMessages.get(0).messageOwner.date;
|
||||
if (!messArr.isEmpty()) {
|
||||
if (date >= messArr.get(0).messageOwner.date) {
|
||||
pasteIndex = 0;
|
||||
} else if (date <= messArr.get(messArr.size() - 1).messageOwner.date) {
|
||||
pasteIndex = messArr.size();
|
||||
} else {
|
||||
for (int a = 0, N = messArr.size(); a < N - 1; a++) {
|
||||
if (messArr.get(a).messageOwner.date >= date && messArr.get(a + 1).messageOwner.date <= date) {
|
||||
pasteIndex = a + 1;
|
||||
if (load_type == 0 && forwardEndReached[0] && !pendingSendMessages.isEmpty()) {
|
||||
for (int a = 0, N = messArr.size(); a < N; a++) {
|
||||
MessageObject existing = pendingSendMessagesDict.get(messArr.get(a).getId());
|
||||
if (existing != null) {
|
||||
pendingSendMessagesDict.remove(existing.getId());
|
||||
pendingSendMessages.remove(existing);
|
||||
}
|
||||
}
|
||||
if (!pendingSendMessages.isEmpty()) {
|
||||
int pasteIndex = 0;
|
||||
int date = pendingSendMessages.get(0).messageOwner.date;
|
||||
if (!messArr.isEmpty()) {
|
||||
if (date >= messArr.get(0).messageOwner.date) {
|
||||
pasteIndex = 0;
|
||||
} else if (date <= messArr.get(messArr.size() - 1).messageOwner.date) {
|
||||
pasteIndex = messArr.size();
|
||||
} else {
|
||||
for (int a = 0, N = messArr.size(); a < N - 1; a++) {
|
||||
if (messArr.get(a).messageOwner.date >= date && messArr.get(a + 1).messageOwner.date <= date) {
|
||||
pasteIndex = a + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
messArr = new ArrayList<>(messArr);
|
||||
messArr.addAll(pasteIndex, pendingSendMessages);
|
||||
pendingSendMessages.clear();
|
||||
pendingSendMessagesDict.clear();
|
||||
}
|
||||
messArr = new ArrayList<>(messArr);
|
||||
messArr.addAll(pasteIndex, pendingSendMessages);
|
||||
pendingSendMessages.clear();
|
||||
pendingSendMessagesDict.clear();
|
||||
}
|
||||
|
||||
if (!threadMessageAdded && isThreadChat() && (load_type == 0 && messArr.size() < count || (load_type == 2 || load_type == 3) && endReached[0])) {
|
||||
|
@ -14426,10 +14435,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
if (messageId > 0 && messageId <= (messageObject.isOut() ? threadMaxOutboxReadId : threadMaxInboxReadId)) {
|
||||
messageObject.setIsRead();
|
||||
}
|
||||
if (!forwardEndReached[0] && messageId < 0) {
|
||||
pendingSendMessagesDict.put(messageId, messageObject);
|
||||
pendingSendMessages.add(messageObject);
|
||||
}
|
||||
}
|
||||
if (currentEncryptedChat == null && !forwardEndReached[0] && messageId < 0) {
|
||||
pendingSendMessagesDict.put(messageId, messageObject);
|
||||
pendingSendMessages.add(0, messageObject);
|
||||
}
|
||||
if (messageObject.isDice() && !messageObject.isForwarded()) {
|
||||
messageObject.wasUnread = true;
|
||||
|
@ -16017,7 +16026,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
|
||||
private boolean hidePinnedMessageView(boolean animated) {
|
||||
if (pinnedMessageView.getTag() == null) {
|
||||
if (pinnedMessageView != null && pinnedMessageView.getTag() == null) {
|
||||
for (int a = 0; a < pinnedNextAnimation.length; a++) {
|
||||
if (pinnedNextAnimation[a] != null) {
|
||||
pinnedNextAnimation[a].cancel();
|
||||
|
@ -19778,6 +19787,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
|
||||
private void openOriginalReplyChat(MessageObject messageObject) {
|
||||
if (UserObject.isUserSelf(currentUser) && messageObject.messageOwner.fwd_from.saved_from_peer.user_id == currentUser.id) {
|
||||
scrollToMessageId(messageObject.messageOwner.fwd_from.saved_from_msg_id, messageObject.getId(), true, 0, true, 0);
|
||||
return;
|
||||
}
|
||||
Bundle args = new Bundle();
|
||||
if (messageObject.messageOwner.fwd_from.saved_from_peer.channel_id != 0) {
|
||||
args.putInt("chat_id", messageObject.messageOwner.fwd_from.saved_from_peer.channel_id);
|
||||
|
|
|
@ -3807,7 +3807,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
|||
}
|
||||
return;
|
||||
}
|
||||
CharSequence[] message = new CharSequence[]{messageEditText.getText()};
|
||||
CharSequence[] message = new CharSequence[]{AndroidUtilities.getTrimmedString(messageEditText.getText())};
|
||||
ArrayList<TLRPC.MessageEntity> entities = MediaDataController.getInstance(currentAccount).getEntities(message, supportsSendingNewEntities());
|
||||
if (!TextUtils.equals(message[0], editingMessageObject.messageText) || entities != null && !entities.isEmpty() || editingMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaWebPage) {
|
||||
editingMessageObject.editingMessage = message[0];
|
||||
|
|
|
@ -263,7 +263,9 @@ public class SearchViewPager extends ViewPagerFixed implements FilteredSearchVie
|
|||
emptyView.showProgress(!dialogsSearchAdapter.isSearching(), false);
|
||||
emptyView.showProgress(dialogsSearchAdapter.isSearching(), false);
|
||||
} else {
|
||||
emptyView.showProgress(dialogsSearchAdapter.isSearching(), true);
|
||||
if (!dialogsSearchAdapter.hasRecentSearch()) {
|
||||
emptyView.showProgress(dialogsSearchAdapter.isSearching(), true);
|
||||
}
|
||||
}
|
||||
if (reset) {
|
||||
noMediaFiltersSearchView.setVisibility(View.GONE);
|
||||
|
|
|
@ -1799,6 +1799,7 @@ public class GroupCallActivity extends BottomSheet implements NotificationCenter
|
|||
actionBarAnimation.cancel();
|
||||
actionBarAnimation = null;
|
||||
}
|
||||
setUseLightStatusBar(actionBar.getTag() == null);
|
||||
|
||||
actionBar.getBackButton().animate()
|
||||
.scaleX(show ? 1.0f : 0.9f)
|
||||
|
|
|
@ -2055,6 +2055,16 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (view == null) {
|
||||
view = listView.getChildAt(0);
|
||||
if (view != null) {
|
||||
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(view);
|
||||
pos = holder.getAdapterPosition();
|
||||
if (pos == RecyclerView.NO_POSITION) {
|
||||
pos = holder.getPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int top = 0;
|
||||
if (view != null) {
|
||||
|
|
Loading…
Reference in a new issue