mirror of https://github.com/NekoX-Dev/NekoX.git
Option to hide message
This commit is contained in:
parent
3168b0d38f
commit
865e4b9b9a
|
@ -46551,6 +46551,7 @@ public class TLRPC {
|
|||
public boolean isThreadMessage; //custom
|
||||
public String translatedMessage; //custom
|
||||
public boolean translated; // custom
|
||||
public boolean hide; // custom
|
||||
|
||||
public static Message TLdeserialize(AbstractSerializedData stream, int constructor, boolean exception) {
|
||||
Message result = null;
|
||||
|
|
|
@ -144,6 +144,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
}
|
||||
|
||||
boolean voiceTransitionInPorgress;
|
||||
|
||||
public void setVoiceTransitionInProgress(boolean b) {
|
||||
voiceTransitionInPorgress = b;
|
||||
invalidate();
|
||||
|
@ -778,9 +779,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
private SparseArray<Rect> accessibilityVirtualViewBounds = new SparseArray<>();
|
||||
private int currentFocusedVirtualView = -1;
|
||||
|
||||
private boolean isBlockedUserMessage() {
|
||||
return MessagesController.getInstance(currentAccount).blockePeers.indexOfKey(
|
||||
currentMessageObject.getFromChatId()) >= 0 && NekoConfig.ignoreBlocked;
|
||||
private boolean needHideMessage() {
|
||||
return currentMessageObject.messageOwner.hide ||
|
||||
MessagesController.getInstance(currentAccount).blockePeers.indexOfKey(currentMessageObject.getFromChatId()) >= 0 &&
|
||||
NekoConfig.ignoreBlocked;
|
||||
}
|
||||
|
||||
public ChatMessageCell(Context context) {
|
||||
|
@ -2295,7 +2297,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
}
|
||||
|
||||
public void updatePlayingMessageProgress() {
|
||||
if (currentMessageObject == null) {
|
||||
if (currentMessageObject == null || needHide) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2413,7 +2415,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
invalidate();
|
||||
}
|
||||
|
||||
if (currentMessageObject == null || currentMessageObject.textLayoutBlocks == null) {
|
||||
if (currentMessageObject == null || currentMessageObject.textLayoutBlocks == null || needHide) {
|
||||
return;
|
||||
}
|
||||
position -= textY;
|
||||
|
@ -2552,7 +2554,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
}
|
||||
|
||||
private void updateSecretTimeText(MessageObject messageObject) {
|
||||
if (messageObject == null || !messageObject.needDrawBluredPreview()) {
|
||||
if (messageObject == null || !messageObject.needDrawBluredPreview() || needHide) {
|
||||
return;
|
||||
}
|
||||
String str = messageObject.getSecretTimeString();
|
||||
|
@ -2975,7 +2977,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
drawVideoSize = false;
|
||||
canStreamVideo = false;
|
||||
animatingNoSound = 0;
|
||||
drawSideButton = !isRepliesChat && checkNeedDrawShareButton(messageObject) && (currentPosition == null || currentPosition.last) ? 1 : 0;
|
||||
drawSideButton = !isRepliesChat && checkNeedDrawShareButton(messageObject) && (currentPosition == null || currentPosition.last) && totalHeight != 0 ? 1 : 0;
|
||||
if (isPinnedChat || drawSideButton == 1 && messageObject.messageOwner.fwd_from != null && !messageObject.isOutOwner() && messageObject.messageOwner.fwd_from.saved_from_peer != null && messageObject.getDialogId() == UserConfig.getInstance(currentAccount).getClientUserId()) {
|
||||
drawSideButton = 2;
|
||||
}
|
||||
|
@ -3970,7 +3972,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
currentPhotoFilterThumb = String.format(Locale.US, "%d_%d_b", w, h);
|
||||
|
||||
if (webDocument != null) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForWebFile(webDocument), currentPhotoFilter, null, null, webDocument.size, null, messageObject, 1);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForWebFile(webDocument), currentPhotoFilter, null, null, webDocument.size, null, messageObject, 1);
|
||||
} else {
|
||||
if (documentAttachType == DOCUMENT_ATTACH_TYPE_WALLPAPER) {
|
||||
if (messageObject.mediaExists) {
|
||||
|
@ -4003,13 +4006,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
photoImage.setAllowDecodeSingleFrame(true);
|
||||
photoImage.setAllowStartAnimation(true);
|
||||
photoImage.startAnimation();
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(documentAttach), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, documentAttach), currentPhotoFilterThumb, null, documentAttach.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(documentAttach), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, documentAttach), currentPhotoFilterThumb, null, documentAttach.size, null, messageObject, 0);
|
||||
autoPlayingMedia = true;
|
||||
} else {
|
||||
if (currentPhotoObjectThumb != null) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
} else {
|
||||
/*TODO*/photoImage.setImage(null, null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoObject instanceof TLRPC.TL_photoStrippedSize || "s".equals(currentPhotoObject.type) ? currentPhotoFilterThumb : currentPhotoFilter, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(null, null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoObject instanceof TLRPC.TL_photoStrippedSize || "s".equals(currentPhotoObject.type) ? currentPhotoFilterThumb : currentPhotoFilter, 0, null, messageObject, 0);
|
||||
}
|
||||
}
|
||||
} else if (documentAttachType == DOCUMENT_ATTACH_TYPE_GIF || documentAttachType == DOCUMENT_ATTACH_TYPE_ROUND) {
|
||||
|
@ -4027,23 +4033,28 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
autoPlayingMedia = true;
|
||||
TLRPC.VideoSize videoSize = MessageObject.getDocumentVideoThumb(document);
|
||||
if (!messageObject.mediaExists && videoSize != null && (currentPhotoObject == null || currentPhotoObjectThumb == null)) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), document.size < 1024 * 32 ? null : ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? filter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), document.size < 1024 * 32 ? null : ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? filter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
} else {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), document.size < 1024 * 32 ? null : ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(currentPhotoObject, documentAttach), filter, ImageLocation.getForDocument(currentPhotoObjectThumb, documentAttach), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), document.size < 1024 * 32 ? null : ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(currentPhotoObject, documentAttach), filter, ImageLocation.getForDocument(currentPhotoObjectThumb, documentAttach), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
}
|
||||
} else {
|
||||
/*TODO*/photoImage.setImage(null, null, ImageLocation.getForDocument(currentPhotoObject, documentAttach), filter, 0, null, currentMessageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(null, null, ImageLocation.getForDocument(currentPhotoObject, documentAttach), filter, 0, null, currentMessageObject, 0);
|
||||
}
|
||||
} else {
|
||||
boolean photoExist = messageObject.mediaExists;
|
||||
String fileName = FileLoader.getAttachFileName(currentPhotoObject);
|
||||
if (hasGamePreview || photoExist || DownloadController.getInstance(currentAccount).canDownloadMedia(currentMessageObject) || FileLoader.getInstance(currentAccount).isLoadingFile(fileName)) {
|
||||
photoNotSet = false;
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
} else {
|
||||
photoNotSet = true;
|
||||
if (currentPhotoObjectThumb != null) {
|
||||
/*TODO*/photoImage.setImage(null, null, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), String.format(Locale.US, "%d_%d_b", w, h), 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(null, null, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), String.format(Locale.US, "%d_%d_b", w, h), 0, null, messageObject, 0);
|
||||
} else {
|
||||
photoImage.setImageBitmap((Drawable) null);
|
||||
}
|
||||
|
@ -5366,13 +5377,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
TLRPC.Document document = messageObject.getDocument();
|
||||
|
||||
if (currentMessageObject.videoEditedInfo != null && currentMessageObject.videoEditedInfo.canAutoPlaySourceVideo()) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForPath(currentMessageObject.videoEditedInfo.originalPath), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, document), currentPhotoFilterThumb, null, messageObject.getDocument().size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForPath(currentMessageObject.videoEditedInfo.originalPath), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, document), currentPhotoFilterThumb, null, messageObject.getDocument().size, null, messageObject, 0);
|
||||
photoImage.setMediaStartEndTime(currentMessageObject.videoEditedInfo.startTime / 1000, currentMessageObject.videoEditedInfo.endTime / 1000);
|
||||
} else {
|
||||
if (!messageIdChanged && !dataChanged) {
|
||||
photoImage.setCrossfadeWithOldImage(true);
|
||||
}
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, document), currentPhotoFilterThumb, null, messageObject.getDocument().size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForDocument(currentPhotoObjectThumb, document), currentPhotoFilterThumb, null, messageObject.getDocument().size, null, messageObject, 0);
|
||||
}
|
||||
} else if (messageObject.type == MessageObject.TYPE_PHOTO) {
|
||||
if (messageObject.useCustomPhoto) {
|
||||
|
@ -5423,41 +5436,50 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
photoImage.setCrossfadeDuration(250);
|
||||
}
|
||||
if (localFile == 0 && videoSize != null && (currentPhotoObject == null || currentPhotoObjectThumb == null)) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? currentPhotoFilter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? currentPhotoFilter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
} else {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), ImageLoader.AUTOPLAY_FILTER, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
}
|
||||
} else if (localFile == 1) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForPath(messageObject.isSendError() ? null : messageObject.messageOwner.attachPath), null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForPath(messageObject.isSendError() ? null : messageObject.messageOwner.attachPath), null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, 0, null, messageObject, 0);
|
||||
} else {
|
||||
if (videoSize != null && (currentPhotoObject == null || currentPhotoObjectThumb == null)) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), null, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? currentPhotoFilter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), null, ImageLocation.getForDocument(videoSize, documentAttach), null, ImageLocation.getForDocument(currentPhotoObject != null ? currentPhotoObject : currentPhotoObjectThumb, documentAttach), currentPhotoObject != null ? currentPhotoFilter : currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
} else {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForDocument(document), null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForDocument(document), null, ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, null, document.size, null, messageObject, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (messageObject.videoEditedInfo != null && messageObject.type == MessageObject.TYPE_ROUND_VIDEO && !currentMessageObject.needDrawBluredPreview()) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForPath(messageObject.videoEditedInfo.originalPath), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForPath(messageObject.videoEditedInfo.originalPath), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
photoImage.setMediaStartEndTime(currentMessageObject.videoEditedInfo.startTime / 1000, currentMessageObject.videoEditedInfo.endTime / 1000);
|
||||
} else {
|
||||
if (!messageIdChanged && !currentMessageObject.needDrawBluredPreview()) {
|
||||
photoImage.setCrossfadeWithOldImage(true);
|
||||
photoImage.setCrossfadeDuration(250);
|
||||
}
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (messageObject.videoEditedInfo != null && messageObject.type == MessageObject.TYPE_ROUND_VIDEO && !currentMessageObject.needDrawBluredPreview()) {
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForPath(messageObject.videoEditedInfo.originalPath), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, currentMessageObject.shouldEncryptPhotoOrVideo() ? 2 : 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForPath(messageObject.videoEditedInfo.originalPath), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, currentMessageObject.shouldEncryptPhotoOrVideo() ? 2 : 0);
|
||||
photoImage.setMediaStartEndTime(currentMessageObject.videoEditedInfo.startTime / 1000, currentMessageObject.videoEditedInfo.endTime / 1000);
|
||||
} else {
|
||||
if (!messageIdChanged && !currentMessageObject.needDrawBluredPreview()) {
|
||||
photoImage.setCrossfadeWithOldImage(true);
|
||||
photoImage.setCrossfadeDuration(250);
|
||||
}
|
||||
/*TODO*/photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, currentMessageObject.shouldEncryptPhotoOrVideo() ? 2 : 0);
|
||||
/*TODO*/
|
||||
photoImage.setImage(ImageLocation.getForObject(currentPhotoObject, photoParentObject), currentPhotoFilter, ImageLocation.getForObject(currentPhotoObjectThumb, photoParentObject), currentPhotoFilterThumb, 0, null, messageObject, currentMessageObject.shouldEncryptPhotoOrVideo() ? 2 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5862,8 +5884,26 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
|
||||
seekBarWaveform.setProgress(0);
|
||||
}
|
||||
if (isBlockedUserMessage()) {
|
||||
needHide = needHideMessage();
|
||||
if (needHide) {
|
||||
totalHeight = 0;
|
||||
drawTime = false;
|
||||
needNewVisiblePart = false;
|
||||
needReplyImage = false;
|
||||
drawCommentButton = false;
|
||||
drawForwardedName = false;
|
||||
drawInstantView = false;
|
||||
drawBackground = false;
|
||||
drawCommentNumber = false;
|
||||
drawImageButton = false;
|
||||
drawJoinChannelView = false;
|
||||
drawJoinGroupView = false;
|
||||
drawMediaCheckBox = false;
|
||||
drawName = false;
|
||||
drawNameLayout = false;
|
||||
drawPhotoImage = false;
|
||||
drawBackground = false;
|
||||
isAvatarVisible = false;
|
||||
}
|
||||
updateWaveform();
|
||||
updateButtonState(false, dataChanged && !messageObject.cancelEditing, true);
|
||||
|
@ -5880,6 +5920,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
accessibilityVirtualViewBounds.clear();
|
||||
}
|
||||
|
||||
private boolean needHide;
|
||||
|
||||
public void checkVideoPlayback(boolean allowStart) {
|
||||
if (currentMessageObject.isVideo()) {
|
||||
if (MediaController.getInstance().isPlayingMessage(currentMessageObject)) {
|
||||
|
@ -6627,7 +6669,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
inLayout = false;
|
||||
}
|
||||
updateSelectionTextPosition();
|
||||
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), totalHeight + keyboardHeight);
|
||||
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), needHide ? 0: totalHeight + keyboardHeight);
|
||||
}
|
||||
|
||||
public void forceResetMessageObject() {
|
||||
|
@ -6667,7 +6709,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
@SuppressLint("DrawAllocation")
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
if (currentMessageObject == null) {
|
||||
if (currentMessageObject == null || needHide) {
|
||||
return;
|
||||
}
|
||||
if (changed || !wasLayout) {
|
||||
|
@ -12832,6 +12874,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
|||
}
|
||||
|
||||
public int computeHeight(MessageObject object, MessageObject.GroupedMessages groupedMessages) {
|
||||
if (needHide) return 0;
|
||||
/*if (object.type == 2 || object.type == 12 || object.type == 9 ||
|
||||
object.type == 4 || object.type == 14 || object.type == 10 || object.type == 11 ||
|
||||
object.type == MessageObject.TYPE_ROUND_VIDEO) {
|
||||
|
|
|
@ -1091,6 +1091,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
private final static int unpin = 106;
|
||||
private final static int save = 107;
|
||||
private final static int delete_history = 108;
|
||||
private final static int hide = 109;
|
||||
|
||||
private final static int bot_help = 30;
|
||||
private final static int bot_settings = 31;
|
||||
|
@ -1904,6 +1905,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
ArrayList<MessageObject> messages = getSelectedMessages();
|
||||
forwardMessages(messages, false, true, 0, UserConfig.getInstance(currentAccount).getClientUserId());
|
||||
undoView.showWithAction(getUserConfig().getClientUserId(), UndoView.ACTION_FWD_MESSAGES, messages.size());
|
||||
} else if (id == hide) {
|
||||
ArrayList<MessageObject> messages = getSelectedMessages();
|
||||
for (MessageObject message : messages) {
|
||||
message.messageOwner.hide = true;
|
||||
}
|
||||
getMessageHelper().resetMessageContent(dialog_id, messages);
|
||||
} else if (id == delete) {
|
||||
if (getParentActivity() == null) {
|
||||
return;
|
||||
|
@ -2558,6 +2565,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
actionModeOtherItem.addSubItem(unpin, R.drawable.deproko_baseline_pin_undo_24, LocaleController.getString("UnpinMessage", R.string.UnpinMessage));
|
||||
actionModeOtherItem.addSubItem(save, R.drawable.baseline_bookmark_24, LocaleController.getString("AddToSavedMessages", R.string.AddToSavedMessages));
|
||||
|
||||
if (NekoConfig.showMessageHide) {
|
||||
actionModeOtherItem.addSubItem(hide, R.drawable.baseline_remove_circle_24, LocaleController.getString("Hide", R.string.Hide));
|
||||
}
|
||||
|
||||
actionMode.getItem(reply).setVisibility(ChatObject.canSendMessages(currentChat) && selectedMessagesIds[0].size() + selectedMessagesIds[1].size() == 1 ? View.VISIBLE : View.GONE);
|
||||
actionMode.getItem(edit).setVisibility(canEditMessagesCount == 1 && selectedMessagesIds[0].size() + selectedMessagesIds[1].size() == 1 ? View.VISIBLE : View.GONE);
|
||||
actionMode.getItem(copy).setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() != 0 ? View.VISIBLE : View.GONE);
|
||||
|
@ -19193,6 +19204,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
options.add(89);
|
||||
icons.add(R.drawable.menu_info);
|
||||
}
|
||||
if (NekoConfig.showMessageHide) {
|
||||
items.add(LocaleController.getString("Hide", R.string.Hide));
|
||||
options.add(204);
|
||||
icons.add(R.drawable.baseline_remove_circle_24);
|
||||
}
|
||||
boolean canViewStats = false;
|
||||
if (message.messageOwner.views > 0 || message.messageOwner.forwards > 0) {
|
||||
if (message.messageOwner.fwd_from != null && message.messageOwner.fwd_from.channel_post != 0) {
|
||||
|
@ -19364,6 +19380,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
icons.add(R.drawable.baseline_vpn_key_24);
|
||||
}
|
||||
}
|
||||
if (NekoConfig.showMessageHide) {
|
||||
items.add(LocaleController.getString("Hide", R.string.Hide));
|
||||
options.add(204);
|
||||
icons.add(R.drawable.baseline_remove_circle_24);
|
||||
}
|
||||
items.add(LocaleController.getString("Delete", R.string.Delete));
|
||||
options.add(1);
|
||||
icons.add(selectedObject.messageOwner.ttl_period != 0 ? R.drawable.msg_delete_auto : R.drawable.baseline_delete_24);
|
||||
|
@ -20737,6 +20758,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
|
||||
}
|
||||
case 204: {
|
||||
if (selectedObjectGroup != null) {
|
||||
for (MessageObject object : selectedObjectGroup.messages) {
|
||||
object.messageOwner.hide = true;
|
||||
}
|
||||
getMessageHelper().resetMessageContent(dialog_id, selectedObjectGroup.messages);
|
||||
} else {
|
||||
selectedObject.messageOwner.hide = true;
|
||||
getMessageHelper().resetMessageContent(dialog_id, selectedObject);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
selectedObject = null;
|
||||
selectedObjectGroup = null;
|
||||
|
|
|
@ -46,6 +46,15 @@ public class MessageHelper extends BaseController {
|
|||
getNotificationCenter().postNotificationName(NotificationCenter.replaceMessagesObjects, dialog_id, arrayList, false);
|
||||
}
|
||||
|
||||
public void resetMessageContent(long dialog_id, ArrayList<MessageObject> messageObjects) {
|
||||
ArrayList<MessageObject> arrayList = new ArrayList<>();
|
||||
for (MessageObject messageObject : messageObjects) {
|
||||
MessageObject obj = new MessageObject(currentAccount, messageObject.messageOwner, true, true);
|
||||
arrayList.add(obj);
|
||||
}
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.replaceMessagesObjects, dialog_id, arrayList, false);
|
||||
}
|
||||
|
||||
public static MessageHelper getInstance(int num) {
|
||||
MessageHelper localInstance = Instance.get(num);
|
||||
if (localInstance == null) {
|
||||
|
|
|
@ -59,6 +59,7 @@ public class NekoConfig {
|
|||
public static boolean showMessageDetails;
|
||||
public static boolean showTranslate;
|
||||
public static boolean showRepeat;
|
||||
public static boolean showMessageHide;
|
||||
|
||||
public static boolean hidePhone;
|
||||
public static int typeface;
|
||||
|
@ -218,6 +219,8 @@ public class NekoConfig {
|
|||
showMessageDetails = preferences.getBoolean("showMessageDetails", false);
|
||||
showTranslate = preferences.getBoolean("showTranslate", true);
|
||||
showRepeat = preferences.getBoolean("showRepeat", false);
|
||||
showMessageHide = preferences.getBoolean("showMessageHide", false);
|
||||
|
||||
eventType = preferences.getInt("eventType", 0);
|
||||
actionBarDecoration = preferences.getInt("actionBarDecoration", 0);
|
||||
newYear = preferences.getBoolean("newYear", false);
|
||||
|
@ -371,6 +374,14 @@ public class NekoConfig {
|
|||
editor.apply();
|
||||
}
|
||||
|
||||
public static void toggleShowHide() {
|
||||
showMessageHide = !showMessageHide;
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putBoolean("showMessageHide", showMessageHide);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static void toggleIPv6() {
|
||||
useIPv6 = !useIPv6;
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE);
|
||||
|
|
|
@ -386,7 +386,7 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
|
|||
linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL);
|
||||
linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
|
||||
|
||||
int count = NekoXConfig.developerMode ? 9 : 8;
|
||||
int count = NekoXConfig.developerMode ? 10 : 9;
|
||||
for (int a = 0; a < count; a++) {
|
||||
TextCheckCell textCell = new TextCheckCell(context);
|
||||
switch (a) {
|
||||
|
@ -423,6 +423,10 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
|
|||
break;
|
||||
}
|
||||
case 8: {
|
||||
textCell.setTextAndCheck(LocaleController.getString("Hide", R.string.Hide), NekoConfig.showMessageHide, false);
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
textCell.setTextAndCheck(LocaleController.getString("MessageDetails", R.string.MessageDetails), NekoConfig.showMessageDetails, false);
|
||||
break;
|
||||
}
|
||||
|
@ -474,6 +478,11 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati
|
|||
break;
|
||||
}
|
||||
case 8: {
|
||||
NekoConfig.toggleShowHide();
|
||||
textCell.setChecked(NekoConfig.showMessageHide);
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
NekoConfig.toggleShowMessageDetails();
|
||||
textCell.setChecked(NekoConfig.showMessageDetails);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue