Skip to content

Commit

Permalink
feat: also collapse channel messages
Browse files Browse the repository at this point in the history
  • Loading branch information
luvletter2333 committed Apr 4, 2023
1 parent cb64720 commit d00e4ef
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28849,9 +28849,9 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
} else if (currentChat != null) {
long fromId = nextMessage.getFromChatId();
pinnedBottom = fromId == message.getFromChatId();
if (!pinnedBottomByGroup && pinnedBottom && fromId < 0 && currentChat.megagroup) {
pinnedBottom = false;
}
// if (!pinnedBottomByGroup && pinnedBottom && fromId < 0 && currentChat.megagroup) {
// pinnedBottom = false;
// }
} else if (UserObject.isUserSelf(currentUser) || UserObject.isReplyUser(currentUser)) {
if (message.isPrivateForward() || nextMessage.isPrivateForward()) {
pinnedBottom = false;
Expand Down Expand Up @@ -28884,9 +28884,9 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
} else if (currentChat != null) {
long fromId = prevMessage.getFromChatId();
pinnedTop = fromId == message.getFromChatId() && !message.isImportedForward() && !prevMessage.isImportedForward();
if (!pinnedTopByGroup && pinnedTop && fromId < 0 && currentChat.megagroup) {
pinnedTop = false;
}
// if (!pinnedTopByGroup && pinnedTop && fromId < 0 && currentChat.megagroup) {
// pinnedTop = false;
// }
} else if (UserObject.isUserSelf(currentUser) || UserObject.isReplyUser(currentUser)) {
if (message.isPrivateForward() || prevMessage.isPrivateForward()) {
pinnedTop = false;
Expand All @@ -28896,14 +28896,14 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
}
}
}
if (ChatObject.isChannel(currentChat) && currentChat.megagroup && message.getFromChatId() <= 0 && message.messageOwner.fwd_from != null && message.messageOwner.fwd_from.saved_from_peer instanceof TLRPC.TL_peerChannel) {
if (!pinnedTopByGroup) {
pinnedTop = false;
}
if (!pinnedBottomByGroup) {
pinnedBottom = false;
}
}
// if (ChatObject.isChannel(currentChat) && currentChat.megagroup && message.getFromChatId() <= 0 && message.messageOwner.fwd_from != null && message.messageOwner.fwd_from.saved_from_peer instanceof TLRPC.TL_peerChannel) {
// if (!pinnedTopByGroup) {
// pinnedTop = false;
// }
// if (!pinnedBottomByGroup) {
// pinnedBottom = false;
// }
// }

message.updateTranslation(false);
if (groupedMessages != null) {
Expand Down

0 comments on commit d00e4ef

Please sign in to comment.