Skip to content
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

[FIX] Ignored messages #14465

Merged
merged 3 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions app/theme/client/imports/components/messages.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,37 @@
display: none;
}

&--ignored {
& .body {
&&--ignored {
min-height: 25px;
padding: 2px 50px 2px 70px;

font-size: 12px;

& > .thumb {
top: 3px;

width: 20px;
height: 20px;
margin-left: 16px;

& .avatar {
width: 100%;
height: 100%;
}
}

& .user {
font-size: 0.75rem;
font-weight: initial;
}

& .message-body-wrapper .body,
& .message-oembed,
& .attachment,
& .message-discussion,
& .reactions,
& .edited,
& .role-tag {
display: none;
}

Expand Down
2 changes: 1 addition & 1 deletion app/threads/client/flextab/thread.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="contextual-bar__header-title">
{{> loading}}
</li>
{{else}}
{{> message groupable=false hideRoles=true msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u}}
{{> message groupable=false hideRoles=true msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u ignored=false}}
{{#each msg in messages}}
{{> message hideRoles=true msg=msg room=room subscription=subscription settings=settings templatePrefix='thread-' u=u context="threads"}}
{{/each}}
Expand Down
4 changes: 4 additions & 0 deletions app/threads/client/flextab/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Template.thread.events({
const { atBottom } = this;
atBottom && this.sendToBottom();
},
'click .toggle-hidden'(e) {
const id = e.currentTarget.dataset.message;
document.querySelector(`#thread-${ id }`).classList.toggle('message--ignored');
},
});

Template.thread.helpers({
Expand Down
1 change: 1 addition & 0 deletions app/threads/client/flextab/threads.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ <h2 class="thread-empty">{{_ "No_Threads"}}</h2>
showDateSeparator=false
context="threads"
timeAgo=true
ignored=false
}}
{{/each}}
</ul>
Expand Down
10 changes: 6 additions & 4 deletions app/ui-message/client/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ Template.message.helpers({
return !msg.private && !msg.t && msg.u._id !== u._id && room && room.broadcast;
},
isIgnored() {
const { msg } = this;
return msg.ignored;
const { ignored, msg } = this;
const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored;
return isIgnored;
},
ignoredClass() {
const { msg } = this;
return msg.ignored ? 'message--ignored' : '';
const { ignored, msg } = this;
const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored;
return isIgnored ? 'message--ignored' : '';
},
isDecrypting() {
const { msg } = this;
Expand Down