repo: don't show notifications for changes that you made yourself elsewhere

This commit is contained in:
Hylke Bons 2013-01-20 12:40:24 +00:00
parent 1875041f76
commit b5bf4a21b5
2 changed files with 8 additions and 15 deletions

View file

@ -386,7 +386,10 @@ namespace SparkleLib {
ChangeSets = GetChangeSets ();
if (!pre_sync_revision.Equals (CurrentRevision) && ChangeSets != null && ChangeSets.Count > 0) {
if (!pre_sync_revision.Equals (CurrentRevision) &&
ChangeSets != null && ChangeSets.Count > 0 &&
!ChangeSets [0].User.Name.Equals (this.local_config.User.Name)) {
bool emit_change_event = true;
foreach (SparkleChange change in ChangeSets [0].Changes) {

View file

@ -50,21 +50,11 @@ namespace SparkleLib {
case SparkleChangeType.Deleted: message = "deleted {0}"; break;
case SparkleChangeType.Moved: message = "moved {0}"; break;
}
if (Changes.Count == 1) {
return message = string.Format (message, Changes [0].Path);
} else if (Changes.Count > 1) {
message = string.Format (message, Changes [0].Path);
if ((Changes.Count - 1) == 1)
return string.Format (message + " and one other event", Changes.Count - 1);
else
return string.Format (message + " and {0} other events", Changes.Count - 1);
} else {
if (Changes.Count > 0)
return string.Format (message, Changes [0].Path);
else
return "did something magical";
}
}
}