3 Commits

Author SHA1 Message Date
41f5aef460 3.5.1 2020-04-16 21:43:48 +02:00
c121713a13 Merge pull request #54 from 67P/bugfix/ignore-small-meetings
Ignore meetings that have less than 3 unique participants
2020-04-16 21:17:16 +02:00
e10dd4abc3 Ignore meetings that have less than 3 unique participants
zoom's participants_count is not unique and the same person can be counted
multiple times.
We need to check for unique names.
2020-04-16 18:07:17 +02:00
3 changed files with 4 additions and 5 deletions

View File

@@ -69,14 +69,13 @@ module.exports = async function(robot, kredits) {
async function handleZoomMeetingEnded(data) {
const meetingDetails = await getMeetingDetails(data.uuid);
const participants = await getMeetingParticipants(data.uuid);
const names = Array.from(new Set(participants.map(p => p.name)));
if (meetingDetails.duration < 15 || meetingDetails.participants_count < 3) {
if (meetingDetails.duration < 15 || names.length < 3) {
robot.logger.info(`[hubot-kredits] Ignoring zoom call ${data.uuid} (duration: ${meetingDetails.duration}, participants_count: ${meetingDetails.participants_count})`);
return;
}
const names = Array.from(new Set(participants.map(p => p.name)));
for (const displayName of names) {
await createContributionFor(displayName, meetingDetails);
};

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "hubot-kredits",
"version": "3.5.0",
"version": "3.5.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "hubot-kredits",
"version": "3.5.0",
"version": "3.5.1",
"description": "Kosmos Kredits functionality for chat bots",
"main": "index.js",
"scripts": {