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 autogen.sh, 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:
    libgoa-1.0.so
    libgoa-1.0.so.0
    libgoa-1.0.so.0.0.0
    libgoa-backend-1.0.so
    libgoa-backend-1.0.so.1
    libgoa-backend-1.0.so.1.0.0
  • 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 {
    methods:   
      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);                     
    signals:                                            
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties,
                        as invalidated_properties);
    properties:                        
  };                                        
  interface org.freedesktop.DBus.Introspectable {
    methods:                            
      Introspect(out s xml_data);          
    signals:                             
    properties:                         
  };                                        
  interface org.freedesktop.DBus.Peer {       
    methods:                           
      Ping();                               
      GetMachineId(out s machine_uuid);
    signals:                                        
    properties:
  };                       
  interface org.gnome.OnlineAccounts.Account {
    methods:
      Remove();
      EnsureCredentials(out i expires_in);
    signals:                                   
    properties:
      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;
      @org.freedesktop.DBus.Deprecated("true")
      readwrite b TodoDisabled = false;
      readwrite b ReadLaterDisabled = false;
  };
  interface org.gnome.OnlineAccounts.PasswordBased {
    methods:
      GetPassword(in  s id,
                  out s password);
    signals:
    properties:
  };
  interface org.gnome.OnlineAccounts.Calendar {
    methods:
    signals:
    properties:
      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