forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request RocketChat#96 from bhardwajaditya/pwa_2
[EVO] Switch from persistent minimongo to cached collection
- Loading branch information
Showing
14 changed files
with
77 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,5 +97,4 @@ [email protected] | |
rocketchat:oauth2-server | ||
rocketchat:i18n | ||
|
||
frozeman:persistent-minimongo2 | ||
ground:db |
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 |
---|---|---|
|
@@ -45,7 +45,6 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
frozeman:[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Notifications } from '../../../app/notifications'; | ||
import { Users } from '../../../app/models'; | ||
import { getDefaultUserFields } from '../../../app/utils/server/functions/getDefaultUserFields'; | ||
|
||
Users.on('change', ({ clientAction, id, data }) => { | ||
switch (clientAction) { | ||
case 'inserted': | ||
data = Users.find({ _id: id }, { fields: getDefaultUserFields() }); | ||
break; | ||
|
||
case 'updated': | ||
// Override data cuz we do not publish all fields | ||
data = Users.find({ _id: id }, { fields: getDefaultUserFields() }); | ||
break; | ||
|
||
case 'removed': | ||
} | ||
Notifications.streamUser.__emit(data._id, clientAction, data); | ||
|
||
Notifications.notifyUserInThisInstance( | ||
data._id, | ||
'ownUser-changed', | ||
clientAction, | ||
data | ||
); | ||
}); |
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 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
|
||
import { Users } from '../../../app/models'; | ||
import { getDefaultUserFields } from '../../../app/utils/server/functions/getDefaultUserFields'; | ||
import './emitter'; | ||
|
||
Meteor.methods({ | ||
'ownUser/get'() { | ||
if (!Meteor.userId()) { | ||
return []; | ||
} | ||
|
||
const data = Users.find({ _id: Meteor.userId() }, { fields: getDefaultUserFields() }).fetch(); | ||
return data; | ||
}, | ||
}); |