diff --git a/client/methods/saveRoomName.coffee b/client/methods/saveRoomName.coffee deleted file mode 100644 index 2072d68fa0bb..000000000000 --- a/client/methods/saveRoomName.coffee +++ /dev/null @@ -1,26 +0,0 @@ -Meteor.methods - saveRoomName: (rid, name) -> - if not Meteor.userId() - throw new Meteor.Error 203, t('User_logged_out') - - room = ChatRoom.findOne rid - - if room.u._id isnt Meteor.userId() or room.t not in ['c', 'p'] - throw new Meteor.Error 403, t('Not allowed') - - name = _.slugify name - - if name is room.name - return - - ChatRoom.update rid, - $set: - name: name - - ChatSubscription.update - rid: rid - , - $set: - name: name - - return name diff --git a/client/views/app/room.coffee b/client/views/app/room.coffee index 80dd1c74fb99..4c128db8ece9 100644 --- a/client/views/app/room.coffee +++ b/client/views/app/room.coffee @@ -70,6 +70,11 @@ Template.room.helpers else return roomData.name + roomTopic: -> + roomData = Session.get('roomData' + this._id) + return '' unless roomData + return roomData.topic + roomIcon: -> roomData = Session.get('roomData' + this._id) return '' unless roomData?.t @@ -114,26 +119,9 @@ Template.room.helpers return '' unless roomData return roomData.t is 'c' - canEditName: -> - roomData = Session.get('roomData' + this._id) - return '' unless roomData - if roomData.t in ['c', 'p'] - return RocketChat.authz.hasAtLeastOnePermission('edit-room', this._id) - else - return '' - canDirectMessage: -> return Meteor.user()?.username isnt this.username - roomNameEdit: -> - return Session.get('roomData' + this._id)?.name - - editingTitle: -> - return 'hidden' if Session.get('editRoomTitle') - - showEditingTitle: -> - return 'hidden' if not Session.get('editRoomTitle') - flexOpened: -> return 'opened' if RocketChat.TabBar.isFlexOpen() diff --git a/client/views/app/room.html b/client/views/app/room.html index 3c2380b39296..3399c50d2133 100644 --- a/client/views/app/room.html +++ b/client/views/app/room.html @@ -13,11 +13,8 @@