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

View file

@ -34,8 +34,7 @@ namespace SparkleShare {
public bool Valid {
get {
return (!string.IsNullOrEmpty (Address) &&
!string.IsNullOrEmpty (RemotePath) &&
!string.IsNullOrEmpty (AcceptUrl.ToString ()));
!string.IsNullOrEmpty (RemotePath));
}
}
@ -79,6 +78,9 @@ namespace SparkleShare {
public bool Accept ()
{
if (AcceptUrl == null)
return true;
try {
WebRequest request = WebRequest.Create (AcceptUrl);
@ -114,13 +116,7 @@ namespace SparkleShare {
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;
RemotePath = remote_path;
AcceptUrl = new Uri (accept_url);