-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add flag to enable monitoring, correct who can see network problems a…
…nd update logic
- Loading branch information
Joao Siebel
committed
May 9, 2019
1 parent
ae7c16f
commit fea22d5
Showing
10 changed files
with
125 additions
and
26 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
29 changes: 29 additions & 0 deletions
29
bigbluebutton-html5/imports/api/users/server/methods/userChangedSettings.js
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,29 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { check } from 'meteor/check'; | ||
import RedisPubSub from '/imports/startup/server/redis'; | ||
import setChangedSettings from '../modifiers/setChangedSettings'; | ||
|
||
export default function userChangedSettings(credentials, setting, value) { | ||
const REDIS_CONFIG = Meteor.settings.private.redis; | ||
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; | ||
const EVENT_NAME = 'UserChangedSettingsEvtMsg'; | ||
|
||
const { meetingId, requesterUserId } = credentials; | ||
|
||
if (!meetingId || !requesterUserId) return; | ||
|
||
check(meetingId, String); | ||
check(requesterUserId, String); | ||
check(setting, String); | ||
|
||
const payload = { | ||
meetingId, | ||
requesterUserId, | ||
setting, | ||
value, | ||
}; | ||
|
||
setChangedSettings(requesterUserId, setting, value); | ||
|
||
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); | ||
} |
30 changes: 30 additions & 0 deletions
30
bigbluebutton-html5/imports/api/users/server/modifiers/setChangedSettings.js
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,30 @@ | ||
import { check } from 'meteor/check'; | ||
import Users from '/imports/api/users'; | ||
import Logger from '/imports/startup/server/logger'; | ||
|
||
export default function setChangedSettings(userId, setting, value) { | ||
check(userId, String); | ||
check(setting, Match.Maybe(String)); | ||
|
||
const selector = { | ||
userId, | ||
}; | ||
|
||
const modifier = { | ||
$set: {}, | ||
}; | ||
|
||
modifier.$set[setting] = value; | ||
|
||
const cb = (err, numChanged) => { | ||
if (err) { | ||
Logger.error(`${err}`); | ||
} | ||
|
||
if (numChanged) { | ||
Logger.info(`Updated setting ${setting} to ${value} for user ${userId}`); | ||
} | ||
}; | ||
|
||
return Users.update(selector, modifier, cb); | ||
} |
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