message_tag_escape() message-tag values when .format()ing IRCLine

This commit is contained in:
jesopo 2019-06-06 09:29:17 +01:00
parent d1a35fa18c
commit eb7d90bb00

View file

@ -1,5 +1,5 @@
import datetime, typing import datetime, typing
from src import IRCObject from src import IRCObject, utils
# this should be 510 (RFC1459, 512 with \r\n) but a server BitBot uses is broken # this should be 510 (RFC1459, 512 with \r\n) but a server BitBot uses is broken
LINE_CUTOFF = 470 LINE_CUTOFF = 470
@ -56,7 +56,8 @@ class ParsedLine(object):
tag_pieces = [] tag_pieces = []
for tag, value in tags.items(): for tag, value in tags.items():
if value: if value:
tag_pieces.append("%s=%s" % (tag, value)) value_escaped = utils.irc.message_tag_escape(value)
tag_pieces.append("%s=%s" % (tag, value_escaped))
else: else:
tag_pieces.append(tag) tag_pieces.append(tag)