Skip to content

Commit

Permalink
Convert rocketchat-irc to main module structure (#12672)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Nov 20, 2018
1 parent 51df48a commit b07fdeb
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/rocketchat-irc/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ Package.onUse(function(api) {
'ecmascript',
'underscore',
'rocketchat:lib',
'rocketchat:ui',
]);

api.addFiles('server/irc.js', 'server');
api.addFiles('server/methods/resetIrcConnection.js', 'server');
api.addFiles('server/irc-settings.js', 'server');
api.mainModule('server/index.js', 'server');
});

Npm.depends({
Expand Down
3 changes: 3 additions & 0 deletions packages/rocketchat-irc/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './irc';
import './methods/resetIrcConnection';
import './irc-settings';
1 change: 1 addition & 0 deletions packages/rocketchat-irc/server/irc-bridge/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RocketChat } from 'meteor/rocketchat:lib';
import Queue from 'queue-fifo';
import * as servers from '../servers';
import * as peerCommandHandlers from './peerHandlers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleOnCreateRoom(user, room) {
const users = RocketChat.models.Users.findByRoomId(room._id);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleOnCreateUser(newUser) {
if (!newUser) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleOnLogin(login) {
if (login.user === null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleOnSaveMessage(message, to) {
let toIdentification = '';
// Direct message
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleQUIT(args) {
const user = RocketChat.models.Users.findOne({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleJoinedChannel(args) {
const user = RocketChat.models.Users.findOne({
'profile.irc.nick': args.nick,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleLeftChannel(args) {
const user = RocketChat.models.Users.findOne({
'profile.irc.nick': args.nick,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

export default function handleNickChanged(args) {
const user = RocketChat.models.Users.findOne({
'profile.irc.nick': args.nick,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RocketChat } from 'meteor/rocketchat:lib';
/*
*
* Get direct chat room helper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

export default async function handleUserRegistered(args) {
// Check if there is an user with the given username
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-irc/server/irc-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.startup(function() {
RocketChat.settings.addGroup('IRC_Federation', function() {
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-irc/server/irc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import Bridge from './irc-bridge';

if (!!RocketChat.settings.get('IRC_Enabled') === true) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-irc/server/methods/resetIrcConnection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import { t } from 'meteor/rocketchat:ui';
import Bridge from '../irc-bridge';

Meteor.methods({
Expand Down

0 comments on commit b07fdeb

Please sign in to comment.