Skip to content

Commit f6a1c2d

Browse files
committed
fix duplicate project
1 parent 37b9df3 commit f6a1c2d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

core/Services/CalDAV/CalDAVClient.vala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,17 @@ public class Services.CalDAV.CalDAVClient : Services.CalDAV.WebDAVClient {
459459
</d:mkcol>
460460
""".printf (project.name, project.color_hex);
461461
462-
var url = "%s/%s".printf (project.source.caldav_data.calendar_home_url, project.id);
462+
var calendar_url = GLib.Uri.resolve_relative (project.source.caldav_data.calendar_home_url, project.id, GLib.UriFlags.NONE);
463+
if (!calendar_url.has_suffix ("/")) {
464+
calendar_url += "/";
465+
}
463466
464467
HttpResponse response = new HttpResponse ();
465468
466469
try {
467-
yield send_request ("MKCOL", url, "application/xml", xml, null, null,
470+
yield send_request ("MKCOL", calendar_url, "application/xml", xml, null, null,
468471
{ Soup.Status.CREATED });
472+
project.calendar_url = calendar_url;
469473
response.status = true;
470474
} catch (Error e) {
471475
response.error_code = e.code;

src/Dialogs/Project.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ public class Dialogs.Project : Adw.Dialog {
436436
if (response.status) {
437437
Services.Store.instance ().insert_project (project);
438438
caldav_client.update_sync_token.begin (project, new GLib.Cancellable ());
439-
print ("%s\n".printf (project.to_string ()));
440439
go_project (project.id);
441440
} else {
442441
Services.EventBus.get_default ().send_error_toast (response.error_code, response.error);

0 commit comments

Comments
 (0)