Skip to content

Commit

Permalink
Convert rocketchat-slashcommands-unarchiveroom to main module structu…
Browse files Browse the repository at this point in the history
…re (#12827)
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Dec 4, 2018
1 parent 7b21a6d commit b65ed96
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.slashCommands.add('unarchive', null, {
description: 'Unarchive',
params: '#channel',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './client';
9 changes: 3 additions & 6 deletions packages/rocketchat-slashcommands-unarchiveroom/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './messages';
import './server';
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.models.Messages.createRoomUnarchivedByRoomIdAndUser = function(roomId, user) {
return this.createWithTypeRoomIdMessageAndUser('room-unarchived', roomId, '', user);
};
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit b65ed96

Please sign in to comment.