irc: ensure only privileged accounts may follow/unfollow

This commit is contained in:
William Pitcock 2018-08-17 19:56:18 -05:00
parent 3e446bc584
commit 94d4efbe11

View file

@ -123,6 +123,11 @@ class IRCProtocol(asyncio.Protocol):
elif 'whois' in action: elif 'whois' in action:
self.whois(nickname, action['whois'], account) self.whois(nickname, action['whois'], account)
elif 'follow' in action: elif 'follow' in action:
data = fetch_auth(account)
if not data:
return
if data not in IRC_CONFIG['privileged']:
return
logging.info('allowed follow: %r', action['follow']) logging.info('allowed follow: %r', action['follow'])
self.follow(nickname, action['follow']) self.follow(nickname, action['follow'])