-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rocketchat-lib part1 #6553
rocketchat-lib part1 #6553
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
/* globals LoggerManager */ | ||
function log(fn = () => {}) { | ||
return typeof LoggerManager !== 'undefined' && fn(LoggerManager); | ||
} | ||
|
||
RocketChat.settings.get('Log_Package', function(key, value) { | ||
return (typeof LoggerManager !== 'undefined') && LoggerManager !== null && (LoggerManager.showPackage = value); | ||
return log(LoggerManager => LoggerManager.showPackage = value); | ||
}); | ||
|
||
RocketChat.settings.get('Log_File', function(key, value) { | ||
return typeof LoggerManager !== 'undefined' && LoggerManager !== null && (LoggerManager.showFileAndLine = value); | ||
return log(LoggerManager => LoggerManager.showFileAndLine = value); | ||
}); | ||
|
||
RocketChat.settings.get('Log_Level', function(key, value) { | ||
if (value != null) { | ||
if (typeof LoggerManager !== 'undefined' && LoggerManager !== null) { | ||
LoggerManager.logLevel = parseInt(value); | ||
} | ||
log(LoggerManager => LoggerManager.logLevel = parseInt(value)); | ||
Meteor.setTimeout(() => { | ||
return typeof LoggerManager !== 'undefined' && LoggerManager !== null && LoggerManager.enable(true); | ||
return log(LoggerManager => LoggerManager.enable(true)); | ||
}, 200); | ||
} | ||
}); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
// Insert server unique id if it doesn't exist | ||
RocketChat.settings.add('uniqueID', process.env.DEPLOYMENT_ID || Random.id(), { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you keep the comments? |
||
'public': true, | ||
hidden: true | ||
}); | ||
|
||
// When you define a setting and want to add a description, you don't need to automatically define the i18nDescription | ||
// if you add a node to the i18n.json with the same setting name but with `_Description` it will automatically work. | ||
|
||
RocketChat.settings.addGroup('Accounts', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you keep the comments? |
||
this.add('Accounts_AllowDeleteOwnAccount', false, { | ||
type: 'boolean', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
/* globals WebAppInternals*/ | ||
function testWebAppInternals(fn) { | ||
typeof WebAppInternals !== 'undefined' && fn(WebAppInternals); | ||
} | ||
RocketChat.settings.onload('CDN_PREFIX', function(key, value) { | ||
if (_.isString(value || false)) { | ||
return typeof WebAppInternals !== 'undefined' && WebAppInternals !== null && WebAppInternals.setBundledJsCssPrefix(value); | ||
return testWebAppInternals(WebAppInternals => WebAppInternals.setBundledJsCssPrefix(value)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not |
||
} | ||
}); | ||
|
||
Meteor.startup(function() { | ||
const value = RocketChat.settings.get('CDN_PREFIX'); | ||
if (_.isString(value || false)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any string value will be considered There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My wish was testing if the variable is a string or it is not an empty string. "asda"||false - > "asda" ""||false - > false because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, but that looks strange and will allow spaces. What about |
||
return typeof WebAppInternals !== 'undefined' && WebAppInternals !== null && WebAppInternals.setBundledJsCssPrefix(value); | ||
return testWebAppInternals(WebAppInternals => WebAppInternals.setBundledJsCssPrefix(value)); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
LoggerManager && LoggerManager.showPackage = value
?