lib: add a User object
This commit is contained in:
parent
68a90b1948
commit
1436477bad
|
@ -76,10 +76,18 @@ namespace SparkleLib {
|
||||||
|
|
||||||
public class SparkleNote {
|
public class SparkleNote {
|
||||||
|
|
||||||
public string UserName;
|
public SparkleUser User;
|
||||||
public string UserEmail;
|
|
||||||
|
|
||||||
public DateTime Timestamp;
|
public DateTime Timestamp;
|
||||||
public string Body;
|
public string Body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SparkleUser {
|
||||||
|
|
||||||
|
public string Name;
|
||||||
|
public string Email;
|
||||||
|
|
||||||
|
public string PublicKey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,8 +365,10 @@ namespace SparkleLib {
|
||||||
|
|
||||||
if (match_notes.Success) {
|
if (match_notes.Success) {
|
||||||
SparkleNote note = new SparkleNote () {
|
SparkleNote note = new SparkleNote () {
|
||||||
UserName = match_notes.Groups [1].Value,
|
User = new SparkleUser () {
|
||||||
UserEmail = match_notes.Groups [2].Value,
|
Name = match_notes.Groups [1].Value,
|
||||||
|
Email = match_notes.Groups [2].Value
|
||||||
|
},
|
||||||
Timestamp = new DateTime (1970, 1, 1).AddSeconds (int.Parse (match_notes.Groups [3].Value)),
|
Timestamp = new DateTime (1970, 1, 1).AddSeconds (int.Parse (match_notes.Groups [3].Value)),
|
||||||
Body = match_notes.Groups [4].Value
|
Body = match_notes.Groups [4].Value
|
||||||
};
|
};
|
||||||
|
@ -448,7 +450,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
bool note_added = false;
|
bool note_added = false;
|
||||||
foreach (string added in change_set.Added) {
|
foreach (string added in change_set.Added) {
|
||||||
if (added.StartsWith (".notes")) {
|
if (added.Contains (".notes")) {
|
||||||
if (NewNote != null)
|
if (NewNote != null)
|
||||||
NewNote (change_set.UserName, change_set.UserEmail);
|
NewNote (change_set.UserName, change_set.UserEmail);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue