Skip to content

Commit

Permalink
Accept empty strings as tag values
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Dec 8, 2024
1 parent d85a22e commit fa285a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions miniirc.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ def _escape_tag(tag):
# Convert a dict into an IRCv3 tags string
def _dict_to_tags(tags):
res = b'@'
for tag in tags:
if tags[tag]:
for tag, value in tags.items():
if value and value != '':
etag = _escape_tag(tag).replace('=', '-')
if isinstance(tags[tag], str):
etag += '=' + _escape_tag(tags[tag])
if value and isinstance(value, str):
etag += '=' + _escape_tag(value)
etag = (etag + ';').encode('utf-8')
if len(res) + len(etag) > 4094:
break
Expand Down

0 comments on commit fa285a7

Please sign in to comment.