The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/migrations/v112.js

25 lines
810 B

RocketChat.Migrations.add({
version: 112,
up() {
if (RocketChat && RocketChat.models) {
if (RocketChat.models.Settings) {
const setting = RocketChat.models.Settings.findOne({ _id: 'Accounts_Default_User_Preferences_idleTimeoutLimit' });
if (setting && setting.value) {
RocketChat.models.Settings.update(
{ _id: 'Accounts_Default_User_Preferences_idleTimeoutLimit' },
{ $set: { value: setting.value / 1000 } }
);
}
}
if (RocketChat.models.Users) {
RocketChat.models.Users.find({ 'settings.preferences.idleTimeLimit': { $exists: 1 } }).forEach(function(user) {
RocketChat.models.Users.update(
{ _id: user._id },
{ $set: { 'settings.preferences.idleTimeLimit': user.settings.preferences.idleTimeLimit / 1000 } }
);
});
}
}
}
});