Skip to content

Commit

Permalink
Remove identify_users
Browse files Browse the repository at this point in the history
I'm not 100% sure what this was doing. I think we don't need it anymore.
  • Loading branch information
bensimner committed Jun 30, 2018
1 parent 46a1afb commit 72f5f4f
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions csbot/plugins/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ def __init__(self, *args, **kwargs):
def quote_set(self, nick, channel, pattern=None):
""" Insert the last matching quote from a user on a particular channel into the quotes database.
"""
user = self.identify_user(nick, channel)

for q in self.channel_logs[channel]:
if nick == q.nick and channel == q.channel and message_matches(q.message, pattern=pattern):
self.insert_quote(q)
Expand Down Expand Up @@ -329,25 +327,9 @@ def log_privmsgs(self, e):

channel = e['channel']
user = nick(e['user'])
ident = self.identify_user(user, channel)
ident['message'] = msg
ident['nick'] = user # even for auth'd user, save their nick
quote = QuoteRecord(None, channel, user, msg)
self.channel_logs[channel].appendleft(quote)

def identify_user(self, nick, channel):
"""Identify a user: by account if authed, if not, by nick. Produces a dict
suitable for throwing at mongo."""

user = self.bot.plugins['usertrack'].get_user(nick)

if user['account'] is not None:
return {'account': user['account'],
'channel': channel}
else:
return {'nick': nick,
'channel': channel}

def message_matches(msg, pattern=None):
""" Check whether the given message matches the given pattern
Expand Down

0 comments on commit 72f5f4f

Please sign in to comment.