♿ Optimize end call logic
This commit is contained in:
parent
5b2fa00b1e
commit
b3fe2c2163
@ -111,8 +111,8 @@ func endCall(c *fiber.Ctx) error {
|
||||
call, err := services.GetOngoingCall(channel)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||
} else if call.FounderID != user.ID && channel.AccountID != user.ID {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "only call founder or channel owner can end this call")
|
||||
} else if call.FounderID != user.ID && membership.PowerLevel < 100 {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "only call founder or channel admin can end this call")
|
||||
}
|
||||
|
||||
if call, err := services.EndCall(call); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user