Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
isolate bi-directional text in display name
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Oct 16, 2023
1 parent 92d7ae6 commit 5840c94
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions mastodon/src/main/java/org/joinmastodon/android/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@
import androidx.annotation.Nullable;

import org.joinmastodon.android.api.ObjectValidationException;
import org.joinmastodon.android.api.RequiredField;
import org.joinmastodon.android.api.requests.instance.GetInstance;
import org.parceler.Parcel;

import java.time.Instant;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;

import me.grishka.appkit.api.Callback;
import me.grishka.appkit.api.ErrorResponse;

/**
* Represents a user of Mastodon and their associated profile.
*/
Expand Down Expand Up @@ -163,26 +158,27 @@ public void postprocess() throws ObjectValidationException{
if(fields!=null){
for(AccountField f:fields)
f.postprocess();
} else {
fields = Collections.emptyList();
}else{
fields=Collections.emptyList();
}
if(emojis!=null){
for(Emoji e:emojis)
e.postprocess();
} else {
emojis = Collections.emptyList();
}else{
emojis=Collections.emptyList();
}
if(moved!=null)
moved.postprocess();
if(fqn == null) fqn = getFullyQualifiedName();
if(id == null) id = "";
if(username == null) username = "";
if(fqn==null) fqn=getFullyQualifiedName();
if(id==null) id="";
if(username==null) username="";
if(TextUtils.isEmpty(displayName))
displayName = !TextUtils.isEmpty(username) ? username : "";
if(acct == null) acct = "";
if(url == null) url = "";
if(note == null) note = "";
if(avatar == null) avatar = "";
displayName=!TextUtils.isEmpty(username) ? username : "";
if(acct==null) acct="";
if(url==null) url="";
if(note==null) note="";
if(avatar==null) avatar="";
if(displayName!=null) displayName='\u2068'+displayName+'\u2069';
}

public boolean isLocal(){
Expand Down

0 comments on commit 5840c94

Please sign in to comment.