Skip to content

Commit

Permalink
Merge pull request #38 from bigbluebutton/fix-raisehand-engagement
Browse files Browse the repository at this point in the history
 - fix engagement to handle the new in the event format
  • Loading branch information
ritzalam authored Mar 5, 2024
2 parents 7635e4e + 117d058 commit 2a6d1b9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/bbbevents/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,21 @@ def participant_status_change_event(e)
intUserId = e['userId']

return unless attendee = @attendees[@externalUserId[intUserId]]
status = e["value"]
status = e["status"]
status_value = e['value']

if attendee
if status == RAISEHAND
# Support new event format
if status == RAISEHAND && status_value == 'true'
# Count only raise hand event and not lower hand
attendee.engagement[:raisehand] += 1
elsif EMOJI_WHITELIST.include?(status)
elsif status == 'reactionEmoji' && status_value != 'none'
attendee.engagement[:emojis] += 1

# Support old event format
elsif status_value == RAISEHAND
attendee.engagement[:raisehand] += 1
elsif EMOJI_WHITELIST.include?(status_value)
attendee.engagement[:emojis] += 1
end
end
Expand Down

0 comments on commit 2a6d1b9

Please sign in to comment.