meshy / framewirc

An IRC toolkit built upon Python 3's asyncio module
BSD 2-Clause "Simplified" License
35 stars 4 forks source link

Account for relay prefix when sending messages #31

Closed meshy closed 6 years ago

meshy commented 7 years ago

This allows for the relay prefix (AKA mask) that servers add to messages. Without this, messages might be silently dropped for being too long, even if they were short enough when transmitted.

We assume 100 chars for the messages will be enough, but we can control this if the true size of the mask is known.

To determine the true size of the mask, we handle PRIVMSG and NOTICE from ourselves, and replies to a /whois on ourselves (RPL_WHOISUSER). This is then cached on the Client object as mask_length.

Fixes #21. Needs to be manually tested before merging. Best reviewed one commit at a time.