readEncodedTalk :: (Int -> IO [Word8]) -> IO Word16 -> Inbound.Header -> Inbound.ChatExposure -> IO Inbound.InboundMessage
readEncodedTalk readBytes readShort header exposure =
  do
    let speaking = Inbound.messageRefNumber header

    -- header messageSize field is actually the message checksum + 1 ??
    fieldLength <- fromIntegral <$> readShort -- This is apparently the total length including these two bytes and the terminator
    obfuscated <- truncateChatMessage <$> init <$> readBytes (fieldLength - 2)
    let message = Illuminator.illuminate obfuscated
        chat = Inbound.Chat {
            Inbound.chatSpeaker = speaking
          , Inbound.chatRecipient = Nothing
          , Inbound.chatMessage = message
          , Inbound.chatExposure = exposure
          }
    return $ Inbound.ChatMessage chat

-- Chat string can't be > 254 characters long
-- OpenPalace carries along original message but unclear why it's needed
-- Even iptscrae shouldn't use what isn't displayed, no?
readEncodedTalk :: (Int -> IO [Word8]) -> IO Word16 -> Inbound.Header -> Inbound.ChatExposure -> IO Inbound.InboundMessage
readEncodedTalk readBytes readShort header exposure =
  do
    let speaking = Inbound.messageRefNumber header

    -- header messageSize field is actually the message checksum + 1 ??
    fieldLength <- fromIntegral <$> readShort -- This is apparently the total length including these two bytes and the terminator
    obfuscated <- truncateChatMessage <$> init <$> readBytes (fieldLength - 2)
    let message = Illuminator.illuminate obfuscated
        chat = Inbound.Chat {
            Inbound.chatSpeaker = speaking
          , Inbound.chatRecipient = Nothing
          , Inbound.chatMessage = message
          , Inbound.chatExposure = exposure
          }
    return $ Inbound.ChatMessage chat

-- Chat string can't be > 254 characters long
-- OpenPalace carries along original message but unclear why it's needed
-- Even iptscrae shouldn't use what isn't displayed, no?
readEncodedTalk readBytes readShort header exposure =
  do
    let speaking = Inbound.messageRefNumber header

    -- header messageSize field is actually the message checksum + 1 ??
    fieldLength <- fromIntegral <$> readShort -- This is apparently the total length including these two bytes and the terminator
    obfuscated <- truncateChatMessage <$> init <$> readBytes (fieldLength - 2)
    let message = Illuminator.illuminate obfuscated
        chat = Inbound.Chat {
            Inbound.chatSpeaker = speaking
          , Inbound.chatRecipient = Nothing
          , Inbound.chatMessage = message
          , Inbound.chatExposure = exposure
          }
    return $ Inbound.ChatMessage chat

-- Chat string can't be > 254 characters long
-- OpenPalace carries along original message but unclear why it's needed
-- Even iptscrae shouldn't use what isn't displayed, no?