Skip to content

[NEW] Option to ignore users on channels#10517

Merged
rodrigok merged 28 commits intodevelopfrom
ignore0user
Apr 20, 2018
Merged

[NEW] Option to ignore users on channels#10517
rodrigok merged 28 commits intodevelopfrom
ignore0user

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Apr 19, 2018

Closes #9785

as @rodrigok said on #9785

Specification:

  • The list will be per room
  • Will be saved in user's subscription as an array of users to mute
  • Will be a field in room's setting using the component we already have to select users when creating a new channel
  • There will be a button in user's detail view and in message's context menu to mute/unmute the user (methods to be developed)
  • Will show an icon (to be defined) in members list to mark muted users
  • Will affect the rendering of the messages
  • Will hide the user's messages when listed in muted array but will keep the username adding a button to expand/show the messages
  • Should not send notifications and emails of messages from muted users
  • ~Should update the array of muted usernames when user change his username (RocketChat._setUsername)
  • The minimized message will be designed soon ??

lduo4kiuni
image

@gdelavald thanks <3

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10517 April 19, 2018 21:44 Inactive
@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 19, 2018 22:30 Inactive
@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 19, 2018 22:30 Inactive
@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 19, 2018 22:31 Inactive
Copy link
Contributor

@graywolf336 graywolf336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in this comment, #9785 (comment), the rest api wrapper is needed as well.

@ggazzo ggazzo had a problem deploying to rocket-chat-pr-10517 April 19, 2018 23:06 Failure
@ggazzo
Copy link
Member Author

ggazzo commented Apr 20, 2018

I'm waiting for the API too (:

@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 20, 2018 01:17 Inactive
@ggazzo
Copy link
Member Author

ggazzo commented Apr 20, 2018

just a joke <3

@gdelavald gdelavald temporarily deployed to rocket-chat-pr-10517 April 20, 2018 02:42 Inactive
@RocketChat RocketChat deleted a comment Apr 20, 2018
Copy link
Contributor

@graywolf336 graywolf336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there plans for the UX/UI piece to be improved?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typeof ignore === typeof '' seriously? I mean no offense, but are you intentionally trying to make unreadable code?? typeof ignore === 'string' is way more readable than what is currently there..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this way =/ sorry for make the code more unreadable

if (!rid || !rid.trim()) {
throw new Meteor.Error('error-room-id-param-not-provided', 'The required "rid" param is missing.');
}
if (!userId || !userId.trim()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line before this. (I'm being nitpicky, but yeah).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space near the end and the first ending }..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this contain a safety type check of Array.isArray(subscription.ignored)? It would replace the first check since null or undefined isn't an array. Just trying to think in case the data somehow gets corrupted (highly unlikely but yeah)..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix this spacing?

As a note, why exactly is this in this pull request?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I was working on member list and I saw that problem... maybe I should made an special commit for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability, can the call to the function be moved to the next line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability, can the call to the function be moved to the next line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this spacing :)

Meteor.methods({
ignoreUser({rid, userId: ignoredUser, ignore = true}) {
check(ignoredUser, String);
check(rid, String);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're type checking everything but the ignore. Is there a good reason behind this or can it be type checked as well?

Copy link
Member Author

@ggazzo ggazzo Apr 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just because the name suggest ignore and the param is a boolean so we can define a default... if you dont pass any information I will assume you really want ignore, if you passfalse you want remove the ignore , I dont like the idea of have 2 methods to do the same thing...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but what if I pass a string to this method? That's what I'm saying, add a type check to ensure the value being passed is a boolean as you assume it always will be.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm yep you are right :p

@karlprieb
Copy link
Contributor

@graywolf336 yep... we will change this design probably on the RC. Our design team is working on that.

@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 20, 2018 04:06 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10517 April 20, 2018 07:11 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10517 April 20, 2018 07:12 Inactive
karlprieb
karlprieb previously approved these changes Apr 20, 2018
@karlprieb karlprieb added the area: ui Touches the code on client side label Apr 20, 2018
@karlprieb karlprieb added this to the 0.64.0 milestone Apr 20, 2018
@karlprieb karlprieb dismissed their stale review April 20, 2018 17:12

waiting for @ggazzo type checker update

@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 20, 2018 21:22 Inactive
@ggazzo ggazzo temporarily deployed to rocket-chat-pr-10517 April 20, 2018 21:49 Inactive
@rodrigok rodrigok changed the title [NEW] Ignore user on channels [NEW] Option to ignore users on channels Apr 20, 2018
@rodrigok rodrigok merged commit 93b1641 into develop Apr 20, 2018
@rodrigok rodrigok deleted the ignore0user branch April 20, 2018 22:34
@rodrigok rodrigok mentioned this pull request Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Touches the code on client side

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mute Feature: Hide messages from specific users

6 participants

Comments