setup controller: remove name/email guesses

This commit is contained in:
Hylke Bons 2012-07-27 13:57:11 +02:00
parent e2c1bc1a0f
commit a323575d5c
2 changed files with 7 additions and 22 deletions

View file

@ -623,10 +623,10 @@ namespace SparkleShare {
public string GetAvatar (string email, int size)
{
string fetch_gravatars_option = this.config.GetConfigOption ("fetch_avatars");
string fetch_avatars_option = this.config.GetConfigOption ("fetch_avatars");
if (fetch_gravatars_option != null &&
fetch_gravatars_option.Equals (bool.FalseString)) {
if (fetch_avatars_option != null &&
fetch_avatars_option.Equals (bool.FalseString)) {
return null;
}
@ -634,9 +634,9 @@ namespace SparkleShare {
email = email.ToLower ();
string avatars_path = new string [] { Path.GetDirectoryName (this.config.FullPath),
"icons", size + "x" + size, "status" }.Combine ();
"avatars", size + "x" + size }.Combine ();
string avatar_file_path = Path.Combine (avatars_path, "avatar-" + email);
string avatar_file_path = Path.Combine (avatars_path, SparkleHelpers.MD5 (email) + ".jpg");
if (File.Exists (avatar_file_path)) {
if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1))
@ -658,7 +658,7 @@ namespace SparkleShare {
}
File.WriteAllBytes (avatar_file_path, buffer);
SparkleHelpers.DebugInfo ("Controller", "Fetched " + size + "x" + size + " gravatar for " + email);
SparkleHelpers.DebugInfo ("Controller", "Fetched " + size + "x" + size + " avatar for " + email);
return avatar_file_path;

View file

@ -92,21 +92,6 @@ namespace SparkleShare {
}
}
public string GuessedUserName {
get {
return Program.Controller.CurrentUser.Name;
}
}
public string GuessedUserEmail {
get {
if (Program.Controller.CurrentUser.Email.Equals ("Unknown"))
return "";
else
return Program.Controller.CurrentUser.Email;
}
}
public bool FetchPriorHistory {
get {
return this.fetch_prior_history;
@ -253,7 +238,7 @@ namespace SparkleShare {
new Thread (() => {
string keys_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
string key_file_name = DateTime.Now.ToString ("YYYY-MM-dd HH\\hmm");
string key_file_name = DateTime.Now.ToString ("yyyy-MM-dd HH\\hmm");
string [] key_pair = SparkleKeys.GenerateKeyPair (keys_path, key_file_name);
SparkleKeys.ImportPrivateKey (key_pair [0]);