Skip to content

Commit 05546b4

Browse files
freshprinceflashcode
authored andcommitted
fish.py 0.13: handle message tags from ircv3
1 parent 8f017d7 commit 05546b4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎python/fish.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
SCRIPT_NAME = "fish"
6363
SCRIPT_AUTHOR = "David Flatz <david@upcs.at>"
64-
SCRIPT_VERSION = "0.12"
64+
SCRIPT_VERSION = "0.13"
6565
SCRIPT_LICENSE = "GPL3"
6666
SCRIPT_DESC = "FiSH for weechat"
6767
CONFIG_FILE_NAME = SCRIPT_NAME
@@ -579,7 +579,7 @@ def fish_modifier_in_notice_cb(data, modifier, server_name, string):
579579
return string
580580

581581
match = re.match(
582-
r"^(:(.*?)!.*? NOTICE (.*?) :)"
582+
r"^((?:@[^ ]* )?:(.*?)!.*? NOTICE (.*?) :)"
583583
r"((DH1080_INIT |DH1080_FINISH |\+OK |mcps )?.*)$",
584584
string)
585585
# match.group(0): message
@@ -673,7 +673,7 @@ def fish_modifier_in_privmsg_cb(data, modifier, server_name, string):
673673
return string
674674

675675
match = re.match(
676-
r"^(:(.*?)!.*? PRIVMSG (.*?) :)(\x01ACTION )?"
676+
r"^((?:@[^ ]* )?:(.*?)!.*? PRIVMSG (.*?) :)(\x01ACTION )?"
677677
r"((\+OK |mcps )?.*?)(\x01)?$",
678678
string)
679679
# match.group(0): message
@@ -737,7 +737,7 @@ def fish_modifier_in_topic_cb(data, modifier, server_name, string):
737737
if type(string) is bytes:
738738
return string
739739

740-
match = re.match(r"^(:.*?!.*? TOPIC (.*?) :)((\+OK |mcps )?.*)$", string)
740+
match = re.match(r"^((?:@[^ ]* )?:.*?!.*? TOPIC (.*?) :)((\+OK |mcps )?.*)$", string)
741741
# match.group(0): message
742742
# match.group(1): msg without payload
743743
# match.group(2): channel
@@ -782,7 +782,7 @@ def fish_modifier_in_332_cb(data, modifier, server_name, string):
782782
if type(string) is bytes:
783783
return string
784784

785-
match = re.match(r"^(:.*? 332 .*? (.*?) :)((\+OK |mcps )?.*)$", string)
785+
match = re.match(r"^((?:@[^ ]* )?:.*? 332 .*? (.*?) :)((\+OK |mcps )?.*)$", string)
786786
if not match:
787787
return string
788788

0 commit comments

Comments
 (0)