Allow invites without a accept_url element

This commit is contained in:
Hylke Bons 2012-02-19 01:16:44 +01:00
parent 1b2fb55aa4
commit 331c51b144
2 changed files with 6 additions and 10 deletions

View file

@ -155,6 +155,7 @@ namespace SparkleShare {
if (invite.Valid) { if (invite.Valid) {
InviteReceived (invite); InviteReceived (invite);
File.Delete (args.FullPath);
} else { } else {
if (AlertNotificationRaised != null) if (AlertNotificationRaised != null)
@ -162,7 +163,6 @@ namespace SparkleShare {
"This invite seems screwed up..."); "This invite seems screwed up...");
} }
File.Delete (args.FullPath);
} }
} }
}; };

View file

@ -34,8 +34,7 @@ namespace SparkleShare {
public bool Valid { public bool Valid {
get { get {
return (!string.IsNullOrEmpty (Address) && return (!string.IsNullOrEmpty (Address) &&
!string.IsNullOrEmpty (RemotePath) && !string.IsNullOrEmpty (RemotePath));
!string.IsNullOrEmpty (AcceptUrl.ToString ()));
} }
} }
@ -79,6 +78,9 @@ namespace SparkleShare {
public bool Accept () public bool Accept ()
{ {
if (AcceptUrl == null)
return true;
try { try {
WebRequest request = WebRequest.Create (AcceptUrl); WebRequest request = WebRequest.Create (AcceptUrl);
@ -114,13 +116,7 @@ namespace SparkleShare {
private void Initialize (string address, string remote_path, string accept_url) private void Initialize (string address, string remote_path, string accept_url)
{/* {
if (!remote_path.StartsWith ("/"))
remote_path = "/" + remote_path;
if (!address.EndsWith ("/"))
address = address + "/";
*/
Address = address; Address = address;
RemotePath = remote_path; RemotePath = remote_path;
AcceptUrl = new Uri (accept_url); AcceptUrl = new Uri (accept_url);