From: Steinar H. Gunderson Date: Thu, 7 Dec 2023 13:26:08 +0000 (+0100) Subject: Fix picking up the date from new messages. X-Git-Url: https://git.sesse.net/?p=skvidarsync;a=commitdiff_plain;h=20a638d8c60944723c746ff33dad7cc4f7314439 Fix picking up the date from new messages. Seemingly, the old code only worked for edits? --- diff --git a/bin/ws.pl b/bin/ws.pl index 0cf8e7b..c6746a8 100644 --- a/bin/ws.pl +++ b/bin/ws.pl @@ -117,7 +117,7 @@ sub handle_event { my $user = $ev->{'user'}; if ($type eq 'message') { - if ($ev->{'message'}{'text'} =~ /(20\d{2}-\d{2}-\d{2})/) { + if ($ev->{'text'} =~ /(20\d{2}-\d{2}-\d{2})/ || $ev->{'message'}{'text'} =~ /(20\d{2}-\d{2}-\d{2})/) { # TODO: What if edits happen out-of-order? my $date = $1; my $channel = $ev->{'channel'};