blue => 0,
alpha => 1
},
+ orange => {
+ red => 0xf9 / 255.0,
+ green => 0xcb / 255.0,
+ blue => 0x9c / 255.0,
+ alpha => 1
+ },
blue => {
red => 0,
green => 1,
sub create_reaction_log {
my ($dbh, $invitation_ts, $slack_userid_to_real_name, $slack_userid_to_slack_name) = @_;
- my $q = $dbh->prepare('select userid,event_type,reaction,to_char(event_ts,\'YYYY-mm-dd HH24:MI\') as event_ts from ( select distinct on (channel,ts,userid,reaction) userid,event_type,reaction,timestamptz \'1970-01-01 utc\' + event_ts::float * interval \'1 second\' as event_ts from reaction_log where channel=? and ts=? and reaction in (\'heart\',\'open_mouth\',\'blue_heart\') order by channel,ts,userid,reaction,event_ts desc ) t1 where event_ts > current_timestamp - interval \'8 hours\' order by event_ts desc limit 50');
+ my $q = $dbh->prepare('select userid,event_type,reaction,to_char(event_ts,\'YYYY-mm-dd HH24:MI\') as event_ts from ( select distinct on (channel,ts,userid,reaction) userid,event_type,reaction,timestamptz \'1970-01-01 utc\' + event_ts::float * interval \'1 second\' as event_ts from reaction_log where channel=? and ts=? and reaction in (\'heart\',\'open_mouth\',\'blue_heart\',\'orange_heart\') order by channel,ts,userid,reaction,event_ts desc ) t1 where event_ts > current_timestamp - interval \'8 hours\' order by event_ts desc limit 50');
$q->execute($config::invitation_channel, $invitation_ts);
my @recent_changes = ();
while (my $ref = $q->fetchrow_hashref) {
$msg .= '๐ฎ';
} elsif ($ref->{'reaction'} eq 'blue_heart') {
$msg .= '๐';
+ } elsif ($ref->{'reaction'} eq 'orange_heart') {
+ $msg .= '๐งก';
} else {
$msg .= 'โค๏ธ';
}
}
# Find everyone who are marked as attending on Slack (via reactions).
- $q = $dbh->prepare('SELECT DISTINCT userid,reaction FROM current_reactions WHERE channel=? AND ts=? AND reaction IN (\'heart\', \'open_mouth\', \'blue_heart\')');
+ $q = $dbh->prepare('SELECT DISTINCT userid,reaction FROM current_reactions WHERE channel=? AND ts=? AND reaction IN (\'heart\', \'open_mouth\', \'blue_heart\', \'orange_heart\')');
$q->execute($config::invitation_channel, $invitation_ts);
my @attending_userids = ();
my %colors = ();
my $userid = $ref->{'userid'};
push @attending_userids, $userid;
if ($ref->{'reaction'} eq 'blue_heart') {
- if (exists($colors{$userid}) && $colors{$userid} eq 'yellow') {
+ if (exists($colors{$userid}) && $colors{$userid} ne 'blue') {
$double{$userid} = 1;
}
$colors{$userid} = 'blue';
+ } elsif ($ref->{'reaction'} eq 'orange_heart') {
+ if (exists($colors{$userid}) && $colors{$userid} ne 'orange') {
+ $double{$userid} = 1;
+ }
+ $colors{$userid} = 'orange';
} else {
- if (exists($colors{$userid}) && $colors{$userid} eq 'blue') {
+ if (exists($colors{$userid}) && $colors{$userid} ne 'yellow') {
$double{$userid} = 1;
}
$colors{$userid} = 'yellow';