From 5706373241445fc268df9c92ca16829ec948568f Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Fri, 29 Nov 2024 02:11:18 +0200 Subject: [PATCH] fix(Profile): only update fields that we care about --- src/API/Account.vala | 4 ++-- src/Views/Profile.vala | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/API/Account.vala b/src/API/Account.vala index f72ebbc2c..45120790d 100644 --- a/src/API/Account.vala +++ b/src/API/Account.vala @@ -12,10 +12,10 @@ public class Tuba.API.Account : Entity, Widgetizable, SearchResult { nickname */ public string display_name { set { - _display_name = value; + _display_name = value; } get { - return ( ( _display_name != null && _display_name.length > 0 ) ? _display_name : username ); + return (( _display_name != null && _display_name.length > 0 ) ? _display_name : username ); } } diff --git a/src/Views/Profile.vala b/src/Views/Profile.vala index d8b510c06..609eb3636 100644 --- a/src/Views/Profile.vala +++ b/src/Views/Profile.vala @@ -15,7 +15,21 @@ public class Tuba.Views.Profile : Views.Accounts { var parser = Network.get_parser_from_inputstream (req.response_body); var node = network.parse_node (parser); var updated = API.Account.from (node); - account.patch (updated); + + account.display_name = updated.display_name; + account.note = updated.note; + account.locked = updated.locked; + account.header = updated.header; + account.header_description = updated.header_description; + account.avatar = updated.avatar; + account.avatar_description = updated.avatar_description; + account.bot = updated.bot; + account.emojis = updated.emojis; + account.followers_count = updated.followers_count; + account.following_count = updated.following_count; + account.statuses_count = updated.statuses_count; + account.fields = updated.fields; + account.moved = updated.moved; return true; } catch (Error e) {