gameServer/Votes.hs
changeset 14117 d6915d15b6de
parent 13696 d732ca5dcab9
child 15983 2c92499daa67
equal deleted inserted replaced
14116:83bd383e6d11 14117:d6915d15b6de
    41     rm <- thisRoom
    41     rm <- thisRoom
    42     uid <- liftM clUID thisClient
    42     uid <- liftM clUID thisClient
    43 
    43 
    44     case voting rm of
    44     case voting rm of
    45         Nothing -> 
    45         Nothing -> 
    46             return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "There's no voting going on."]]
    46             return [Warning $ loc "There's no voting going on."]
    47         Just voting ->
    47         Just voting ->
    48             if (not forced) && (uid `L.notElem` entitledToVote voting) then
    48             if (not forced) && (uid `L.notElem` entitledToVote voting) then
    49                 return []
    49                 return []
    50             else if (not forced) && (uid `L.elem` map fst (votes voting)) then
    50             else if (not forced) && (uid `L.elem` map fst (votes voting)) then
    51                 return [AnswerClients [sendChan cl] ["CHAT", nickServer, loc "You already have voted."]]
    51                 return [Warning $ loc "You already have voted."]
    52             else if forced && (not $ isAdministrator cl) then
    52             else if forced && (not $ isAdministrator cl) then
    53                 return []
    53                 return []
    54             else
    54             else
    55                 ((:) (AnswerClients [sendChan cl] ["CHAT", nickServer, loc "Your vote has been counted."]))
    55                 ((:) (AnswerClients [sendChan cl] ["CHAT", nickServer, loc "Your vote has been counted."]))
    56                 <$> (actOnVoting $ voting{votes = (uid, vote):votes voting})
    56                 <$> (actOnVoting $ voting{votes = (uid, vote):votes voting})