rocketchat:hubot -> rocketchat:internal-hubot RocketBot -> InternalHubot RocketBot_Name -> InternalHubot_Usernamepull/3038/head
parent
2910459e88
commit
5bcc8cb4fc
@ -1,3 +1,3 @@ |
||||
RocketChat.settings.addGroup 'RocketBot' |
||||
RocketChat.settings.add 'RocketBot_Enabled', true, { type: 'boolean', group: 'RocketBot' } |
||||
RocketChat.settings.add 'RocketBot_Name', 'Rocket.Cat', { type: 'string', group: 'RocketBot', i18nDescription: 'RocketBot_Name_Description' } |
||||
RocketChat.settings.addGroup 'InternalHubot' |
||||
RocketChat.settings.add 'InternalHubot_Enabled', true, { type: 'boolean', group: 'InternalHubot', i18nLabel: 'Enabled' } |
||||
RocketChat.settings.add 'InternalHubot_Username', 'Rocket.Cat', { type: 'string', group: 'InternalHubot', i18nLabel: 'Username', i18nDescription: 'InternalHubot_Username_Description' } |
||||
|
||||
@ -0,0 +1,40 @@ |
||||
RocketChat.Migrations.add({ |
||||
version: 48, |
||||
up: function() { |
||||
if (RocketChat && RocketChat.models && RocketChat.models.Settings) { |
||||
|
||||
var RocketBot_Enabled = RocketChat.models.Settings.findOne({ |
||||
_id: 'RocketBot_Enabled' |
||||
}); |
||||
if (RocketBot_Enabled) { |
||||
RocketChat.models.Settings.remove({ |
||||
_id: 'RocketBot_Enabled' |
||||
}); |
||||
RocketChat.models.Settings.upsert({ |
||||
_id: 'InternalHubot_Enabled' |
||||
}, { |
||||
$set: { |
||||
value: RocketBot_Enabled.value |
||||
} |
||||
}); |
||||
} |
||||
|
||||
var RocketBot_Name = RocketChat.models.Settings.findOne({ |
||||
_id: 'RocketBot_Name' |
||||
}); |
||||
if (RocketBot_Name) { |
||||
RocketChat.models.Settings.remove({ |
||||
_id: 'RocketBot_Name' |
||||
}); |
||||
RocketChat.models.Settings.upsert({ |
||||
_id: 'InternalHubot_Username' |
||||
}, { |
||||
$set: { |
||||
value: RocketBot_Name.value |
||||
} |
||||
}); |
||||
} |
||||
|
||||
} |
||||
} |
||||
}); |
||||
Loading…
Reference in new issue