Quoting
This commit is contained in:
parent
f7dfebcbea
commit
53e8c0d2f4
4 changed files with 12 additions and 7 deletions
|
@ -289,7 +289,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist
|
|||
// descendant neighbor
|
||||
Optional
|
||||
.ofNullable(count > index + 1 ? statuses.get(index + 1) : null)
|
||||
.filter(s -> s.inReplyToId.equals(current.id))
|
||||
.filter(s -> s.inReplyToId!=null && s.inReplyToId.equals(current.id)) // inReplyToId is null for quote posts on Iceshrimp
|
||||
.orElse(null),
|
||||
// ancestoring neighbor
|
||||
Optional.ofNullable(index > 0 ? ancestry.get(index - 1) : null)
|
||||
|
|
|
@ -152,6 +152,10 @@ public class Instance extends BaseModel{
|
|||
return version.contains("compatible; Pixelfed");
|
||||
}
|
||||
|
||||
public boolean isIceshrimp() {
|
||||
return version.contains("compatible; Iceshrimp");
|
||||
}
|
||||
|
||||
public boolean hasFeature(Feature feature) {
|
||||
Optional<List<String>> pleromaFeatures = Optional.ofNullable(pleroma)
|
||||
.map(p -> p.metadata)
|
||||
|
|
|
@ -285,17 +285,16 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
|
|||
UiUtils.opacityIn(v);
|
||||
Bundle args=new Bundle();
|
||||
args.putString("account", item.accountID);
|
||||
AccountSession accountSession=AccountSessionManager.getInstance().getAccount(item.accountID);
|
||||
Instance instance=AccountSessionManager.getInstance().getInstanceInfo(accountSession.domain);
|
||||
if(instance.pleroma == null){
|
||||
Instance instance=AccountSessionManager.get(item.accountID).getInstance().get();
|
||||
if(instance.isAkkoma() || instance.isIceshrimp()){
|
||||
args.putParcelable("quote", Parcels.wrap(item.status));
|
||||
}else{
|
||||
StringBuilder prefilledText = new StringBuilder().append("\n\n");
|
||||
String ownID = AccountSessionManager.getInstance().getAccount(item.accountID).self.id;
|
||||
if (!item.status.account.id.equals(ownID)) prefilledText.append('@').append(item.status.account.acct).append(' ');
|
||||
prefilledText.append(item.status.url);
|
||||
args.putString("prefilledText", prefilledText.toString());
|
||||
args.putInt("selectionStart", 0);
|
||||
}else{
|
||||
args.putParcelable("quote", Parcels.wrap(item.status));
|
||||
}
|
||||
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
|
||||
});
|
||||
|
|
|
@ -247,7 +247,9 @@ public abstract class StatusDisplayItem{
|
|||
|
||||
if(statusForContent.quote!=null) {
|
||||
int quoteInlineIndex=statusForContent.content.lastIndexOf("<span class=\"quote-inline\"><br/><br/>RE:");
|
||||
if (quoteInlineIndex!=-1)
|
||||
if(quoteInlineIndex==-1)
|
||||
quoteInlineIndex=statusForContent.content.lastIndexOf("<span class=\"quote-inline\"><br><br>RE:");
|
||||
if(quoteInlineIndex!=-1)
|
||||
statusForContent.content=statusForContent.content.substring(0, quoteInlineIndex);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue