Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
171754e
Remove some dependencies inside rocketchat-lib/client (#13210)
Jan 21, 2019
f536345
Remove some dependencies inside rocketchat-lib/lib (#13212)
Jan 21, 2019
118634c
Remove some dependencies inside rocketchat-lib/server/functions (#13214)
Jan 22, 2019
2bf63fb
Remove some dependencies inside rocketchat-lib/server/lib (#13217)
Jan 22, 2019
3f1451f
Remove some dependencies inside rocketchat-lib/server/methods (#13218)
Jan 22, 2019
23388c4
Remove some dependencies inside rocketchat-lib/server/startup, public…
Jan 22, 2019
23547e9
Remove duplicated server settings (#13223)
Jan 22, 2019
45b5dd0
Export functions and lib function of rc-lib but keep it inside RC na…
Jan 23, 2019
a233ad7
Import variables from functions and lib to remove RC namespace depen…
Jan 23, 2019
96f6fa1
Remove dependency of RC namespace in rc-sandstorm (#13227)
Jan 23, 2019
4a3c69a
Remove dependency of RC namespace in chatpal-search (#13231)
Jan 23, 2019
54b152f
Remove dependency of RC namespace in meteor saml (#13233)
Jan 23, 2019
b3906fa
Remove dependency of RC namespace in rc-theme (#13234)
Jan 23, 2019
9bd766a
Remove dependency of RC namespace in rc-2fa (#13235)
Jan 23, 2019
86ae7c8
Remove dependency of RC namespace in rc-action-links (#13236)
Jan 23, 2019
ed81de8
Remove dependency of RC namespace in rc-analytics and rc-assets (#13…
Jan 24, 2019
a5e4f43
Remove dependency of RC namespace in rc-markdown, rc-autolinker and …
Jan 24, 2019
258d258
Remove dependency of RC namespace in rc-blockstack, bot-helpers and …
Jan 24, 2019
b9e1538
Remove dependency of RC namespace in rc-channel-settings (#13251)
Jan 24, 2019
aff4cfe
Remove dependency of RC namespace in rc-channel-mail-messages and cl…
Jan 24, 2019
02436be
Remove dependency of RC namespace in rc-colors, cors, crowd and dolp…
Jan 24, 2019
5528c0f
Remove dependency of RC namespace in rc-emoji-custom and drupal (#13…
Jan 25, 2019
c70a809
Remove dependency of RC namespace in rc-emojione, error-handler, gh-e…
Jan 25, 2019
ffa0945
Remove dependency of RC namespace in rc-google-natural-language, gran…
Jan 25, 2019
9ea6306
Remove dependency of RC namespace in rc-iframe-login and all imports…
Jan 25, 2019
801ed01
Move RestAPI client to rc-api package
Jan 28, 2019
1238c2c
Remove dependency of RC namespace in rc-api/helpers and api.js
Jan 28, 2019
dc8f615
Remove dependency of RC namespace on half of api files
Jan 28, 2019
c6db2d5
Partial Remove dependency of RC namespace in rc-api
Jan 28, 2019
06f62e6
import API where it was being used by the RC namespace
Jan 28, 2019
cd1930c
Move processWebhookMessage function to rc-lib package
Jan 28, 2019
d7eab39
Remove API from RC namespace and import missing function that was bei…
Jan 28, 2019
59bbccc
Remove dependency of RC namespace in rc-graphql
Jan 28, 2019
e90ab24
Fix import from wrong package
Jan 28, 2019
fd4f74c
Remove dependency of RC namespace in rc-importer
Jan 28, 2019
58ad493
Remove dependency of RC namespace in rc-issue-links
Jan 28, 2019
5783786
Remove dependency of RC namespace in rc-katex
Jan 28, 2019
e9be3a4
Move templateVarHandler fn to rc-utils
Jan 28, 2019
406e037
Remove dependency of RC namespace in rc-ldap
Jan 28, 2019
0206d28
Remove dependency of RC namespace in rc-livestream
Feb 1, 2019
b6b980b
Remove dependency of RC namespace in rc-mail-messages
Feb 1, 2019
7c7b063
Remove dependency of RC namespace in rc-mapview
Feb 1, 2019
e08ad7e
Remove dependency of RC namespace in rc-mentions
Feb 1, 2019
8bb2a96
Remove dependency of RC namespace in rc-mentions-flextab
Feb 1, 2019
ea2b699
Remove depedency of RC namespace in rc-message-attachements
Feb 1, 2019
4da85d9
Remove dependdency of RC namespace in rc-message-mark-as-unread
Feb 1, 2019
1717135
Remove dependency of RC namespace in rc-message-pin
Feb 1, 2019
6733112
Fix templateVarHandler that was in wrong folder
Feb 1, 2019
bff0955
Merge branch 'develop' into depackaging
Feb 4, 2019
b42676d
Merge branch 'depackaging' into globals/api-wave-1
Feb 4, 2019
9db42c7
Merge branch 'globals/api-wave-1' into globals/api-wave-2
Feb 4, 2019
d9635ae
Merge branch 'globals/api-wave-2' into globals/api-wave-3
Feb 4, 2019
5560fb1
Merge branch 'globals/api-wave-3' into globals/api-wave-4
Feb 4, 2019
765a43a
Merge branch 'globals/api-wave-4' into globals/graphql
Feb 4, 2019
b567143
Merge branch 'globals/graphql' into globals/importer
Feb 4, 2019
9fdf8a1
Merge branch 'globals/importer' into globals/issue-katex-ldap
Feb 4, 2019
e9d857d
Merge branch 'globals/issue-katex-ldap' into globals/livestream-mail-…
Feb 4, 2019
edf0e3d
Merge branch 'globals/livestream-mail-messages' into globals/mapview-…
Feb 4, 2019
d39b6cd
Remove namespace in the new livechat endpoint
Feb 4, 2019
e08efcd
Merge branch 'globals/api-wave-4' into globals/graphql
Feb 4, 2019
20a71ff
Merge branch 'globals/graphql' into globals/importer
Feb 4, 2019
77d0e2e
Merge branch 'globals/importer' into globals/issue-katex-ldap
Feb 4, 2019
b588332
Merge branch 'globals/issue-katex-ldap' into globals/livestream-mail-…
Feb 4, 2019
e9a51ab
Merge branch 'globals/livestream-mail-messages' into globals/mapview-…
Feb 4, 2019
0d397c8
Merge branch 'globals/mapview-mentions' into globals/message
Feb 4, 2019
1ae8bfd
Remove dependency of RC namespace in rc-message-snippet
Feb 4, 2019
3bd702f
Remove dependency of RC namespace in rc-message-star
Feb 4, 2019
0dbc8ed
Remove dependency of RC namespace in rc-oauth2
Feb 4, 2019
584d087
Remove dependency of RC namespace in rc-oembed
Feb 4, 2019
c06f9e1
Remove dependency of RC namespace in rc-otr
Feb 4, 2019
b807e99
Remove dependency of RC namespace in rc-reactions
Feb 4, 2019
87a39cf
Remove dependency of RC namespace in rc-retention-policy
Feb 4, 2019
923b584
Remove dependency of RC namespace in rc-earch
Feb 4, 2019
b2db169
Remove dependency of RC namespace in rc-setup-wizard
Feb 4, 2019
b7174f8
Remove dependency of RC namespace in rc-slackbridge
Feb 4, 2019
9cbf738
Remove dependency of Rc namespace in slashcommands-asciiarts
Feb 4, 2019
3dd76ba
Remove depedency of RC namespace in rc-slash-archiveroom
Feb 4, 2019
ca9c074
Remove dependency of RC namespace in rc-slash-create
Feb 4, 2019
c4354d0
Remove dependency of RC namespace in rc-slash-help
Feb 4, 2019
c0ede55
Remove dependency of RC namespace in rc-slash-hide
Feb 4, 2019
b6fd2d5
Remove dependency of RC namespace in rc-slash-invite
Feb 4, 2019
c532fad
Remove dependency of RC namespace in rc-slash-inviteall
Feb 4, 2019
40fb545
Remove dependency of RC namespace in rc-slash-join
Feb 5, 2019
e24096b
Remove dependency of RC namespace in rc-slash-kick
Feb 5, 2019
1aa0f73
Remove dependency of RC namespace in rc-slash-leave
Feb 5, 2019
74fc80c
Remove dependency of RC namespace in rc-slash-me
Feb 5, 2019
5180629
Remove dependency of RC namespace in rc-slash-msg
Feb 5, 2019
b3c4be2
Remove dependency of RC namespace in rc-slash-mute
Feb 5, 2019
baa9aec
Remove dependency of RC namespace in rc-slash-open
Feb 5, 2019
d75940e
Remove dependency of RC namespace in rc-slash-topic
Feb 5, 2019
8687f9e
Remove dependency of RC namespace in rc-slash-unarchiveroom
Feb 5, 2019
90adc29
Remove dependency of RC namespace in rc-smarsh-connector
Feb 5, 2019
76a7209
Remove dependency of RC namespace in rc-sms
Feb 5, 2019
73c2704
Remove dependency of RC namespace in rc-spotify
Feb 5, 2019
56d9d99
Remove dependency of RC namespace in rc-statistics
Feb 5, 2019
ad49a78
Move tokenpass models methods to rc-models
Feb 5, 2019
8169e2c
Remove dependency of RC namespace in rc-tokenpass
Feb 5, 2019
dfeab9f
import tokenpass inside rc-lib
Feb 5, 2019
7e7752c
Remove dependency of RC namespace in rc-ui
Feb 5, 2019
c9e2c01
Move webdavAccounts models to rc-model
Feb 5, 2019
62e6542
Remove dependency of RC namespace in rc-ui-account
Feb 5, 2019
2432e9a
Remove dependency of RC namespace in rc-ui-admin
Feb 5, 2019
3c063a5
Remove dependency of RC namespace in rc-ui-clean-history
Feb 5, 2019
18724d6
Remove dependency of RC namespace in rc-ui-flextab
Feb 5, 2019
e877444
Remove dependency of RC namespace in rc-ui-login
Feb 5, 2019
995f51a
Remove dependency of RC namespace in rc-ui-master
Feb 5, 2019
060d85a
Remove dependency of RC namespace in rc-ui-message
Feb 5, 2019
00b33ca
REmove dependency of RC namespace in rc-user-data-download
Feb 5, 2019
ba43cc0
Remove dependency of RC namespace in rc-version-check
Feb 5, 2019
ebe6d01
Remove dependency of RC namespace in rc-videobridge
Feb 5, 2019
896070b
Remove dependency of RC namespace in rc-webdav
Feb 5, 2019
112638c
Remove dependency of RC namespace in rc-wordpress
Feb 5, 2019
79d7200
Remove some RC namespace use in chatpal-search
Feb 5, 2019
869c40d
Remove dependency of RC namespace in rc-irc
Feb 5, 2019
ce4f107
Remove dependency of RC namespace in livechat/client
Feb 5, 2019
2e7cb78
Move methods in common livechat models to rc-models
Feb 6, 2019
6a4f363
Remove dependency of RC namespace in rc-livechat/server/models
Feb 6, 2019
2df8424
Remove LIvechat global variable from RC namespace
Feb 6, 2019
42c8419
Remove dependency of RC namespace in rc-livechat/imports, lib, server…
Feb 6, 2019
099527b
Remove dependency of RC namespace in rc-livechat/server/methods
Feb 6, 2019
1f29533
Fix duplicated import
Feb 6, 2019
0a5281d
Remove unused import
Feb 6, 2019
2effa03
Remove dependency of RC namespace in rc-livechat/server/publications
Feb 6, 2019
200fa23
MOve rc-livechat server models to rc-models
Feb 6, 2019
bc5615a
Change imports of livechat server models to rc-models package
Feb 6, 2019
767f35d
Remove dependency of RC namespace in rc-api/helpers and api.js (#13273)
Feb 6, 2019
5228d2f
Remove dependency of RC namespace on half of api files (#13275)
Feb 6, 2019
dbbdc8f
Remove dependency of RC namespace in rc-integrations
Feb 6, 2019
f0d8a0c
Import missed functions in rc-irc
Feb 6, 2019
b26f172
Remove dependency of RC namespace in rc-hipchat-enterprise-importer
Feb 6, 2019
db160bf
Partial Remove dependency of RC namespace in rc-api (#13277)
Feb 6, 2019
5643fd3
Remove dependency of RC namespace in root client folder
Feb 6, 2019
7cfaa1e
Remove dependency of RC namespace in imports/message-read-receipt
Feb 6, 2019
1eaaca7
Remove dependency of RC namespace in imports/personal-access-tokens
Feb 6, 2019
c977598
Remove dependency of RC namespace in rc-api (#13278)
Feb 6, 2019
599f6f3
Remove dependency of RC namespace in rc-graphql (#13279)
Feb 6, 2019
e3fd332
Remove dependency of RC namespace in root server folder - step 1
Feb 6, 2019
05bb4a6
Remove dependency of RC namespace in rc-importer (#13280)
Feb 6, 2019
dc75e7d
Remove dependency of RC namespace in rc-ldap, katex and issue-links …
Feb 6, 2019
412eb06
Remove dependency of RC namespace in rc-livestream and rc-mail-messa…
Feb 6, 2019
a464aff
Remove dependency of RC namespace in root server folder - step 2
Feb 7, 2019
94a9aee
Remove dependency of RC namespace in root server folder - step 3
Feb 7, 2019
af0cd75
Remove dependency of RC namespace in root server folder - step 4
Feb 7, 2019
97d3e08
Remove dependency of RC namespace in root server folder - step 5
Feb 7, 2019
3613dc5
Merge remote-tracking branch 'origin/depackaging' into globals/messag…
rodrigok Feb 13, 2019
da35a0b
Merge branch 'develop' into depackaging
Feb 14, 2019
fbf2883
Merge remote-tracking branch 'origin/depackaging' into globals/messag…
rodrigok Feb 14, 2019
427692c
Merge remote-tracking branch 'origin/develop' into globals/message-pi…
rodrigok Feb 14, 2019
6150fd4
Merge remote-tracking branch 'origin/globals/message-pin-snippet' int…
rodrigok Feb 14, 2019
2ae5c47
Merge remote-tracking branch 'origin/develop' into globals/message-pi…
rodrigok Feb 14, 2019
32d2e62
Merge branch 'globals/message-pin-snippet' into globals/message-star-…
rodrigok Feb 14, 2019
61a7534
Merge branch 'globals/message-star-oauth2-server' into globals/oembed…
rodrigok Feb 14, 2019
4211b8e
Merge branch 'develop' into globals/message-star-oauth2-server
rodrigok Feb 14, 2019
ec940cb
Merge branch 'globals/message-star-oauth2-server' into globals/oembed…
rodrigok Feb 14, 2019
45f6a1e
Merge branch 'globals/oembed-otr' into globals/reactions-rp-search
rodrigok Feb 14, 2019
0495b53
Merge branch 'globals/reactions-rp-search' into globals/setup-slackbr…
rodrigok Feb 14, 2019
b5278f7
Merge branch 'globals/setup-slackbridge-asciiarts' into globals/slash
rodrigok Feb 14, 2019
fc6bcf8
Merge branch 'globals/slash' into globals/slash-wave-2
rodrigok Feb 14, 2019
2bd8afd
Merge remote-tracking branch 'origin/develop' into globals/reactions-…
rodrigok Feb 14, 2019
47a145d
Merge branch 'globals/reactions-rp-search' into globals/setup-slackbr…
rodrigok Feb 14, 2019
9f29f12
Merge branch 'globals/setup-slackbridge-asciiarts' into globals/slash
rodrigok Feb 14, 2019
4a23834
Merge branch 'globals/slash' into globals/slash-wave-2
rodrigok Feb 14, 2019
03e17cb
Merge branch 'develop' into globals/slash
rodrigok Feb 14, 2019
07b435b
Merge remote-tracking branch 'origin/globals/slash' into globals/slas…
rodrigok Feb 14, 2019
9f3d69c
Merge remote-tracking branch 'origin/develop' into globals/slash-wave-2
rodrigok Feb 14, 2019
867f05a
Merge branch 'globals/slash-wave-2' into globals/smarsh-sms-spotify
rodrigok Feb 14, 2019
2cea2ef
Merge branch 'globals/smarsh-sms-spotify' into globals/statistics-tok…
rodrigok Feb 14, 2019
4fe5462
Merge branch 'globals/statistics-tokenpass' into globals/ui-account-a…
rodrigok Feb 14, 2019
a348050
Merge branch 'develop' into globals/ui-account-admin
rodrigok Feb 14, 2019
7005d3c
Merge branch 'globals/ui-account-admin' into globals/ui-clean-history…
rodrigok Feb 14, 2019
dd9939b
Merge branch 'globals/ui-clean-history-flextab-login' into globals/ui…
rodrigok Feb 14, 2019
135f635
Merge branch 'globals/ui-master-message' into globals/videobridge
rodrigok Feb 14, 2019
8768bb0
Merge branch 'globals/videobridge' into globals/wordpress
rodrigok Feb 14, 2019
3d63bd8
Merge remote-tracking branch 'origin/develop' into globals/videobridge
rodrigok Feb 15, 2019
adc906c
Merge branch 'globals/videobridge' into globals/wordpress
rodrigok Feb 15, 2019
5af135e
Merge branch 'globals/wordpress' into globals/livechat-wave-1
rodrigok Feb 15, 2019
0c9eca5
Merge branch 'globals/livechat-wave-1' into globals/livechat-server-m…
rodrigok Feb 15, 2019
aa6f839
Merge branch 'globals/livechat-server-models' into globals/livechat-g…
rodrigok Feb 15, 2019
597e8e2
Merge remote-tracking branch 'origin/develop' into globals/livechat-s…
rodrigok Feb 15, 2019
db2928f
Merge branch 'globals/livechat-server-models' into globals/livechat-g…
rodrigok Feb 15, 2019
88d843c
Merge remote-tracking branch 'origin/develop' into globals/livechat-g…
rodrigok Feb 15, 2019
5e28cc9
Merge branch 'globals/livechat-global' into globals/livechat-server-r…
rodrigok Feb 15, 2019
1a4de21
Merge branch 'globals/livechat-server-rc-wave-1' into globals/livecha…
rodrigok Feb 15, 2019
8700c10
Merge branch 'globals/livechat-server-rc-wave-2' into globals/livecha…
rodrigok Feb 15, 2019
7c4d675
Merge remote-tracking branch 'origin/develop' into globals/livechat-s…
rodrigok Feb 15, 2019
5c258f4
Merge branch 'globals/livechat-server-rc-wave-1' into globals/livecha…
rodrigok Feb 15, 2019
e2925bf
Merge branch 'globals/livechat-server-rc-wave-2' into globals/livecha…
rodrigok Feb 15, 2019
2c424f9
Merge branch 'globals/livechat-server-rc-wave-3' into globals/livecha…
rodrigok Feb 15, 2019
d9c0f68
Merge branch 'globals/livechat-server-models-wave-4' into globals/int…
rodrigok Feb 15, 2019
62e3512
Merge branch 'globals/integrations' into globals/client-imports
rodrigok Feb 15, 2019
d3e1add
Merge remote-tracking branch 'origin/develop' into globals/livechat-s…
rodrigok Feb 15, 2019
e4538cd
Merge branch 'globals/livechat-server-models-wave-4' into globals/int…
rodrigok Feb 15, 2019
5ff6717
Merge branch 'globals/integrations' into globals/client-imports
rodrigok Feb 15, 2019
abf17ba
Merge branch 'globals/client-imports' into globals/server-wave-1
rodrigok Feb 15, 2019
c50d273
Merge branch 'globals/server-wave-1' into globals/server-wave-2
rodrigok Feb 15, 2019
26654c5
Merge branch 'globals/server-wave-2' into globals/server-wave-3
rodrigok Feb 15, 2019
6870da7
Merge branch 'globals/server-wave-3' into globals/server-wave-4
rodrigok Feb 15, 2019
f30fd4a
Merge branch 'globals/server-wave-4' into globals/server-wave-5
rodrigok Feb 15, 2019
0ed28d7
Merge remote-tracking branch 'origin/develop' into globals/server-wave-4
rodrigok Feb 15, 2019
9a4ef2a
Merge branch 'globals/server-wave-4' into globals/server-wave-5
rodrigok Feb 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions server/startup/migrations/v041.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users } from 'meteor/rocketchat:models';

Migrations.add({
version: 41,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ bot: true }, { $set: { type: 'bot' } }, { multi: true });
RocketChat.models.Users.update({ 'profile.guest': true }, { $set: { type: 'visitor' } }, { multi: true });
RocketChat.models.Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true });
if (Users) {
Users.update({ bot: true }, { $set: { type: 'bot' } }, { multi: true });
Users.update({ 'profile.guest': true }, { $set: { type: 'visitor' } }, { multi: true });
Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true });
}
},
});
17 changes: 10 additions & 7 deletions server/startup/migrations/v042.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Mongo } from 'meteor/mongo';
import { Migrations } from 'meteor/rocketchat:migrations';
import { settings } from 'meteor/rocketchat:settings';
import { RocketChatAssets } from 'meteor/rocketchat:assets';

RocketChat.Migrations.add({
Migrations.add({
version: 42,
up() {
const files = RocketChat.__migration_assets_files = new Mongo.Collection('assets.files');
const chunks = RocketChat.__migration_assets_chunks = new Mongo.Collection('assets.chunks');
const files = new Mongo.Collection('assets.files');
const chunks = new Mongo.Collection('assets.chunks');
const list = {
'favicon.ico': 'favicon_ico',
'favicon.svg': 'favicon',
Expand All @@ -28,11 +31,11 @@ RocketChat.Migrations.add({
});

if (oldFile) {
const extension = RocketChat.Assets.mime.extension(oldFile.contentType);
RocketChat.settings.removeById(`Assets_${ from }`);
RocketChat.settings.updateById(`Assets_${ to }`, {
const extension = RocketChatAssets.mime.extension(oldFile.contentType);
settings.removeById(`Assets_${ from }`);
settings.updateById(`Assets_${ to }`, {
url: `/assets/${ to }.${ extension }`,
defaultUrl: RocketChat.Assets.assets[to].defaultUrl,
defaultUrl: RocketChatAssets.assets[to].defaultUrl,
});

oldFile._id = to;
Expand Down
9 changes: 6 additions & 3 deletions server/startup/migrations/v043.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Permissions } from 'meteor/rocketchat:models';

Migrations.add({
version: 43,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Permissions) {
RocketChat.models.Permissions.update({ _id: 'pin-message' }, { $addToSet: { roles: 'admin' } });
if (Permissions) {
Permissions.update({ _id: 'pin-message' }, { $addToSet: { roles: 'admin' } });
}
},
});
27 changes: 15 additions & 12 deletions server/startup/migrations/v044.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users, Settings } from 'meteor/rocketchat:models';

Migrations.add({
version: 44,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.find({ $or: [{ 'settings.preferences.disableNewRoomNotification': { $exists: 1 } }, { 'settings.preferences.disableNewMessageNotification': { $exists: 1 } }] }).forEach(function(user) {
if (Users) {
Users.find({ $or: [{ 'settings.preferences.disableNewRoomNotification': { $exists: 1 } }, { 'settings.preferences.disableNewMessageNotification': { $exists: 1 } }] }).forEach(function(user) {
const newRoomNotification = !(user && user.settings && user.settings.preferences && user.settings.preferences.disableNewRoomNotification);
const newMessageNotification = !(user && user.settings && user.settings.preferences && user.settings.preferences.disableNewMessageNotification);
RocketChat.models.Users.update({ _id: user._id }, { $unset: { 'settings.preferences.disableNewRoomNotification': 1, 'settings.preferences.disableNewMessageNotification': 1 }, $set: { 'settings.preferences.newRoomNotification': newRoomNotification, 'settings.preferences.newMessageNotification': newMessageNotification } });
Users.update({ _id: user._id }, { $unset: { 'settings.preferences.disableNewRoomNotification': 1, 'settings.preferences.disableNewMessageNotification': 1 }, $set: { 'settings.preferences.newRoomNotification': newRoomNotification, 'settings.preferences.newMessageNotification': newMessageNotification } });
});
}

if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const optOut = RocketChat.models.Settings.findOne({ _id: 'Statistics_opt_out' });
if (Settings) {
const optOut = Settings.findOne({ _id: 'Statistics_opt_out' });
if (optOut) {
RocketChat.models.Settings.remove({ _id: 'Statistics_opt_out' });
RocketChat.models.Settings.upsert({ _id: 'Statistics_reporting' }, {
Settings.remove({ _id: 'Statistics_opt_out' });
Settings.upsert({ _id: 'Statistics_reporting' }, {
$set: {
value: !optOut.value,
i18nDescription: 'Statistics_reporting_Description',
Expand All @@ -24,11 +27,11 @@ RocketChat.Migrations.add({
}
}

if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const favoriteRooms = RocketChat.models.Settings.findOne({ _id: 'Disable_Favorite_Rooms' });
if (Settings) {
const favoriteRooms = Settings.findOne({ _id: 'Disable_Favorite_Rooms' });
if (favoriteRooms) {
RocketChat.models.Settings.remove({ _id: 'Disable_Favorite_Rooms' });
RocketChat.models.Settings.upsert({ _id: 'Favorite_Rooms' }, {
Settings.remove({ _id: 'Disable_Favorite_Rooms' });
Settings.upsert({ _id: 'Favorite_Rooms' }, {
$set: {
value: !favoriteRooms.value,
i18nDescription: 'Favorite_Rooms_Description',
Expand Down
10 changes: 7 additions & 3 deletions server/startup/migrations/v045.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users } from 'meteor/rocketchat:models';
import { settings } from 'meteor/rocketchat:settings';

Migrations.add({
version: 45,
up() {

// finds the latest created visitor
const lastVisitor = RocketChat.models.Users.find({ type: 'visitor' }, { fields: { username: 1 }, sort: { createdAt: -1 }, limit: 1 }).fetch();
const lastVisitor = Users.find({ type: 'visitor' }, { fields: { username: 1 }, sort: { createdAt: -1 }, limit: 1 }).fetch();

if (lastVisitor && lastVisitor.length > 0) {
const lastNumber = lastVisitor[0].username.replace(/^guest\-/, '');

RocketChat.settings.add('Livechat_guest_count', (parseInt(lastNumber) + 1), { type: 'int', group: 'Livechat' });
settings.add('Livechat_guest_count', (parseInt(lastNumber) + 1), { type: 'int', group: 'Livechat' });
}
},
});
9 changes: 6 additions & 3 deletions server/startup/migrations/v046.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users } from 'meteor/rocketchat:models';

Migrations.add({
version: 46,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true });
if (Users) {
Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true });
}
},
});
17 changes: 10 additions & 7 deletions server/startup/migrations/v047.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Settings } from 'meteor/rocketchat:models';

Migrations.add({
version: 47,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const autolinkerUrls = RocketChat.models.Settings.findOne({ _id: 'AutoLinker_Urls' });
if (Settings) {
const autolinkerUrls = Settings.findOne({ _id: 'AutoLinker_Urls' });
if (autolinkerUrls) {
RocketChat.models.Settings.remove({ _id: 'AutoLinker_Urls' });
RocketChat.models.Settings.upsert({ _id: 'AutoLinker_Urls_Scheme' }, {
Settings.remove({ _id: 'AutoLinker_Urls' });
Settings.upsert({ _id: 'AutoLinker_Urls_Scheme' }, {
$set: {
value: !!autolinkerUrls.value,
i18nLabel: 'AutoLinker_Urls_Scheme',
},
});
RocketChat.models.Settings.upsert({ _id: 'AutoLinker_Urls_www' }, {
Settings.upsert({ _id: 'AutoLinker_Urls_www' }, {
$set: {
value: !!autolinkerUrls.value,
i18nLabel: 'AutoLinker_Urls_www',
},
});
RocketChat.models.Settings.upsert({ _id: 'AutoLinker_Urls_TLD' }, {
Settings.upsert({ _id: 'AutoLinker_Urls_TLD' }, {
$set: {
value: !!autolinkerUrls.value,
i18nLabel: 'AutoLinker_Urls_TLD',
Expand Down
19 changes: 11 additions & 8 deletions server/startup/migrations/v048.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Settings } from 'meteor/rocketchat:models';

Migrations.add({
version: 48,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
if (Settings) {

const RocketBot_Enabled = RocketChat.models.Settings.findOne({
const RocketBot_Enabled = Settings.findOne({
_id: 'RocketBot_Enabled',
});
if (RocketBot_Enabled) {
RocketChat.models.Settings.remove({
Settings.remove({
_id: 'RocketBot_Enabled',
});
RocketChat.models.Settings.upsert({
Settings.upsert({
_id: 'InternalHubot_Enabled',
}, {
$set: {
Expand All @@ -19,14 +22,14 @@ RocketChat.Migrations.add({
});
}

const RocketBot_Name = RocketChat.models.Settings.findOne({
const RocketBot_Name = Settings.findOne({
_id: 'RocketBot_Name',
});
if (RocketBot_Name) {
RocketChat.models.Settings.remove({
Settings.remove({
_id: 'RocketBot_Name',
});
RocketChat.models.Settings.upsert({
Settings.upsert({
_id: 'InternalHubot_Username',
}, {
$set: {
Expand Down
13 changes: 8 additions & 5 deletions server/startup/migrations/v049.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Rooms, Subscriptions, Settings } from 'meteor/rocketchat:models';

Migrations.add({
version: 49,
up() {

let count = 1;

RocketChat.models.Rooms.find({ t: 'l' }, { sort: { ts: 1 }, fields: { _id: 1 } }).forEach(function(room) {
RocketChat.models.Rooms.update({ _id: room._id }, { $set: { code: count } });
RocketChat.models.Subscriptions.update({ rid: room._id }, { $set: { code: count } }, { multi: true });
Rooms.find({ t: 'l' }, { sort: { ts: 1 }, fields: { _id: 1 } }).forEach(function(room) {
Rooms.update({ _id: room._id }, { $set: { code: count } });
Subscriptions.update({ rid: room._id }, { $set: { code: count } }, { multi: true });
count++;
});

RocketChat.models.Settings.upsert({ _id: 'Livechat_Room_Count' }, {
Settings.upsert({ _id: 'Livechat_Room_Count' }, {
$set: {
value: count,
type: 'int',
Expand Down
9 changes: 6 additions & 3 deletions server/startup/migrations/v050.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Subscriptions } from 'meteor/rocketchat:models';

Migrations.add({
version: 50,
up() {
RocketChat.models.Subscriptions.tryDropIndex('u._id_1_name_1_t_1');
RocketChat.models.Subscriptions.tryEnsureIndex({ 'u._id': 1, name: 1, t: 1 });
Subscriptions.tryDropIndex('u._id_1_name_1_t_1');
Subscriptions.tryEnsureIndex({ 'u._id': 1, name: 1, t: 1 });
},
});
13 changes: 8 additions & 5 deletions server/startup/migrations/v051.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users, Rooms, Subscriptions } from 'meteor/rocketchat:models';

Migrations.add({
version: 51,
up() {
RocketChat.models.Rooms.find({ t: 'l', 'v.token': { $exists: true }, label: { $exists: false } }).forEach(function(room) {
const user = RocketChat.models.Users.findOne({ 'profile.token': room.v.token });
Rooms.find({ t: 'l', 'v.token': { $exists: true }, label: { $exists: false } }).forEach(function(room) {
const user = Users.findOne({ 'profile.token': room.v.token });
if (user) {
RocketChat.models.Rooms.update({ _id: room._id }, {
Rooms.update({ _id: room._id }, {
$set: {
label: user.name || user.username,
'v._id': user._id,
},
});
RocketChat.models.Subscriptions.update({ rid: room._id }, {
Subscriptions.update({ rid: room._id }, {
$set: {
name: user.name || user.username,
},
Expand Down
7 changes: 5 additions & 2 deletions server/startup/migrations/v052.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users } from 'meteor/rocketchat:models';

Migrations.add({
version: 52,
up() {
RocketChat.models.Users.update({ _id: 'rocket.cat' }, { $addToSet: { roles: 'bot' } });
Users.update({ _id: 'rocket.cat' }, { $addToSet: { roles: 'bot' } });
},
});
9 changes: 6 additions & 3 deletions server/startup/migrations/v053.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Settings } from 'meteor/rocketchat:models';

Migrations.add({
version: 53,
up() {
RocketChat.models.Settings.update({ _id: 'Email_Header', value: '' }, {
Settings.update({ _id: 'Email_Header', value: '' }, {
$set: {
value: '<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#f3f3f3" style="color:#4a4a4a;font-family: Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;border-collapse:callapse;border-spacing:0;margin:0 auto"><tr><td style="padding:1em"><table border="0" cellspacing="0" cellpadding="0" align="center" width="100%" style="width:100%;margin:0 auto;max-width:800px"><tr><td bgcolor="#ffffff" style="background-color:#ffffff; border: 1px solid #DDD; font-size: 10pt; font-family: Helvetica,Arial,sans-serif;"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="background-color: #04436a;"><h1 style="font-family: Helvetica,Arial,sans-serif; padding: 0 1em; margin: 0; line-height: 70px; color: #FFF;">[Site_Name]</h1></td></tr><tr><td style="padding: 1em; font-size: 10pt; font-family: Helvetica,Arial,sans-serif;">',
},
});

RocketChat.models.Settings.update({ _id: 'Email_Footer', value: '' }, {
Settings.update({ _id: 'Email_Footer', value: '' }, {
$set: {
value: '</td></tr></table></td></tr><tr><td border="0" cellspacing="0" cellpadding="0" width="100%" style="font-family: Helvetica,Arial,sans-serif; max-width: 800px; margin: 0 auto; padding: 1.5em; text-align: center; font-size: 8pt; color: #999;">Powered by <a href="https://rocket.chat" target="_blank">Rocket.Chat</a></td></tr></table></td></tr></table>',
},
Expand Down
11 changes: 7 additions & 4 deletions server/startup/migrations/v054.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Users } from 'meteor/rocketchat:models';

Migrations.add({
version: 54,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
if (Users) {
// Set default message viewMode to 'normal' or 'cozy' depending on the users' current settings and remove the field 'compactView'
RocketChat.models.Users.update({ 'settings.preferences.compactView': true }, { $set: { 'settings.preferences.viewMode': 1 }, $unset: { 'settings.preferences.compactView': 1 } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.viewMode': { $ne: 1 } }, { $set: { 'settings.preferences.viewMode': 0 } }, { multi: true });
Users.update({ 'settings.preferences.compactView': true }, { $set: { 'settings.preferences.viewMode': 1 }, $unset: { 'settings.preferences.compactView': 1 } }, { multi: true });
Users.update({ 'settings.preferences.viewMode': { $ne: 1 } }, { $set: { 'settings.preferences.viewMode': 0 } }, { multi: true });
}
},
});
10 changes: 6 additions & 4 deletions server/startup/migrations/v055.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Migrations } from 'meteor/rocketchat:migrations';
import { Rooms, Messages } from 'meteor/rocketchat:models';
import s from 'underscore.string';

RocketChat.Migrations.add({
Migrations.add({
version: 55,
up() {
RocketChat.models.Rooms.find({ topic: { $exists: 1, $ne: '' } }, { topic: 1 }).forEach(function(room) {
Rooms.find({ topic: { $exists: 1, $ne: '' } }, { topic: 1 }).forEach(function(room) {
const topic = s.escapeHTML(room.topic);
RocketChat.models.Rooms.update({ _id: room._id }, { $set: { topic } });
RocketChat.models.Messages.update({ t: 'room_changed_topic', rid: room._id }, { $set: { msg: topic } });
Rooms.update({ _id: room._id }, { $set: { topic } });
Messages.update({ t: 'room_changed_topic', rid: room._id }, { $set: { msg: topic } });
});
},
});
11 changes: 7 additions & 4 deletions server/startup/migrations/v056.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
RocketChat.Migrations.add({
import { Migrations } from 'meteor/rocketchat:migrations';
import { Messages } from 'meteor/rocketchat:models';

Migrations.add({
version: 56,
up() {
RocketChat.models.Messages.find({ _id: /\./ }).forEach(function(message) {
Messages.find({ _id: /\./ }).forEach(function(message) {
const oldId = message._id;
message._id = message._id.replace(/(.*)\.S?(.*)/, 'slack-$1-$2');
RocketChat.models.Messages.insert(message);
RocketChat.models.Messages.remove({ _id: oldId });
Messages.insert(message);
Messages.remove({ _id: oldId });
});
},
});
Loading