Skip to content

Commit

Permalink
fix(Profile): only update fields that we care about
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Nov 29, 2024
1 parent c8ed010 commit 5706373
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/API/Account.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand Down
16 changes: 15 additions & 1 deletion src/Views/Profile.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5706373

Please sign in to comment.