feat(profile): prepend pinned posts

This commit is contained in:
Evangelos Paterakis 2023-01-21 18:27:46 +02:00
parent ea4f976cf0
commit 1479b00980
No known key found for this signature in database
GPG Key ID: FE5185F095BFC8C9
1 changed files with 16 additions and 0 deletions

View File

@ -36,11 +36,27 @@ public class Tooth.Views.Profile : Views.Timeline {
is_profile: true,
url: @"/api/v1/accounts/$(acc.id)/statuses"
);
append_pinned(acc.id);
cover.bind (profile);
build_profile_stats(cover.info);
rs.invalidated.connect (on_rs_updated);
}
public void append_pinned(string acc_id) {
new Request.GET (@"/api/v1/accounts/$(acc_id)/statuses")
.with_account (account)
.with_param ("pinned", "true")
.with_ctx (this)
.then ((sess, msg) => {
Network.parse_array (msg, node => {
var e = entity_cache.lookup_or_insert (node, typeof (API.Status));
(e as API.Status).pinned = true;
model.append (e); //FIXME: use splice();
});
})
.exec ();
}
[GtkTemplate (ui = "/dev/geopjr/tooth/ui/views/profile_header.ui")]
protected class Cover : Box {