diff --git a/app/api/server/v1/channels.js b/app/api/server/v1/channels.js index 76af348d9a6c3..4331baedb61ca 100644 --- a/app/api/server/v1/channels.js +++ b/app/api/server/v1/channels.js @@ -93,28 +93,6 @@ API.v1.addRoute('channels.archive', { authRequired: true }, { }, }); -API.v1.addRoute('channels.close', { authRequired: true }, { - post() { - const findResult = findChannelByIdOrName({ params: this.requestParams(), checkedArchived: false }); - - const sub = Subscriptions.findOneByRoomIdAndUserId(findResult._id, this.userId); - - if (!sub) { - return API.v1.failure(`The user/callee is not in the channel "${ findResult.name }.`); - } - - if (!sub.open) { - return API.v1.failure(`The channel, ${ findResult.name }, is already closed to the sender`); - } - - Meteor.runAsUser(this.userId, () => { - Meteor.call('hideRoom', findResult._id); - }); - - return API.v1.success(); - }, -}); - API.v1.addRoute('channels.counters', { authRequired: true }, { get() { const access = hasPermission(this.userId, 'view-room-administration'); diff --git a/app/api/server/v1/groups.js b/app/api/server/v1/groups.js index 254c5b8853468..6dcbfb0c84e44 100644 --- a/app/api/server/v1/groups.js +++ b/app/api/server/v1/groups.js @@ -122,22 +122,6 @@ API.v1.addRoute('groups.archive', { authRequired: true }, { }, }); -API.v1.addRoute('groups.close', { authRequired: true }, { - post() { - const findResult = findPrivateGroupByIdOrName({ params: this.requestParams(), userId: this.userId, checkedArchived: false }); - - if (!findResult.open) { - return API.v1.failure(`The private group, ${ findResult.name }, is already closed to the sender`); - } - - Meteor.runAsUser(this.userId, () => { - Meteor.call('hideRoom', findResult.rid); - }); - - return API.v1.success(); - }, -}); - API.v1.addRoute('groups.counters', { authRequired: true }, { get() { const access = hasPermission(this.userId, 'view-room-administration'); diff --git a/app/api/server/v1/im.js b/app/api/server/v1/im.js index f61426949b083..63b5bfef371c9 100644 --- a/app/api/server/v1/im.js +++ b/app/api/server/v1/im.js @@ -48,22 +48,6 @@ API.v1.addRoute(['dm.create', 'im.create'], { authRequired: true }, { }, }); -API.v1.addRoute(['dm.close', 'im.close'], { authRequired: true }, { - post() { - const findResult = findDirectMessageRoom(this.requestParams(), this.user); - - if (!findResult.subscription.open) { - return API.v1.failure(`The direct message room, ${ this.bodyParams.name }, is already closed to the sender`); - } - - Meteor.runAsUser(this.userId, () => { - Meteor.call('hideRoom', findResult.room._id); - }); - - return API.v1.success(); - }, -}); - API.v1.addRoute(['dm.counters', 'im.counters'], { authRequired: true }, { get() { const access = hasPermission(this.userId, 'view-room-administration'); diff --git a/app/channel-settings/client/views/channelSettings.html b/app/channel-settings/client/views/channelSettings.html index 67b3fb5ad62e4..ef4736fc06f1c 100644 --- a/app/channel-settings/client/views/channelSettings.html +++ b/app/channel-settings/client/views/channelSettings.html @@ -419,7 +419,6 @@