diff --git a/SparkleShare/Linux/sparkleshare.in b/SparkleShare/Linux/sparkleshare.in index 46d5e7e3..a075609d 100755 --- a/SparkleShare/Linux/sparkleshare.in +++ b/SparkleShare/Linux/sparkleshare.in @@ -65,6 +65,7 @@ case $1 in invite=`date -u +%N` open=`echo $2 | sed 's/sparkleshare:\/\/addProject\///'` curl --insecure --output ~/SparkleShare/.$invite.xml $open + start ;; *) mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" --help diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index 2925286a..6ac1fba9 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -251,6 +251,7 @@ namespace SparkleShare { } else { new Thread (() => { + StartupInviteScan (); CheckRepositories (); RepositoriesLoaded = true; UpdateState (); @@ -440,6 +441,12 @@ namespace SparkleShare { } } + private void StartupInviteScan () + { + foreach (string invite in Directory.GetFiles (FoldersPath, "*.xml")) { + HandleInvite (invite); + } + } private void OnFolderActivity (object o, FileSystemEventArgs args) { @@ -461,6 +468,11 @@ namespace SparkleShare { private void HandleInvite (FileSystemEventArgs args) + { + HandleInvite (args.FullPath); + } + + private void HandleInvite (string path) { if (this.fetcher != null && this.fetcher.IsActive) { @@ -468,14 +480,14 @@ namespace SparkleShare { AlertNotificationRaised ("SparkleShare Setup seems busy", "Please wait for it to finish"); } else { - SparkleInvite invite = new SparkleInvite (args.FullPath); + SparkleInvite invite = new SparkleInvite (path); // It may be that the invite we received a path to isn't // fully downloaded yet, so we try to read it several times int tries = 0; while (!invite.IsValid) { Thread.Sleep (100); - invite = new SparkleInvite (args.FullPath); + invite = new SparkleInvite (path); tries++; if (tries > 10) { @@ -487,7 +499,7 @@ namespace SparkleShare { if (invite.IsValid) InviteReceived (invite); - File.Delete (args.FullPath); + File.Delete (path); } }