aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/IRCLine.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/IRCLine.py b/src/IRCLine.py
index f713eecd..5aae1f53 100644
--- a/src/IRCLine.py
+++ b/src/IRCLine.py
@@ -111,13 +111,13 @@ class ParsedLine(object):
else:
return line
- def _line_max(self, hostmask: str) -> int:
- return LINE_MAX-len((":%s " % hostmask).encode("utf8"))
- def truncate(self, hostmask: str) -> typing.Tuple[str, str]:
+ def _line_max(self, hostmask: str, margin: int) -> int:
+ return LINE_MAX-len((":%s " % hostmask).encode("utf8"))-margin
+ def truncate(self, hostmask: str, margin: int=0) -> typing.Tuple[str, str]:
valid_bytes = b""
valid_index = -1
- line_max = self._line_max(hostmask)
+ line_max = self._line_max(hostmask, margin)
tags_formatted, line_formatted = self._format()
for i, char in enumerate(line_formatted):