processMsg conn client Leave = do
  client' <- refreshClient conn client
  let r = clientRoomId client'
  case r of 
    Just x -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      r <- liftM makeUpdatedRoom $ findRoom conn x
      return $ [r $ ExitRoom $ tupClient client']
    Nothing -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      return $ []
processMsg conn client Leave = do
  client' <- refreshClient conn client
  let r = clientRoomId client'
  case r of 
    Just x -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      r <- liftM makeUpdatedRoom $ findRoom conn x
      return $ [r $ ExitRoom $ tupClient client']
    Nothing -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      return $ []
processMsg conn client Leave = do
  client' <- refreshClient conn client
  let r = clientRoomId client'
  case r of 
    Just x -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      r <- liftM makeUpdatedRoom $ findRoom conn x
      return $ [r $ ExitRoom $ tupClient client']
    Nothing -> do
      execute conn "update clients set room_id = null, exited = now() where client_id = ?" (Only $ clientId client')
      return $ []