Skip to content

Commit a04e007

Browse files
committed
Add version check when removing colon
1 parent 6bcdaec commit a04e007

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

miniirc_matrix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def open(self, tag: str, **kwargs: Optional[str]) -> None:
9999
def set_colours(self, fg: Optional[str] = None,
100100
bg: Optional[str] = None) -> None:
101101
if fg is not None:
102-
self.fg = fg
102+
self.fg = fg or None
103103
if bg is not None:
104-
self.bg = bg
104+
self.bg = bg or None
105105

106106
if not self.fg and not self.bg:
107107
if 'span' in self.tags:
@@ -510,7 +510,7 @@ def __process_invite(self, room_id: str, room: dict[str, Any]) -> None:
510510
def quote(self, *msg: str, force: Optional[bool] = None,
511511
tags: Optional[dict[Any, Any]] = None) -> None:
512512
cmd, _, tags2, args = miniirc.ircv3_message_parser(' '.join(msg))
513-
if args and args[-1].startswith(':'):
513+
if miniirc.ver[0] < 2 and args and args[-1].startswith(':'):
514514
args[-1] = args[-1][1:]
515515
self.send(cmd, *args, force=force, tags=tags or tags2)
516516

0 commit comments

Comments
 (0)