Skip to content

Commit

Permalink
Add version check when removing colon
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Feb 5, 2022
1 parent 6bcdaec commit a04e007
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miniirc_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def open(self, tag: str, **kwargs: Optional[str]) -> None:
def set_colours(self, fg: Optional[str] = None,
bg: Optional[str] = None) -> None:
if fg is not None:
self.fg = fg
self.fg = fg or None
if bg is not None:
self.bg = bg
self.bg = bg or None

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

Expand Down

0 comments on commit a04e007

Please sign in to comment.