Skip to content

Commit

Permalink
Support Out Of Office status
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kovalev (bkovalev) committed Jun 10, 2021
1 parent ff89162 commit 14c2509
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,15 @@ const BotUtils = {

getTeamMembersInfo(webexClient) {
const allUsers = BotUtils.listAllTeamMembers();
const notWorkingToday = [];

allUsers.forEach(user => {
const userDetails = webexClient.getUserDetails(user)
if (userDetails.status == 'DoNotDisturb') {
notWorkingToday.push({
user: user,
reason: "Do Not Disturb",
});
}
})
const notWorkingToday = {};

allUsers
.filter(user => webexClient.getUserDetails(user).status == 'OutOfOffice')
.forEach(user => notWorkingToday[user] = "Out Of Office")

return {
notWorkingToday: notWorkingToday,
workingToday: without(allUsers, notWorkingToday.map(u => u.user)),
workingToday: without(allUsers, Object.keys(notWorkingToday)),
notWorkingToday: Object.keys(notWorkingToday).map(user => ({user, reason: notWorkingToday[user]})),
};
},

Expand Down

0 comments on commit 14c2509

Please sign in to comment.