]> git.sesse.net Git - skvidarsync/commitdiff
Fix picking up the date from new messages.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 7 Dec 2023 13:26:08 +0000 (14:26 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 7 Dec 2023 13:26:08 +0000 (14:26 +0100)
Seemingly, the old code only worked for edits?

bin/ws.pl

index 0cf8e7b883bef8cdebf80d7c8f9f933570351816..c6746a84e3a6167241ff385eaaf42edd40523fc9 100644 (file)
--- 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'};