Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All retrieved events are marked as transparent #298

Open
paulvt opened this issue Apr 26, 2023 · 0 comments
Open

All retrieved events are marked as transparent #298

paulvt opened this issue Apr 26, 2023 · 0 comments

Comments

@paulvt
Copy link

paulvt commented Apr 26, 2023

It seems that the Google Calendar API only mentions in event JSON when the event is actually transparent. If the event is opaque, it is not part of the event JSON.
However, then for the opaque events Event.new_from_feed passes nil as value to transparency= (via initialize) which will then default to it setting @transparency to "transparent" which is the wrong outcome.
As a result, all retrieved events are marked as transparent.

A solution would be to have initialize do:

self.transparency = params[:transparency] || "opaque"

Another solution would be to have new_from_feed not parse it as part of the standard list of params but have an explicit line:

params[:transparency] = e['transparency'] || "opaque"

I could not find in the docs whether it transparancy actually should default to "opaque" (the UI does). If this case, maybe event's transparency= could be adapted to use:

if val.nil? || val == false || val.to_s.downcase == 'opaque'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant