mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-12-03 13:50:18 +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);
|
icons.add(R.drawable.menu_saved);
|
||||||
}
|
}
|
||||||
boolean allowRepeat = currentUser != null
|
boolean allowRepeat = currentUser != null
|
||||||
|| (currentChat != null && ChatObject.canSendMessages(currentChat));
|
|| (currentChat != null && !ChatObject.isNotInChat(currentChat) && ChatObject.canSendMessages(currentChat));
|
||||||
if (allowRepeat && NekoConfig.showRepeat) {
|
if (allowRepeat && NekoConfig.showRepeat) {
|
||||||
items.add(LocaleController.getString("Repeat", R.string.Repeat));
|
items.add(LocaleController.getString("Repeat", R.string.Repeat));
|
||||||
options.add(94);
|
options.add(94);
|
||||||
@ -14841,7 +14841,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
}
|
}
|
||||||
if (!inScheduleMode) {
|
if (!inScheduleMode) {
|
||||||
boolean allowPrpr = currentUser != null
|
boolean allowPrpr = currentUser != null
|
||||||
|| (currentChat != null && ChatObject.canSendMessages(currentChat) && !currentChat.broadcast &&
|
|| (currentChat != null && !ChatObject.isNotInChat(currentChat) && ChatObject.canSendMessages(currentChat) && !currentChat.broadcast &&
|
||||||
message.isFromUser());
|
message.isFromUser());
|
||||||
boolean allowViewHistory = currentUser == null
|
boolean allowViewHistory = currentUser == null
|
||||||
&& (currentChat != null && !currentChat.broadcast && message.isFromUser());
|
&& (currentChat != null && !currentChat.broadcast && message.isFromUser());
|
||||||
@ -15310,7 +15310,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
updatePinnedMessageView(true);
|
updatePinnedMessageView(true);
|
||||||
updateVisibleRows();
|
updateVisibleRows();
|
||||||
|
|
||||||
if (!messageObject.scheduled && !UserConfig.getInstance(currentAccount).isBot) {
|
if (!messageObject.scheduled && !getUserConfig().isBot) {
|
||||||
TLRPC.TL_messages_getMessageEditData req = new TLRPC.TL_messages_getMessageEditData();
|
TLRPC.TL_messages_getMessageEditData req = new TLRPC.TL_messages_getMessageEditData();
|
||||||
req.peer = getMessagesController().getInputPeer((int) dialog_id);
|
req.peer = getMessagesController().getInputPeer((int) dialog_id);
|
||||||
req.id = messageObject.getId();
|
req.id = messageObject.getId();
|
||||||
@ -15972,14 +15972,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
presentFragment(new MessageDetailsActivity(selectedObject));
|
presentFragment(new MessageDetailsActivity(selectedObject));
|
||||||
break;
|
break;
|
||||||
} case 90: {
|
} 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);
|
getMediaDataController().searchMessagesInChat("", dialog_id, mergeDialogId, classGuid, 0, user);
|
||||||
showMessagesSearchListView(true);
|
showMessagesSearchListView(true);
|
||||||
break;
|
break;
|
||||||
} case 92: {
|
} 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) {
|
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);
|
null, null, null, true, 0);
|
||||||
} else {
|
} else {
|
||||||
SpannableString spannableString = new SpannableString("/prpr@" + user.first_name);
|
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);
|
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);
|
entities, null, null, true, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -16044,7 +16044,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
} case 93: {
|
} case 93: {
|
||||||
ArrayList<MessageObject> messages = new ArrayList<>();
|
ArrayList<MessageObject> messages = new ArrayList<>();
|
||||||
messages.add(selectedObject);
|
messages.add(selectedObject);
|
||||||
forwardMessages(messages, false, true, 0, UserConfig.getInstance(currentAccount).getClientUserId());
|
forwardMessages(messages, false, true, 0, getUserConfig().getClientUserId());
|
||||||
break;
|
break;
|
||||||
} case 94: {
|
} case 94: {
|
||||||
ArrayList<MessageObject> messages = new ArrayList<>();
|
ArrayList<MessageObject> messages = new ArrayList<>();
|
||||||
@ -16143,7 +16143,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
toSend.append(c);
|
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);
|
null, null, null, true, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -17666,7 +17666,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
} else if (position >= messagesStartRow && position < messagesEndRow) {
|
} else if (position >= messagesStartRow && position < messagesEndRow) {
|
||||||
MessageObject message = messages.get(position - messagesStartRow);
|
MessageObject message = messages.get(position - messagesStartRow);
|
||||||
View view = holder.itemView;
|
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) {
|
if (view instanceof ChatMessageCell) {
|
||||||
final ChatMessageCell messageCell = (ChatMessageCell) view;
|
final ChatMessageCell messageCell = (ChatMessageCell) view;
|
||||||
@ -18875,7 +18875,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final TLRPC.ChannelParticipant channelParticipant;
|
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)) {
|
if (ChatObject.isChannel(currentChat)) {
|
||||||
channelParticipant = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
|
channelParticipant = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user