doWhoReply :: Identifier -> ByteString -> ByteString -> IrcConnection -> Logic IrcConnection
doWhoReply nickname hostname flags conn =
  return $! updateUserRecord
              nickname
              (set usrAway away . updateHost)
              conn
  where
  away = not (B.null flags) && B.take 1 flags == "G"

  updateHost = set usrHost (Just hostname)

-- | Update an 'IrcConnection' with the quitting of a user.
doWhoReply :: Identifier -> ByteString -> ByteString -> IrcConnection -> Logic IrcConnection
doWhoReply nickname hostname flags conn =
  return $! updateUserRecord
              nickname
              (set usrAway away . updateHost)
              conn
  where
  away = not (B.null flags) && B.take 1 flags == "G"

  updateHost = set usrHost (Just hostname)

-- | Update an 'IrcConnection' with the quitting of a user.
doWhoReply nickname hostname flags conn =
  return $! updateUserRecord
              nickname
              (set usrAway away . updateHost)
              conn
  where
  away = not (B.null flags) && B.take 1 flags == "G"

  updateHost = set usrHost (Just hostname)

-- | Update an 'IrcConnection' with the quitting of a user.