Skip to content
Snippets Groups Projects
Commit da84417e authored by Alex Brazier's avatar Alex Brazier
Browse files

Mute users added by room owner in read only room

parent 97e8be80
No related branches found
No related tags found
No related merge requests found
......@@ -134,5 +134,5 @@ Template.channelSettings.onCreated ->
when 'readOnly'
Meteor.call 'saveRoomSettings', room._id, 'readOnly', @$('input[name=readOnly]:checked').val() is 'true', (err, result) ->
return handleError err if err
toastr.success 'Read Only changed successfully'
toastr.success TAPi18n.__ 'Read_only_changed_successfully'
@editing.set()
......@@ -895,6 +895,7 @@
"Reactions" : "Reactions",
"Read_only" : "Read Only",
"Read_only_channel" : "Read Only Channel",
"Read_only_changed_successfully" : "Read only changed successfully",
"Read_only_group" : "Read Only Group",
"Record" : "Record",
"Redirect_URI" : "Redirect URI",
......
......@@ -28,7 +28,10 @@ Meteor.methods
newUser = RocketChat.models.Users.findOneByUsername data.username
RocketChat.models.Rooms.addUsernameById data.rid, data.username
if room.ro
RocketChat.models.Rooms.addUsernameByIdAndMute data.rid, data.username
else
RocketChat.models.Rooms.addUsernameById data.rid, data.username
now = new Date()
......@@ -38,11 +41,12 @@ Meteor.methods
alert: true
unread: 1
fromUser = RocketChat.models.Users.findOneById fromId
RocketChat.models.Messages.createUserAddedWithRoomIdAndUser data.rid, newUser,
ts: now
u:
_id: fromUser._id
username: fromUser.username
if not room.ro
fromUser = RocketChat.models.Users.findOneById fromId
RocketChat.models.Messages.createUserAddedWithRoomIdAndUser data.rid, newUser,
ts: now
u:
_id: fromUser._id
username: fromUser.username
return true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment