Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
DEV-8196 Remove the ability to hide rooms (#20)
Browse files Browse the repository at this point in the history
* DEV-8196 Remove the ability to hide rooms

* DEV-8196 Remove the ability to hide rooms - API changes
  • Loading branch information
Sergey-Volkov authored Aug 4, 2020
1 parent f4fda67 commit 52275b7
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 67 deletions.
22 changes: 0 additions & 22 deletions app/api/server/v1/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
16 changes: 0 additions & 16 deletions app/api/server/v1/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
16 changes: 0 additions & 16 deletions app/api/server/v1/im.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 0 additions & 1 deletion app/channel-settings/client/views/channelSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ <h3 title="{{name}}" class="rc-user-info__name">{{> icon block="rc-header__icon"
{{#if canEditRoom}}
<button class="rc-button rc-button--icon rc-button--outline js-edit" type="submit">{{> icon icon='edit'}}{{_ "Edit"}}</button>
{{/if}}
<button class="rc-button rc-button--icon rc-button--outline js-hide" type="submit">{{> icon icon='eye-off'}}{{_ "Hide"}}</button>
{{#if canLeaveRoom}}
<button class="rc-button rc-button--icon rc-button--outline rc-button--cancel js-leave">{{> icon icon='sign-out'}}{{_ 'Leave'}}</button>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion app/slashcommands-hide/client/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './hide';

2 changes: 1 addition & 1 deletion app/slashcommands-hide/server/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './hide';

7 changes: 1 addition & 6 deletions app/ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ Template.sidebarItem.events({
return false;
};

const items = [{
icon: 'eye-off',
name: t('Hide_room'),
type: 'sidebar-item',
id: 'hide',
}];
const items = [];

if (this.alert) {
items.push({
Expand Down
4 changes: 0 additions & 4 deletions app/ui-utils/client/lib/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ Template.popover.events({
const { rid, name, template } = instance.data.data;
const action = e.currentTarget.dataset.id;

if (action === 'hide') {
hide(template, rid, name);
}

if (action === 'leave') {
leave(template, rid, name);
}
Expand Down

0 comments on commit 52275b7

Please sign in to comment.