mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-12-02 13:50:31 +01:00
Hide prpr and repeat if not in chat
This commit is contained in:
parent
28df060626
commit
69c2c457b2
@ -14832,7 +14832,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
icons.add(R.drawable.menu_saved);
|
||||
}
|
||||
boolean allowRepeat = currentUser != null
|
||||
|| (currentChat != null && ChatObject.canSendMessages(currentChat));
|
||||
|| (currentChat != null && !ChatObject.isNotInChat(currentChat) && ChatObject.canSendMessages(currentChat));
|
||||
if (allowRepeat && NekoConfig.showRepeat) {
|
||||
items.add(LocaleController.getString("Repeat", R.string.Repeat));
|
||||
options.add(94);
|
||||
@ -14841,7 +14841,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
if (!inScheduleMode) {
|
||||
boolean allowPrpr = currentUser != null
|
||||
|| (currentChat != null && ChatObject.canSendMessages(currentChat) && !currentChat.broadcast &&
|
||||
|| (currentChat != null && !ChatObject.isNotInChat(currentChat) && ChatObject.canSendMessages(currentChat) && !currentChat.broadcast &&
|
||||
message.isFromUser());
|
||||
boolean allowViewHistory = currentUser == null
|
||||
&& (currentChat != null && !currentChat.broadcast && message.isFromUser());
|
||||
@ -15310,7 +15310,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
updatePinnedMessageView(true);
|
||||
updateVisibleRows();
|
||||
|
||||
if (!messageObject.scheduled && !UserConfig.getInstance(currentAccount).isBot) {
|
||||
if (!messageObject.scheduled && !getUserConfig().isBot) {
|
||||
TLRPC.TL_messages_getMessageEditData req = new TLRPC.TL_messages_getMessageEditData();
|
||||
req.peer = getMessagesController().getInputPeer((int) dialog_id);
|
||||
req.id = messageObject.getId();
|
||||
@ -15972,14 +15972,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
presentFragment(new MessageDetailsActivity(selectedObject));
|
||||
break;
|
||||
} case 90: {
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(selectedObject.messageOwner.from_id);
|
||||
TLRPC.User user = getMessagesController().getUser(selectedObject.messageOwner.from_id);
|
||||
getMediaDataController().searchMessagesInChat("", dialog_id, mergeDialogId, classGuid, 0, user);
|
||||
showMessagesSearchListView(true);
|
||||
break;
|
||||
} case 92: {
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(selectedObject.messageOwner.from_id);
|
||||
TLRPC.User user = getMessagesController().getUser(selectedObject.messageOwner.from_id);
|
||||
if (user.username != null) {
|
||||
SendMessagesHelper.getInstance(currentAccount).sendMessage("/prpr@" + user.username, dialog_id, selectedObject, null, false,
|
||||
getSendMessagesHelper().sendMessage("/prpr@" + user.username, dialog_id, selectedObject, null, false,
|
||||
null, null, null, true, 0);
|
||||
} else {
|
||||
SpannableString spannableString = new SpannableString("/prpr@" + user.first_name);
|
||||
@ -15995,7 +15995,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
ArrayList<TLRPC.MessageEntity> entities = getMediaDataController().getEntities(cs, supportsSendingNewEntities);
|
||||
SendMessagesHelper.getInstance(currentAccount).sendMessage(spannableString.toString(), dialog_id, selectedObject, null, false,
|
||||
getSendMessagesHelper().sendMessage(spannableString.toString(), dialog_id, selectedObject, null, false,
|
||||
entities, null, null, true, 0);
|
||||
}
|
||||
break;
|
||||
@ -16044,7 +16044,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
} case 93: {
|
||||
ArrayList<MessageObject> messages = new ArrayList<>();
|
||||
messages.add(selectedObject);
|
||||
forwardMessages(messages, false, true, 0, UserConfig.getInstance(currentAccount).getClientUserId());
|
||||
forwardMessages(messages, false, true, 0, getUserConfig().getClientUserId());
|
||||
break;
|
||||
} case 94: {
|
||||
ArrayList<MessageObject> messages = new ArrayList<>();
|
||||
@ -16143,7 +16143,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
toSend.append(c);
|
||||
}
|
||||
}
|
||||
SendMessagesHelper.getInstance(currentAccount).sendMessage(toSend.toString(), dialog_id, selectedObject, null, false,
|
||||
getSendMessagesHelper().sendMessage(toSend.toString(), dialog_id, selectedObject, null, false,
|
||||
null, null, null, true, 0);
|
||||
return true;
|
||||
}
|
||||
@ -17666,7 +17666,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
} else if (position >= messagesStartRow && position < messagesEndRow) {
|
||||
MessageObject message = messages.get(position - messagesStartRow);
|
||||
View view = holder.itemView;
|
||||
boolean fromUserBlocked = MessagesController.getInstance(currentAccount).blockedUsers.indexOfKey(message.getFromId()) >= 0 && NekoConfig.ignoreBlocked;
|
||||
boolean fromUserBlocked = getMessagesController().blockedUsers.indexOfKey(message.getFromId()) >= 0 && NekoConfig.ignoreBlocked;
|
||||
|
||||
if (view instanceof ChatMessageCell) {
|
||||
final ChatMessageCell messageCell = (ChatMessageCell) view;
|
||||
@ -18875,7 +18875,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
continue;
|
||||
}
|
||||
final TLRPC.ChannelParticipant channelParticipant;
|
||||
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(participant.user_id);
|
||||
TLRPC.User user = getMessagesController().getUser(participant.user_id);
|
||||
if (ChatObject.isChannel(currentChat)) {
|
||||
channelParticipant = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user