]> git.sesse.net Git - skvidarsync/commitdiff
Channel regex matching was too aggressive; fix.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 May 2024 19:06:17 +0000 (21:06 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 May 2024 19:06:17 +0000 (21:06 +0200)
bin/ws.pl

index 8dbfd14294916752b10e6ef90e617eb4c59676ea..8aa173337ce804ea6d32f22b5a85e9a3e863d4fa 100644 (file)
--- a/bin/ws.pl
+++ b/bin/ws.pl
@@ -148,7 +148,7 @@ sub handle_event {
 
        if ($type eq 'message') {
                my $text = $ev->{'text'} // $ev->{'message'}{'text'};
-               $text =~ s/<#[A-Z0-9]+|[^>]+>//g; #  Don't match dates in channel names.
+               $text =~ s/<[^>]+>//g; #  Don't match dates in channel names or URLs.
                if ($text =~ /(20\d{2}-\d{2}-\d{2})/) {
                        # TODO: What if edits happen out-of-order?
                        my $date = $1;