setup controller: remove name/email guesses
This commit is contained in:
parent
e2c1bc1a0f
commit
a323575d5c
|
@ -623,10 +623,10 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public string GetAvatar (string email, int size)
|
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 &&
|
if (fetch_avatars_option != null &&
|
||||||
fetch_gravatars_option.Equals (bool.FalseString)) {
|
fetch_avatars_option.Equals (bool.FalseString)) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -634,9 +634,9 @@ namespace SparkleShare {
|
||||||
email = email.ToLower ();
|
email = email.ToLower ();
|
||||||
|
|
||||||
string avatars_path = new string [] { Path.GetDirectoryName (this.config.FullPath),
|
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 (File.Exists (avatar_file_path)) {
|
||||||
if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1))
|
if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1))
|
||||||
|
@ -658,7 +658,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
File.WriteAllBytes (avatar_file_path, buffer);
|
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;
|
return avatar_file_path;
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
public bool FetchPriorHistory {
|
||||||
get {
|
get {
|
||||||
return this.fetch_prior_history;
|
return this.fetch_prior_history;
|
||||||
|
@ -253,7 +238,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
new Thread (() => {
|
new Thread (() => {
|
||||||
string keys_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
|
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);
|
string [] key_pair = SparkleKeys.GenerateKeyPair (keys_path, key_file_name);
|
||||||
SparkleKeys.ImportPrivateKey (key_pair [0]);
|
SparkleKeys.ImportPrivateKey (key_pair [0]);
|
||||||
|
|
Loading…
Reference in a new issue