X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bin%2Fws.pl;fp=bin%2Fws.pl;h=f3dd7bc77cf8b617ba6769ff2e35416661836dcb;hb=685af202f59969a7652c9b3de8a938c33f19aff6;hp=583ab38cd6e3802dd5146c029d7161f9db9479d2;hpb=6fe9f49ff7d15ae98a696b75d7609ceac3f3a94d;p=skvidarsync diff --git a/bin/ws.pl b/bin/ws.pl index 583ab38..f3dd7bc 100644 --- a/bin/ws.pl +++ b/bin/ws.pl @@ -121,7 +121,7 @@ sub handle_event { # TODO: What if edits happen out-of-order? my $date = $1; my $channel = $ev->{'channel'}; - my $ts = $ev->{'message'}{'ts'}; + my $ts = $ev->{'message'}{'ts'} // $ev->{'ts'}; print STDERR "Matching message {$channel, $ts} to date $date\n"; $dbh->do('INSERT INTO message_sheet_link (channel, ts, sheet_title) VALUES (?,?,?) ON CONFLICT (channel,ts) DO UPDATE SET sheet_title=EXCLUDED.sheet_title', undef, $channel, $ts, $date);