-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move rocketchat settings to specific package * WIP: Move models from rocketchat-lib to a specific package (server) * Move function from rocketchat:lib to rocketchat:utils to use it in rocketchat:models * Move client models from rocketchat:lib to rocketchat:models * Fix lint * Simplify model files * Fix wrong object assign
- Loading branch information
1 parent
4540085
commit c6ef5e7
Showing
31 changed files
with
247 additions
and
114 deletions.
There are no files selected for viewing
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 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 was deleted.
Oops, something went wrong.
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,11 @@ | ||
import { Avatars } from 'meteor/rocketchat:models'; | ||
import { Base as _Base } from 'meteor/rocketchat:models'; | ||
import { Uploads } from 'meteor/rocketchat:models'; | ||
import { UserDataFiles } from 'meteor/rocketchat:models'; | ||
|
||
Object.assign(RocketChat.models, { | ||
_Base, | ||
Avatars, | ||
Uploads, | ||
UserDataFiles, | ||
}); |
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 |
---|---|---|
@@ -1,31 +1,3 @@ | ||
RocketChat.getDefaultSubscriptionPref = function _getDefaultSubscriptionPref(userPref) { | ||
const subscription = {}; | ||
import { getDefaultSubscriptionPref } from 'meteor/rocketchat:utils'; | ||
|
||
const { | ||
desktopNotifications, | ||
mobileNotifications, | ||
emailNotificationMode, | ||
highlights, | ||
} = (userPref.settings && userPref.settings.preferences) || {}; | ||
|
||
if (Array.isArray(highlights) && highlights.length) { | ||
subscription.userHighlights = highlights; | ||
} | ||
|
||
if (desktopNotifications && desktopNotifications !== 'default') { | ||
subscription.desktopNotifications = desktopNotifications; | ||
subscription.desktopPrefOrigin = 'user'; | ||
} | ||
|
||
if (mobileNotifications && mobileNotifications !== 'default') { | ||
subscription.mobilePushNotifications = mobileNotifications; | ||
subscription.mobilePrefOrigin = 'user'; | ||
} | ||
|
||
if (emailNotificationMode && emailNotificationMode !== 'default') { | ||
subscription.emailNotifications = emailNotificationMode; | ||
subscription.emailPrefOrigin = 'user'; | ||
} | ||
|
||
return subscription; | ||
}; | ||
RocketChat.getDefaultSubscriptionPref = getDefaultSubscriptionPref; |
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 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,25 @@ | ||
import { Avatars } from 'meteor/rocketchat:models'; | ||
import { Base as _Base } from 'meteor/rocketchat:models'; | ||
import { ExportOperations } from 'meteor/rocketchat:models'; | ||
import { Messages } from 'meteor/rocketchat:models'; | ||
import { Reports } from 'meteor/rocketchat:models'; | ||
import { Rooms } from 'meteor/rocketchat:models'; | ||
import { Settings } from 'meteor/rocketchat:models'; | ||
import { Subscriptions } from 'meteor/rocketchat:models'; | ||
import { Uploads } from 'meteor/rocketchat:models'; | ||
import { UserDataFiles } from 'meteor/rocketchat:models'; | ||
import { Users } from 'meteor/rocketchat:models'; | ||
|
||
Object.assign(RocketChat.models, { | ||
_Base, | ||
Avatars, | ||
ExportOperations, | ||
Messages, | ||
Reports, | ||
Rooms, | ||
Settings, | ||
Subscriptions, | ||
Uploads, | ||
UserDataFiles, | ||
Users, | ||
}); |
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,11 @@ | ||
import { Base } from './models/_Base'; | ||
import Avatars from './models/Avatars'; | ||
import Uploads from './models/Uploads'; | ||
import UserDataFiles from './models/UserDataFiles'; | ||
|
||
export { | ||
Base, | ||
Avatars, | ||
Uploads, | ||
UserDataFiles, | ||
}; |
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,10 @@ | ||
import { Base } from './_Base'; | ||
|
||
export class Avatars extends Base { | ||
constructor() { | ||
super(); | ||
this._initModel('avatars'); | ||
} | ||
} | ||
|
||
export default new Avatars(); |
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,10 @@ | ||
import { Base } from './_Base'; | ||
|
||
export class Uploads extends Base { | ||
constructor() { | ||
super(); | ||
this._initModel('uploads'); | ||
} | ||
} | ||
|
||
export default new Uploads(); |
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,10 @@ | ||
import { Base } from './_Base'; | ||
|
||
export class UserDataFiles extends Base { | ||
constructor() { | ||
super(); | ||
this._initModel('userDataFiles'); | ||
} | ||
} | ||
|
||
export default new UserDataFiles(); |
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 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 @@ | ||
Package.describe({ | ||
name: 'rocketchat:models', | ||
summary: 'RocketChat Models', | ||
version: '1.0.0', | ||
git: '', | ||
}); | ||
|
||
Package.onUse(function(api) { | ||
api.use([ | ||
'ecmascript', | ||
'rocketchat:settings', | ||
'rocketchat:utils', | ||
'konecty:multiple-instances-status', | ||
]); | ||
api.mainModule('client/index.js', 'client'); | ||
api.mainModule('server/index.js', 'server'); | ||
}); |
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,27 @@ | ||
import { Base } from './models/_Base'; | ||
import { BaseDb } from './models/_BaseDb'; | ||
import Avatars from './models/Avatars'; | ||
import ExportOperations from './models/ExportOperations'; | ||
import Messages from './models/Messages'; | ||
import Reports from './models/Reports'; | ||
import Rooms from './models/Rooms'; | ||
import Settings from './models/Settings'; | ||
import Subscriptions from './models/Subscriptions'; | ||
import Uploads from './models/Uploads'; | ||
import UserDataFiles from './models/UserDataFiles'; | ||
import Users from './models/Users'; | ||
|
||
export { | ||
Base, | ||
BaseDb, | ||
Avatars, | ||
ExportOperations, | ||
Messages, | ||
Reports, | ||
Rooms, | ||
Settings, | ||
Subscriptions, | ||
Uploads, | ||
UserDataFiles, | ||
Users, | ||
}; |
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 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 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 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
Oops, something went wrong.