-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Merged
+1,308
−511
Merged
rocketchat-lib part1 #6553
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
RocketChat.AdminBox = new class { | ||
constructor() { | ||
this.options = new ReactiveVar([]); | ||
} | ||
addOption(option) { | ||
return Tracker.nonreactive(() => { | ||
const actual = this.options.get(); | ||
actual.push(option); | ||
return this.options.set(actual); | ||
}); | ||
} | ||
getOptions() { | ||
return _.filter(this.options.get(), function(option) { | ||
if ((option.permissionGranted == null) || option.permissionGranted()) { | ||
return true; | ||
} | ||
}); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* globals LoggerManager */ | ||
RocketChat.settings.get('Log_Package', function(key, value) { | ||
return LoggerManager.showPackage = value; | ||
}); | ||
|
||
RocketChat.settings.get('Log_File', function(key, value) { | ||
return LoggerManager.showFileAndLine = value; | ||
}); | ||
|
||
RocketChat.settings.get('Log_Level', function(key, value) { | ||
if (value != null) { | ||
LoggerManager.logLevel = parseInt(value); | ||
Meteor.setTimeout(() => { | ||
return LoggerManager.enable(true); | ||
}, 200); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
/* | ||
* Kick off the global namespace for RocketChat. | ||
* @namespace RocketChat | ||
*/ | ||
RocketChat = { | ||
models: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
RocketChat.models.Reports = new class extends RocketChat.models._Base { | ||
constructor() { | ||
super('reports'); | ||
} | ||
createWithMessageDescriptionAndUserId(message, description, userId, extraData) { | ||
const record = { | ||
message, | ||
description, | ||
ts: new Date(), | ||
userId | ||
}; | ||
_.extend(record, extraData); | ||
record._id = this.insert(record); | ||
return record; | ||
} | ||
}; |
50 changes: 0 additions & 50 deletions
50
packages/rocketchat-lib/server/publications/settings.coffee
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Meteor.methods({ | ||
'public-settings/get'(updatedAt) { | ||
this.unblock(); | ||
const records = RocketChat.models.Settings.find().fetch().filter(function(record) { | ||
return record.hidden !== true && record['public'] === true; | ||
}); | ||
if (updatedAt instanceof Date) { | ||
return { | ||
update: records.filter(function(record) { | ||
return record._updatedAt > updatedAt; | ||
}), | ||
remove: RocketChat.models.Settings.trashFindDeletedAfter(updatedAt, { | ||
hidden: { | ||
$ne: true | ||
}, | ||
'public': true | ||
}, { | ||
fields: { | ||
_id: 1, | ||
_deletedAt: 1 | ||
} | ||
}).fetch() | ||
}; | ||
} | ||
return records; | ||
}, | ||
'private-settings/get'(updatedAt) { | ||
if (!Meteor.userId()) { | ||
return []; | ||
} | ||
this.unblock(); | ||
if (!RocketChat.authz.hasPermission(Meteor.userId(), 'view-privileged-setting')) { | ||
return []; | ||
} | ||
const records = RocketChat.models.Settings.find().fetch().filter(function(record) { | ||
return record.hidden !== true; | ||
}); | ||
if (updatedAt instanceof Date) { | ||
return { | ||
update: records.filter(function(record) { | ||
return record._updatedAt > updatedAt; | ||
}), | ||
remove: RocketChat.models.Settings.trashFindDeletedAfter(updatedAt, { | ||
hidden: { | ||
$ne: true | ||
} | ||
}, { | ||
fields: { | ||
_id: 1, | ||
_deletedAt: 1 | ||
} | ||
}).fetch() | ||
}; | ||
} | ||
return records; | ||
} | ||
}); | ||
|
||
RocketChat.models.Settings.cache.on('changed', function(type, setting) { | ||
if (setting['public'] === true) { | ||
RocketChat.Notifications.notifyAllInThisInstance('public-settings-changed', type, _.pick(setting, '_id', 'value')); | ||
} | ||
return RocketChat.Notifications.notifyLoggedInThisInstance('private-settings-changed', type, setting); | ||
}); | ||
|
||
RocketChat.Notifications.streamAll.allowRead('private-settings-changed', function() { | ||
if (this.userId == null) { | ||
return false; | ||
} | ||
return RocketChat.authz.hasPermission(this.userId, 'view-privileged-setting'); | ||
}); |
78 changes: 0 additions & 78 deletions
78
packages/rocketchat-lib/server/startup/oAuthServicesUpdate.coffee
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Where is the .coffee file?