Automatically join a stored channel on INVITE
Some channels are typically protected with a legacy bot to which
a message is sent, causing the bot to send an INVITE to a channel,
which is invite-only.
Previously, a connect-command for sending a custom message to the
bot could be added, but there was no way to automatically accept
the invite.
This commit enables soju to automatically join a previously saved
channel when we receive an invite to it.
Examples:
- Joining #restricted, then getting disconnected from the upstream,
sending a message to the bot, receiving an invite and accepting it
- Joining #watercooler, getting kicked, then invited again after a
while
We eat the INVITE event so that we just transparently join the
channel without warning all downstreams.
Of course, of note is that we do *not* accept invites of
unknown/unsaved channels.
Thanks to eju for finding the issue and providing a first patch.