Parsing through the various WHOIS replies to build a formatted string
isn't a trivial task, especially since there is some privacy related
information. Consolidate this handling into a single function so
there's one place to fix bugs.
Also fix an issue with people putting (unterminated) formatted text into
the "realname" field of their IRC client (c.f., ProgVal/Limnoria#1083).
Signed-off-by: James McCoy <vega.james@gmail.com>
The current message ("xyz isn't on any non-secret channels or is using a channel-list hiding umode.") is long and awkwardly worded.
This also removes an extra period from showing up at the end of the output.
Mention that it's possible that whoised user has channel list hiding
umode. This umode is usually +i, but I say "channel list hiding umode",
because +i is not always the umode which hides user list.
For example Quakenet always forces mode +i to every user and it cannot
be unset, but channel list is still visible. Some other IRCds can have
different modes to hide channel lists than +i.
The 319 message that indicates which channel(s) a user is in prefix the
channel name with the modes (@, +, !, etc.) applied to that user. These need
to be stripped from the channel name before we feed it to
irc.state.channels.get(), otherwise when irc.state.channels.get() returns None
we assume the channel can't be private and leak information.
Tons of changes. Here's the summary of things that matter most:
* There is no more supybot.fix.
* There is no more supybot.webutils; now there is supybot.utils.web.
* It's no longer webutils.WebError, but just utils.web.Error.
* You shouldn't import itertools, ideally, but instead import utils.iter.
* No more using imap/ifilter in commands unless absolutely necessary. It's
premature optimization and annoying.
* utils.str.format isn't quite ready yet, but will be soon. That'll be the
next big thing to fix in our code.