]> git.sesse.net Git - skvidarsync/commitdiff
Simplification in event.pl.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Oct 2023 22:25:11 +0000 (00:25 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 28 Oct 2023 22:25:11 +0000 (00:25 +0200)
www/event.pl

index c99da216af9df343724de87f9a5a023d1b3ee62b..093754db5632a9ae83f8af1c0fbf3290deabbf91 100755 (executable)
@@ -73,11 +73,7 @@ if (exists($json->{'event'}) && exists($json->{'event'}{'type'})) {
                exit;
        }
 
-       if ($type eq 'reaction_added') {
-               $dbh->do('INSERT INTO reaction_log (userid, channel, ts, reaction, event_type, event_ts) VALUES (?,?,?,?,?,?)', undef,
-                       $user, $channel, $ts, $reaction, $type, $event_ts);
-               mark();
-       } elsif ($type eq 'reaction_removed') {
+       if ($type eq 'reaction_added' || $type eq 'reaction_removed') {
                $dbh->do('INSERT INTO reaction_log (userid, channel, ts, reaction, event_type, event_ts) VALUES (?,?,?,?,?,?)', undef,
                        $user, $channel, $ts, $reaction, $type, $event_ts);
                mark();