feat(secret): store updated account info
no point in keeping the initial display_name and avatar if the user has updated them
This commit is contained in:
parent
bb38f7ff0e
commit
8c908a05a7
|
@ -35,19 +35,23 @@ public class Tooth.SecretAccountStore : AccountStore {
|
|||
|
||||
secrets.foreach (item => {
|
||||
var account = secret_to_account (item);
|
||||
if (account != null) {
|
||||
new Request.GET (@"/api/v1/accounts/$(account.id)")
|
||||
.with_account (account)
|
||||
.then ((sess, msg) => {
|
||||
var node = network.parse_node (msg);
|
||||
var acc = API.Account.from (node);
|
||||
if (account != null && account.id != "") {
|
||||
new Request.GET (@"/api/v1/accounts/$(account.id)")
|
||||
.with_account (account)
|
||||
.then ((sess, msg) => {
|
||||
var node = network.parse_node (msg);
|
||||
var acc = API.Account.from (node);
|
||||
|
||||
account.display_name = acc.display_name;
|
||||
account.avatar = acc.avatar;
|
||||
})
|
||||
.exec ();
|
||||
saved.add (account);
|
||||
account.added ();
|
||||
if (account.display_name != acc.display_name || account.avatar != acc.avatar) {
|
||||
account.display_name = acc.display_name;
|
||||
account.avatar = acc.avatar;
|
||||
|
||||
account_to_secret (account);
|
||||
}
|
||||
})
|
||||
.exec ();
|
||||
saved.add (account);
|
||||
account.added ();
|
||||
}
|
||||
});
|
||||
changed (saved);
|
||||
|
|
Loading…
Reference in New Issue