diff --git a/packages/rocketchat-slashcommands-unarchiveroom/client/client.js b/packages/rocketchat-slashcommands-unarchiveroom/client/client.js index 9a0928c1bf74..419aab3b5f51 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/client/client.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/client/client.js @@ -1,3 +1,5 @@ +import { RocketChat } from 'meteor/rocketchat:lib'; + RocketChat.slashCommands.add('unarchive', null, { description: 'Unarchive', params: '#channel', diff --git a/packages/rocketchat-slashcommands-unarchiveroom/client/index.js b/packages/rocketchat-slashcommands-unarchiveroom/client/index.js new file mode 100644 index 000000000000..d99e4ed77352 --- /dev/null +++ b/packages/rocketchat-slashcommands-unarchiveroom/client/index.js @@ -0,0 +1 @@ +import './client'; diff --git a/packages/rocketchat-slashcommands-unarchiveroom/package.js b/packages/rocketchat-slashcommands-unarchiveroom/package.js index 3d8f36142f41..ec0f7818727b 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/package.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/package.js @@ -6,15 +6,12 @@ Package.describe({ }); Package.onUse(function(api) { - api.use([ 'ecmascript', 'check', 'rocketchat:lib', + 'templating', ]); - - api.use('templating', 'client'); - - api.addFiles('client/client.js', 'client'); - api.addFiles(['server/messages.js', 'server/server.js'], 'server'); + api.mainModule('client/index.js', 'client'); + api.mainModule('server/index.js', 'server'); }); diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/index.js b/packages/rocketchat-slashcommands-unarchiveroom/server/index.js new file mode 100644 index 000000000000..509b4bf77af8 --- /dev/null +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/index.js @@ -0,0 +1,2 @@ +import './messages'; +import './server'; diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/messages.js b/packages/rocketchat-slashcommands-unarchiveroom/server/messages.js index 8df9e61584b3..79538c270a61 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/messages.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/messages.js @@ -1,3 +1,5 @@ +import { RocketChat } from 'meteor/rocketchat:lib'; + RocketChat.models.Messages.createRoomUnarchivedByRoomIdAndUser = function(roomId, user) { return this.createWithTypeRoomIdMessageAndUser('room-unarchived', roomId, '', user); }; diff --git a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js index fa2433cb5a54..4e6cc8c264c1 100644 --- a/packages/rocketchat-slashcommands-unarchiveroom/server/server.js +++ b/packages/rocketchat-slashcommands-unarchiveroom/server/server.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; import { TAPi18n } from 'meteor/tap:i18n'; +import { RocketChat } from 'meteor/rocketchat:lib'; function Unarchive(command, params, item) { if (command !== 'unarchive' || !Match.test(params, String)) {