fix: repeat in topics

This commit is contained in:
luvletter2333 2023-03-16 05:18:45 +08:00
parent da6d0bea22
commit 1e59e4e335
No known key found for this signature in database
GPG Key ID: 9EB7723F3A0ACF92
2 changed files with 9 additions and 9 deletions

View File

@ -2715,7 +2715,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
ActionBarMenu menu = actionBar.createMenu();
if (isThreadChat() && threadMessageId != 0) {
if (isThreadChat() && threadMessageId != 0 && !isTopic) {
viewInChatItem = menu.addItem(nkbtn_view_in_chat, R.drawable.baseline_forum_24, themeDelegate);
}
@ -23857,7 +23857,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
options.add(OPTION_VIEW_REPLIES_OR_THREAD);
icons.add(R.drawable.baseline_forum_24);
} else if (isThreadChat() && chatMode != MODE_SCHEDULED && currentChat != null) {
} else if (isThreadChat() && !isTopic && chatMode != MODE_SCHEDULED && currentChat != null) {
options.add(nkbtn_view_in_chat);
icons.add(R.drawable.baseline_forum_24);
items.add(LocaleController.getString("ViewInChat", R.string.ViewInChat));
@ -32255,11 +32255,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
private void doRepeatMessage(boolean isLongClick, ArrayList<MessageObject> messages) {
if (selectedObject != null && selectedObject.messageOwner != null && (isLongClick || isThreadChat())) {
if (selectedObject != null && selectedObject.messageOwner != null && (isLongClick || (isThreadChat() && !isTopic))) {
// If selected message contains `replyTo`:
// When longClick it will reply to the `replyMessage` of selectedMessage
// When not LongClick but in a threadchat: reply to the Thread
MessageObject replyTo = isLongClick ? selectedObject.replyMessageObject : getThreadMessage();
MessageObject replyTo = isLongClick ? selectedObject.replyMessageObject : getReplyMessage();
if (selectedObject.type == 0 || selectedObject.isAnimatedEmoji() || getMessageCaption(selectedObject, selectedObjectGroup) != null) {
CharSequence caption = getMessageCaption(selectedObject, selectedObjectGroup);
if (caption == null) {

View File

@ -680,10 +680,10 @@ public class TopicsFragment extends BaseFragment implements NotificationCenter.N
editText.setCursorColor(Theme.getColor(Theme.key_chat_messagePanelCursor));
}
other = menu.addItem(0, R.drawable.ic_ab_other, themeDelegate);
other.addSubItem(toggle_id, R.drawable.msg_discussion, LocaleController.getString("TopicViewAsMessages", R.string.TopicViewAsMessages));
addMemberSubMenu = other.addSubItem(add_member_id, R.drawable.msg_addcontact, LocaleController.getString("AddMember", R.string.AddMember));
createTopicSubmenu = other.addSubItem(create_topic_id, R.drawable.msg_topic_create, LocaleController.getString("CreateTopic", R.string.CreateTopic));
deleteChatSubmenu = other.addSubItem(delete_chat_id, R.drawable.msg_leave, LocaleController.getString("LeaveMegaMenu", R.string.LeaveMegaMenu), themeDelegate);
other.addSubItem(toggle_id, R.drawable.baseline_forum_24, LocaleController.getString("TopicViewAsMessages", R.string.TopicViewAsMessages));
addMemberSubMenu = other.addSubItem(add_member_id, R.drawable.baseline_person_add_24, LocaleController.getString("AddMember", R.string.AddMember));
createTopicSubmenu = other.addSubItem(create_topic_id, R.drawable.baseline_group_add_24, LocaleController.getString("CreateTopic", R.string.CreateTopic));
deleteChatSubmenu = other.addSubItem(delete_chat_id, R.drawable.baseline_exit_to_app_24, LocaleController.getString("LeaveMegaMenu", R.string.LeaveMegaMenu), themeDelegate);
avatarContainer = new ChatAvatarContainer(context, this, false);
avatarContainer.getAvatarImageView().setRoundRadius(AndroidUtilities.dp(16));
@ -1864,7 +1864,7 @@ public class TopicsFragment extends BaseFragment implements NotificationCenter.N
if (ChatObject.canDeleteTopic(currentAccount, getCurrentChat(), topic)) {
ActionBarMenuSubItem deleteItem = new ActionBarMenuSubItem(getParentActivity(), false, true);
deleteItem.setTextAndIcon(LocaleController.getPluralString("DeleteTopics", 1), R.drawable.msg_delete);
deleteItem.setTextAndIcon(LocaleController.getPluralString("DeleteTopics", 1), R.drawable.baseline_delete_24);
deleteItem.setIconColor(getThemedColor(Theme.key_dialogRedIcon));
deleteItem.setTextColor(getThemedColor(Theme.key_dialogTextRed));
deleteItem.setMinimumWidth(160);