rejectPromotionRequest_ function

SpaceData rejectPromotionRequest_({
  1. required SpaceData data,
  2. required String promoteeAddress,
})

Implementation

SpaceData rejectPromotionRequest_(
    {required SpaceData data, required String promoteeAddress}) {
  isHost(
      hostAddress: data.spaceCreator,
      errorMessage: "Only host is allowed to reject a promotion request");

  data = setHandRaisedForListener(
      handRaised: false, listenerAddress: promoteeAddress, spaceData: data);

  // fire a meta message signaling that the 'affectedAddress' is not promoted
  sendLiveSpaceData(
      messageType: MessageType.META,
      updatedLiveSpaceData: data.liveSpaceData,
      content: CHAT.META_SPACE_LISTENER_REQUEST_MIC_REJECT,
      affectedAddresses: [promoteeAddress],
      spaceId: data.spaceId);

  return data;
}