getInstance returns optional
This commit is contained in:
@@ -259,13 +259,14 @@ public class TimelineDefinition {
|
||||
public boolean isCompatible(AccountSession session) {
|
||||
// still enabling the bubble timeline for all pleroma/akkoma instances since i know of
|
||||
// at least one instance that supports it, but doesn't list "bubble_timeline"
|
||||
return session.getInstance().isPleroma();
|
||||
return session.getInstance().map(Instance::isPleroma).orElse(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wantsDefault(AccountSession session) {
|
||||
Instance instance = session.getInstance();
|
||||
return instance.isPleroma() && instance.pleroma.metadata.features.contains("bubble_timeline");
|
||||
return session.getInstance()
|
||||
.map(i -> i.isPleroma() && i.pleroma.metadata.features.contains("bubble_timeline"))
|
||||
.orElse(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user