Skip to content

Commit

Permalink
feat: allow send msg in comment without join
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit authored and NextAlone committed Feb 3, 2024
1 parent 9e80b25 commit af403bd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8791,7 +8791,7 @@ private void showBotMessageHint(ChatMessageCell cell, boolean byClick) {
botMessageHint.show();
});
}

private void hideHints() {
if (savedMessagesTagHint != null && savedMessagesTagHint.shown()) {
savedMessagesTagHint.hide();
Expand Down Expand Up @@ -25686,7 +25686,7 @@ public void onAnimationEnd(Animator animation) {
bottomOverlayChat.setVisibility(View.VISIBLE);
chatActivityEnterView.setVisibility(View.INVISIBLE);
} else if (chatMode == MODE_PINNED ||
currentChat != null && ((ChatObject.isNotInChat(currentChat) || !ChatObject.canWriteToChat(currentChat)) && (currentChat.join_to_send || !isThreadChat() || ChatObject.isForum(currentChat)) || forumTopic != null && forumTopic.closed && !ChatObject.canManageTopic(currentAccount, currentChat, forumTopic) || shouldDisplaySwipeToLeftToReplyInForum()) ||
currentChat != null && (((ChatObject.isNotInChat(currentChat) || !ChatObject.canWriteToChat(currentChat)) && !canSendMsgInCommentGroupWithoutJoin()) && (currentChat.join_to_send || !isThreadChat() || ChatObject.isForum(currentChat)) || forumTopic != null && forumTopic.closed && !ChatObject.canManageTopic(currentAccount, currentChat, forumTopic) || shouldDisplaySwipeToLeftToReplyInForum()) ||
currentUser != null && (UserObject.isDeleted(currentUser) || userBlocked || UserObject.isReplyUser(currentUser))) {
if (chatActivityEnterView.isEditingMessage()) {
chatActivityEnterView.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -40449,4 +40449,9 @@ public boolean dispatchTouchEvent(MotionEvent event) {
private int getFirstVisibleMessage() {
return MessageHelper.INSTANCE.getFirstVisibleMessage(chatLayoutManager, chatListView, chatAdapter, messages);
}

private boolean canSendMsgInCommentGroupWithoutJoin() {
return currentChat != null && currentChat.megagroup && chatInfo != null && chatInfo.linked_chat_id != 0
&& !currentChat.join_to_send && !currentChat.min;
}
}

0 comments on commit af403bd

Please sign in to comment.