fix: None.get error on change user Emoji
This commit is contained in:
parent
e25abf7e34
commit
c8668bcfe2
@ -29,32 +29,36 @@ trait ChangeUserEmojiCmdMsgHdlr extends RightsManagementTrait {
|
|||||||
msg.header.userId
|
msg.header.userId
|
||||||
)
|
)
|
||||||
|
|
||||||
val initialEmojiState = Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId).get.emoji
|
for {
|
||||||
val nextEmojiState = msg.body.emoji
|
user <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId)
|
||||||
|
} yield {
|
||||||
|
val initialEmojiState = user.emoji
|
||||||
|
val nextEmojiState = msg.body.emoji
|
||||||
|
|
||||||
if (isUserSettingOwnEmoji
|
if (isUserSettingOwnEmoji
|
||||||
|| isUserModerator && nextEmojiState.equals("none")
|
|| isUserModerator && nextEmojiState.equals("none")
|
||||||
|| isUserPresenter && initialEmojiState.equals("raiseHand") && nextEmojiState.equals("none")) {
|
|| isUserPresenter && initialEmojiState.equals("raiseHand") && nextEmojiState.equals("none")) {
|
||||||
for {
|
for {
|
||||||
uvo <- Users2x.setEmojiStatus(liveMeeting.users2x, msg.body.userId, msg.body.emoji)
|
uvo <- Users2x.setEmojiStatus(liveMeeting.users2x, msg.body.userId, msg.body.emoji)
|
||||||
} yield {
|
} yield {
|
||||||
outGW.send(MsgBuilder.buildUserEmojiChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji))
|
outGW.send(MsgBuilder.buildUserEmojiChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji))
|
||||||
|
|
||||||
|
if (initialEmojiState == "raiseHand" || nextEmojiState == "raiseHand") {
|
||||||
|
Users2x.setUserRaiseHand(liveMeeting.users2x, msg.body.userId, msg.body.emoji == "raiseHand")
|
||||||
|
outGW.send(MsgBuilder.buildUserRaiseHandChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji == "raiseHand"))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialEmojiState == "away" || nextEmojiState == "away") {
|
||||||
|
Users2x.setUserAway(liveMeeting.users2x, msg.body.userId, msg.body.emoji == "away")
|
||||||
|
outGW.send(MsgBuilder.buildUserAwayChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji == "away"))
|
||||||
|
}
|
||||||
|
|
||||||
if (initialEmojiState == "raiseHand" || nextEmojiState == "raiseHand") {
|
|
||||||
Users2x.setUserRaiseHand(liveMeeting.users2x, msg.body.userId, msg.body.emoji == "raiseHand")
|
|
||||||
outGW.send(MsgBuilder.buildUserRaiseHandChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji == "raiseHand"))
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (initialEmojiState == "away" || nextEmojiState == "away") {
|
val meetingId = liveMeeting.props.meetingProp.intId
|
||||||
Users2x.setUserAway(liveMeeting.users2x, msg.body.userId, msg.body.emoji == "away")
|
val reason = "No permission to clear change user emoji status."
|
||||||
outGW.send(MsgBuilder.buildUserAwayChangedEvtMsg(liveMeeting.props.meetingProp.intId, msg.body.userId, msg.body.emoji == "away"))
|
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
val meetingId = liveMeeting.props.meetingProp.intId
|
|
||||||
val reason = "No permission to clear change user emoji status."
|
|
||||||
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user