-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Deleted message #12804
Add Deleted message #12804
Conversation
Jenkins BuildsClick to see older builds (21)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opacity: 0.1 | ||
Layout.alignment: Qt.AlignVCenter | ||
|
||
StatusIcon { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color: Theme.palette.dangerColor1 | ||
opacity: 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
color: Theme.palette.dangerColor1 | |
opacity: 0.1 | |
color: Theme.palette.dangerColor3 |
20fbeb0
to
83458bf
Compare
@alexjba nice eye. I did find that my icon was hard to see. I forgot that setting opacity on a parent also affects the children 🤦 |
|
||
# messages are sorted from the most recent to the least recent one | ||
viewItems.add(item) | ||
var viewItems = self.createMessageItemsFromMessageDtos(messages, reactions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Component { | ||
id: deletedMessageComponent | ||
|
||
ColumnLayout { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ColumnLayout
seems redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm just a QML noob, but without it, the Layout.
properties in the RowLayout didn't work. I think it's because the parent of deletedMessageComponent
's Loader is not a Layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... it's weird to have Loader
as the toplevel item, you never know in which context the component ends up being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see, it indeed will do the trick here. It's not right, but shouldn't hurt, so I guess we can keep it as it will be rewritten anyway 🙂
|
||
RowLayout { | ||
id: deletedMessage | ||
height: 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't set height
here, it should be calculated automatically based on content size and given margins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is meant to be removed/refactored by actual good UI devs when we get a design someday 😅
} | ||
|
||
Rectangle { | ||
width: deletedMessage.height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be either implicit...
or Layout.preferred...
, it's wrong to set width
/height
for items inside a Layout.
Same for items below
if result.deleted and result.deletedBy == "": | ||
# The message was deleted by the sender itself | ||
result.deletedBy = result.`from` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the following code needed then 🤔
status-desktop/src/app/modules/main/chat_section/chat_content/messages/module.nim
Lines 547 to 552 in 83458bf
if deletedBy == "": | |
# deletedBy is empty if it was deleted by the sender | |
let messageItem = self.view.model().getItemWithMessageId(messageId) | |
if messageItem.id == "": | |
return | |
deletedByValue = messageItem.senderId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because that code in onMessageDeleted
is called from a status-go signal that only contains the messageID, the chatID and possibly the deletedBy (see RemovedMessageDto
).
83458bf
to
6533457
Compare
da119d2
to
21c50c7
Compare
Fixes #11712
Adds a little message when someone deletes a message and shows who deleted.
Do note: there is no Desktop design for this, so I just copied the mobile design. We can modify it once we have an actual design.
delete.webm
^user on the left, group admin on the right (he can delete other people's messages)