Skip to content

Add generic CalDAV

Will requested to merge wm-noble/gnome-online-accounts:master into master

This addresses issue #1 (closed) but does not implement CardDAV. That can be implemented separately.

Here's what I did to test it:

  • Ran, make, sudo make install, which wrote a bunch of object files to /usr/local/lib among other things.
  • Copied the following object files to /usr/lib:
  • Logged out and back into GNOME.

The option to add a CalDAV account shows up in the "Online Accounts" menu in gnome-control-center, as expected. I'm able to use the dialog to add the account, and it appears to be working at least mostly correctly, since it fails to connect when I enter the wrong credentials, but succeeds when I enter the correct ones. Once the account is added, however, I see nothing in the gnome-calendar app about it.

I was under the impression that goa_object_skeleton_attach_calendar() would pretty much do all the heavy integration lifting for me. Perhaps that was naive.

FWIW, here's the output of gdbus introspect:

$ gdbus introspect --session --dest=org.gnome.OnlineAccounts --object-path=/org/gnome/OnlineAccounts/Accounts/<my-goa-account-id>            
node /org/gnome/OnlineAccounts/Accounts/<my-goa-account-id> {
  interface org.freedesktop.DBus.Properties {
      Get(in  s interface_name,          
          in  s property_name,           
          out v value);                                                                                                                       
      GetAll(in  s interface_name,           
             out a{sv} properties);
      Set(in  s interface_name,       
          in  s property_name,           
          in  v value);                     
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties,
                        as invalidated_properties);
  interface org.freedesktop.DBus.Introspectable {
      Introspect(out s xml_data);          
  interface org.freedesktop.DBus.Peer {       
      GetMachineId(out s machine_uuid);
  interface org.gnome.OnlineAccounts.Account {
      EnsureCredentials(out i expires_in);
      readonly s ProviderType = 'caldav';
      readonly s ProviderName = 'CalDAV';
      readonly s ProviderIcon = '. GThemedIcon x-office-calendar-symbolic x-office-symbolic x-symbolic x-office-calendar x-office x';         
      readonly s Id = '<my-goa-account-id>';                                                                                                 
      readonly b IsLocked = false;
      readwrite b IsTemporary = false;
      readonly b AttentionNeeded = false;         
      readonly s Identity = '<my-caldav-login-id>';
      readonly s PresentationIdentity = '<my-caldav-login-id>';
      readwrite b MailDisabled = false;
      readwrite b CalendarDisabled = false;
      readwrite b ContactsDisabled = false;
      readwrite b ChatDisabled = false;
      readwrite b DocumentsDisabled = false;
      readwrite b MapsDisabled = false;
      readwrite b MusicDisabled = false;
      readwrite b PrintersDisabled = false;
      readwrite b PhotosDisabled = false;
      readwrite b FilesDisabled = false;
      readwrite b TicketingDisabled = false;
      readwrite b TodoDisabled = false;
      readwrite b ReadLaterDisabled = false;
  interface org.gnome.OnlineAccounts.PasswordBased {
      GetPassword(in  s id,
                  out s password);
  interface org.gnome.OnlineAccounts.Calendar {
      readonly b AcceptSslErrors = false;
      readonly s Uri = '<my-caldav-url>';                                                      

Everything appears to be in it's right place. Calling org.gnome.OnlineAccounts.PasswordBased.GetPassword returns the right password (btw, I did not need root privilege to access it in plaintext). The account simply does not integrate with any GNOME apps or show up anywhere outside of the "Online Accounts" window of the control center (where I can manipulate the settings or delete it perfectly fine). I've tried URL's that end in a trailing / as well as URL's that don't, and I've tried prepending the hostname with <username>@ as is standard for HTTP auth. No combination of obvious changes has worked to get the other GNOME apps to recognize it as a calendar.

This was loosely based off this old commit, though I found the code from the ownCloud provider to be a more valuable template as the calendar functionality appears to be based off CalDAV.

Edited by Will

Merge request reports