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