+ elif cmd.startswith("from"):
+ quotes = sum([self.quotedb.quotesfrom(a) for a in authors], [])
+ q = random.choice(quotes)
+ serv.privmsg(canal, q.display(show_context))
+ elif message.startswith(u"!search"):
+ words = message.split()
+ cmd = words[0].lstrip("!")
+ regexp = cmd in ["search" + suffix for suffix in config.regex_suffixes]
+ search = u" ".join(words[1:])
+ quotes = self.quotedb.search(inquote=search, regexp=regexp)
+ # On recherche également sur le contexte si on est en !context-search
+ if show_context:
+ quotes += self.quotedb.search(place=search, regexp=regexp)
+ # Pour pas biaiser le choix aléatoire, on enlève les doublons
+ quotes = list(set(quotes))
+ if quotes:
+ q = random.choice(quotes)
+ serv.privmsg(canal, q.display(show_context))