Skip to content

Commit

Permalink
fix wrong time/username reference when replying
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Aug 27, 2023
1 parent 2fafdcc commit c3d9147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,11 @@ public void getOutline(View view, Outline outline){
? UiUtils.formatRelativeTimestamp(getContext(), status.createdAt)
: getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(getContext(), status.editedAt));

String sepp = getString(R.string.sk_separator);
String username = status.account.getDisplayUsername();
((TextView) view.findViewById(R.id.time_and_username)).setText(time == null ? username :
username + " " + sepp + " " + time);
((TextView) view.findViewById(R.id.username)).setText(status.account.getDisplayUsername());
view.findViewById(R.id.separator).setVisibility(time==null ? View.GONE : View.VISIBLE);
view.findViewById(R.id.time).setVisibility(time==null ? View.GONE : View.VISIBLE);
if(time!=null) ((TextView) view.findViewById(R.id.time)).setText(time);

if (status.spoilerText != null && !status.spoilerText.isBlank()) {
TextView replyToSpoiler = view.findViewById(R.id.reply_to_spoiler);
replyToSpoiler.setVisibility(View.VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void onBind(HeaderStatusDisplayItem item){
else if (item.status != null && item.status.editedAt != null)
time=item.parentFragment.getString(R.string.edited_timestamp, UiUtils.formatRelativeTimestamp(itemView.getContext(), item.status.editedAt));

this.username.setText("@" + item.user.acct);
this.username.setText(item.user.getDisplayUsername());
this.timeUsernameSeparator.setVisibility(time==null ? View.GONE : View.VISIBLE);
this.time.setVisibility(time==null ? View.GONE : View.VISIBLE);
if(time!=null) this.time.setText(time);
Expand Down

0 comments on commit c3d9147

Please sign in to comment.