1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-04 11:13:36 +00:00

Improve direct send in linked group

This commit is contained in:
世界 2021-04-19 20:19:06 +08:00
parent 379bac4fef
commit 22d8712fb0
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -3644,10 +3644,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
bottomOverlayChat != null && bottomOverlayChat.getVisibility() == View.VISIBLE ||
currentChat != null && (ChatObject.isNotInChat(currentChat) && !isThreadChat() || ChatObject.isChannel(currentChat) && !ChatObject.canPost(currentChat) && !currentChat.megagroup || !ChatObject.canSendMessages(currentChat)) ||
textSelectionHelper.isSelectionMode()) {
if (!canSendInCommentGroup()) {
slidingView.setSlidingOffset(0);
slidingView = null;
return;
}
}
startedTrackingPointerId = e.getPointerId(0);
maybeStartTrackingSlidingView = true;
startedTrackingX = (int) e.getX();
@ -17069,13 +17071,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
bottomOverlayChat.setVisibility(View.INVISIBLE);
chatActivityEnterView.setFieldFocused();
AndroidUtilities.runOnUIThread(() -> chatActivityEnterView.openKeyboard(), 100);
} else {
boolean showEnter = false;
if (currentChat != null && currentChat.megagroup && chatInfo != null && chatInfo.linked_chat_id != 0) {
TLRPC.Chat linked = getMessagesController().getChat(chatInfo.linked_chat_id);
showEnter = !ChatObject.isKickedFromChat(linked);
}
if (!showEnter) {
} else if (!canSendInCommentGroup()) {
bottomOverlayChat.setVisibility(View.VISIBLE);
chatActivityEnterView.setFieldFocused(false);
chatActivityEnterView.setVisibility(View.INVISIBLE);
@ -17084,7 +17080,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
stickersAdapter.hide();
}
}
}
if (attachItem != null) {
attachItem.setVisibility(View.GONE);
}
@ -18985,6 +18980,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
currentChat != null && (ChatObject.isNotInChat(currentChat) && !isThreadChat() || ChatObject.isChannel(currentChat) && !ChatObject.canPost(currentChat) && !currentChat.megagroup || !ChatObject.canSendMessages(currentChat))) {
allowChatActions = false;
}
allowChatActions |= canSendInCommentGroup();
if (single || type < 2 || type == 20) {
if (getParentActivity() == null) {
@ -24671,4 +24667,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
}
private boolean canSendInCommentGroup() {
//currentChat是群组
return currentChat != null && currentChat.megagroup && chatInfo != null && chatInfo.linked_chat_id != 0;
}
}