syncRaiseHand method

void syncRaiseHand(
  1. List<RaisedHand>? serverList
)

Implementation

void syncRaiseHand(List<RaisedHand>? serverList) {
  if (serverList == null) return;
  // clear existing state
  _raisedHandMap.clear();
  _raisedHandQueue.clear();

  // sort to ensure correct order (safety)
  serverList.sort((a, b) => a.timeStamp.compareTo(b.timeStamp));

  for (final item in serverList) {
    _raisedHandMap[item.identity] = true;
    _raisedHandQueue.add(item);
  }

  // update my hand state
  final localId = room.localParticipant?.identity ?? "";
  _isMyHandRaised = _raisedHandMap[localId] ?? false;

  notifyListeners();
}