public void InvitePageCompleted() { SyncingFolder = Path.GetFileName(PendingInvite.RemotePath); if (PendingInvite.RemotePath.EndsWith(".git")) { SyncingFolder = PendingInvite.RemotePath.Substring(0, PendingInvite.RemotePath.Length - 4); } SyncingFolder = SyncingFolder.Replace("-crypto", ""); SyncingFolder = SyncingFolder.Replace("_", " "); PreviousAddress = PendingInvite.Address; PreviousPath = PendingInvite.RemotePath; ChangePageEvent(PageType.Syncing, null); new Thread(() => { if (!PendingInvite.Accept(Program.Controller.CurrentUser.PublicKey)) { PreviousUrl = PendingInvite.Address + PendingInvite.RemotePath.TrimStart("/".ToCharArray()); ChangePageEvent(PageType.Error, new string [] { "error: Failed to upload the public key" }); return; } Program.Controller.FolderFetched += InvitePageFetchedDelegate; Program.Controller.FolderFetchError += InvitePageFetchErrorDelegate; Program.Controller.FolderFetching += SyncingPageFetchingDelegate; Program.Controller.StartFetcher(PendingInvite.Address, PendingInvite.Fingerprint, PendingInvite.RemotePath, PendingInvite.AnnouncementsUrl, false); // TODO: checkbox on invite page }).Start(); }
public void InvitePageCompleted() { SyncingFolder = Path.GetFileNameWithoutExtension(PendingInvite.RemotePath); PreviousAddress = PendingInvite.Address; PreviousPath = PendingInvite.RemotePath; if (ChangePageEvent != null) { ChangePageEvent(PageType.Syncing, null); } if (!PendingInvite.Accept()) { if (ChangePageEvent != null) { ChangePageEvent(PageType.Error, null); } return; } Program.Controller.FolderFetched += InvitePageFetchedDelegate; Program.Controller.FolderFetchError += InvitePageFetchErrorDelegate; Program.Controller.FolderFetching += SyncingPageFetchingDelegate; Program.Controller.StartFetcher(PendingInvite.Address, PendingInvite.Fingerprint, PendingInvite.RemotePath, PendingInvite.AnnouncementsUrl, false); // TODO: checkbox on invite page }
public void InvitePageCompleted() { SyncingFolder = Path.GetFileName(PendingInvite.RemotePath); if (PendingInvite.RemotePath.EndsWith(".git")) { SyncingFolder = PendingInvite.RemotePath.Substring(0, PendingInvite.RemotePath.Length - 4); } SyncingFolder = SyncingFolder.ReplaceUnderscoreWithSpace(); PreviousAddress = PendingInvite.Address; PreviousPath = PendingInvite.RemotePath; ChangePageEvent(PageType.Syncing, null); new Thread(() => { if (!PendingInvite.Accept(SparkleShare.Controller.UserAuthenticationInfo.PublicKey)) { PreviousUrl = PendingInvite.Address + PendingInvite.RemotePath.TrimStart("/".ToCharArray()); ChangePageEvent(PageType.Error, new string [] { "error: Failed to upload the public key" }); return; } SparkleShare.Controller.FolderFetched += InvitePageFetchedDelegate; SparkleShare.Controller.FolderFetchError += InvitePageFetchErrorDelegate; SparkleShare.Controller.FolderFetching += SyncingPageFetchingDelegate; SparkleFetcherInfo info = new SparkleFetcherInfo { Address = PendingInvite.Address, Fingerprint = PendingInvite.Fingerprint, RemotePath = PendingInvite.RemotePath, FetchPriorHistory = false, // TODO: checkbox on invite page AnnouncementsUrl = PendingInvite.AnnouncementsUrl }; SparkleShare.Controller.StartFetcher(info); }).Start(); }