From 938e1db9631a89c2de526e1de21a55b1469da03d Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 19 Jun 2019 10:34:42 +0100 Subject: add `margin` arg to ParsedLine.truncate so commands/outs.py doesn't do it manually and cause potential issues with multi-byte chars --- modules/commands/outs.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/commands/outs.py b/modules/commands/outs.py index 067a872b..659774ba 100644 --- a/modules/commands/outs.py +++ b/modules/commands/outs.py @@ -44,13 +44,11 @@ class Out(object): if self._assured: line.assure() - valid, truncated = line.truncate(self.server.hostmask()) + valid, truncated = line.truncate(self.server.hostmask(), + margin=STR_MORE_LEN) if truncated: - truncated = valid[-STR_MORE_LEN:]+truncated - new_line = valid[:-STR_MORE_LEN]+STR_MORE - line = utils.irc.parse_line(new_line) - + line = utils.irc.parse_line(valid+STR_MORE) self._text = "%s%s" % (STR_CONTINUED, truncated) else: self._text = "" -- cgit v1.3.1-10-gc9f91