Ensure multiline message after line_treat are collapsed to one line

This commit is contained in:
nemunaire 2014-09-24 10:53:16 +02:00
parent acded35e1a
commit cdaad47b13
2 changed files with 2 additions and 1 deletions

View File

@ -80,6 +80,7 @@ def cmd_mediawiki(msg):
raise IRCException("indicate a domain and a term to search")
return Response(get_page(msg.cmds[1], " ".join(msg.cmds[2:])),
line_treat=lambda line: irc_format(parse_wikitext(msg.cmds[1], line)),
channel=msg.receivers)

View File

@ -130,7 +130,7 @@ class Response:
return self.treat_ctcp(self.nomore)
if self.line_treat is not None and self.elt == 0:
self.messages[0] = self.line_treat(self.messages[0])
self.messages[0] = self.line_treat(self.messages[0]).replace("\n", " ").strip()
msg = ""
if self.channel is not None and self.nick is not None: