Skip to content

Commit

Permalink
feat(bookings): expose next host email
Browse files Browse the repository at this point in the history
useful for some automations
  • Loading branch information
stakach committed Feb 27, 2025
1 parent 5e9920c commit 352765f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/place/bookings.cr
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,18 @@ class Place::Bookings < PlaceOS::Driver
booked = true
end
end

# don't display upcoming bookings if they are a long way off
self[:next_booking] = start_time < 10.hours.from_now.to_unix ? booking : nil
if start_time < 10.hours.from_now.to_unix
self[:next_booking] = booking
self[:next_host] = booking["extension_data"]?.try(&.[]?("host_override")) || booking["host"]?
else
self[:next_booking] = nil
self[:next_host] = nil
end
else
self[:next_booking] = nil
self[:next_host] = nil
end

self[:booked] = booked
Expand Down

0 comments on commit 352765f

Please sign in to comment.