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

Add multiple account support #5

Closed
wants to merge 6 commits into from
Closed

Add multiple account support #5

wants to merge 6 commits into from

Conversation

telotortium
Copy link
Collaborator

The myuhe version of org-gcal.el doesn't allow calendars from multiple Google accounts to be synced in the same instance of Emacs, since only a single Google Calendar token can be held. @ayyjayess and @sattisvar have created patches to org-gcal.el that add such support, by turning org-gcal-token-plist into org-gcal-tokens-plist. I've been using this in my own repo for over half a year at this point and everything has worked seamlessly - I can sync my personal and work accounts into the same Emacs (in separate gcal.org files). I've merged these patches into the current master version of your repo, so they should be good to go.

@kidd
Copy link
Owner

kidd commented Jul 15, 2018

Hey!
That's great indeed! I had thought of wrapping mine into lets to do the multi-account trick, but if the mode can support it natively, even better.

I've tested it myself and seems to work great :)

Before merging it, I have a few questions though:

  1. Does it handle org-gcal-post-at-point and org-gcal-delete-at-point? I see code to make it work but there are questions on the other repo regarding that, so just to know it (not a user of that feature)

  2. There are some (message ....) here and there, are you ok with me cleaning it afterwards, or you prefer to clean that up yourself? . The same goes for some info in the readme talking about that as it's not obvious that one can get calendars from many different organisations even when you set up just one client_id and secret_token

@bobberb
Copy link

bobberb commented Jul 16, 2018

+1 thank you @telotortium for merging against @kidd !

@telotortium
Copy link
Collaborator Author

Hi @kidd:

  1. I don't know, I don't use that functionality either.
  2. You can clean it up afterwards.

@kidd kidd mentioned this pull request Jul 16, 2018
Closed
@kidd
Copy link
Owner

kidd commented Jul 16, 2018

So I tried it and *-at-point do not work properly. I'll take this branch from here and try to fix it.

For now it doesn't go into master yet :(.

@telotortium
Copy link
Collaborator Author

Yeah, it looks like there's no property containing the calendar ID of the calendar the event came from. One should probably be added. In the meantime, you can infer it from the gcal.org file where the event entry is found using org-gcal-file-alist.

@gciolli
Copy link

gciolli commented Jul 16, 2018

FYI I have just posted a fix to a similar problem in the parent repository:

myuhe#85

it supports multiple calendars, albeit from a single account (and a single token).
It's not really a restriction as one calendar can access others if they have appropriate sharing configuration.

@kidd
Copy link
Owner

kidd commented Jul 18, 2018

@gciolli, I think I like your fix better than having multiple tokens. also, multiple tokens made it slower as there's one token per calendar, not just per "owner".

When I have some time I'll merge your branch in, and we'll close this one.

Thanks everyone for your collaboration!

@kidd
Copy link
Owner

kidd commented Jul 20, 2018

I ended up merging #9 which solves the {delete,post}-at-point in a clean way.

The multiple accounts is a non-issue as one can give calendar permissions to another account via google calendar interface. I think it keeps the code nicer and it's faster.

Thanks all for bringing ideas and PRs.

@kidd kidd closed this Jul 20, 2018
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

Successfully merging this pull request may close these issues.

6 participants