Skip to content

Commit

Permalink
chore(merge-upstream): still 21 things to do
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGGamerM committed Feb 18, 2024
1 parent 76867a9 commit 64e82bd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class AccountLocalPreferences{
public ShowEmojiReactions showEmojiReactions;
public ColorPreference color;
public ArrayList<Emoji> recentCustomEmoji;
public boolean preReplySheet;

private final static Type recentLanguagesType=new TypeToken<ArrayList<String>>() {}.getType();
private final static Type timelinesType=new TypeToken<ArrayList<TimelineDefinition>>() {}.getType();
Expand All @@ -68,6 +69,7 @@ public AccountLocalPreferences(SharedPreferences prefs, AccountSession session){
revealCWs=prefs.getBoolean("revealCWs", false);
hideSensitiveMedia=prefs.getBoolean("hideSensitive", true);
serverSideFiltersSupported=prefs.getBoolean("serverSideFilters", false);
// preReplySheet=prefs.getBoolean("preReplySheet", false);

// MEGALODON
showReplies=prefs.getBoolean("showReplies", true);
Expand Down Expand Up @@ -112,6 +114,9 @@ public void save(){
.putBoolean("hideSensitive", hideSensitiveMedia)
.putBoolean("serverSideFilters", serverSideFiltersSupported)

//TODO figure this stuff out
// .putBoolean("preReplySheet", preReplySheet)

// MEGALODON
.putBoolean("showReplies", showReplies)
.putBoolean("showBoosts", showBoosts)
Expand Down Expand Up @@ -169,4 +174,9 @@ public enum ShowEmojiReactions{
ONLY_OPENED,
ALWAYS
}

// public enum PreReplySheetType{
// OLD_POST,
// NON_MUTUAL
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -1079,23 +1079,27 @@ public void rebuildAllDisplayItems(){
}

public void maybeShowPreReplySheet(Status status, Runnable proceed){
Relationship rel=getRelationship(status.account.id);
if(!GlobalUserPreferences.isOptedOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.NON_MUTUAL, status.account, accountID) &&
!status.account.id.equals(AccountSessionManager.get(accountID).self.id) && rel!=null && !rel.followedBy && status.account.followingCount>=1){
new NonMutualPreReplySheet(getActivity(), notAgain->{
GlobalUserPreferences.optOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.NON_MUTUAL, notAgain ? null : status.account, accountID);
proceed.run();
}, status.account, accountID).show();
}else if(!GlobalUserPreferences.isOptedOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.OLD_POST, null, null) &&
status.createdAt.isBefore(Instant.now().minus(90, ChronoUnit.DAYS))){
new OldPostPreReplySheet(getActivity(), notAgain->{
if(notAgain)
GlobalUserPreferences.optOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.OLD_POST, null, null);
proceed.run();
}, status).show();
}else{
proceed.run();
}
// TODO: figure this stuff out
// Relationship rel=getRelationship(status.account.id);
// if(!GlobalUserPreferences.isOptedOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.NON_MUTUAL, status.account, accountID) &&
// !status.account.id.equals(AccountSessionManager.get(accountID).self.id) && rel!=null && !rel.followedBy && status.account.followingCount>=1){
// new NonMutualPreReplySheet(getActivity(), notAgain->{
// GlobalUserPreferences.optOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.NON_MUTUAL, notAgain ? null : status.account, accountID);
// proceed.run();
// }, status.account, accountID).show();
// }else if(!GlobalUserPreferences.isOptedOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.OLD_POST, null, null) &&
// status.createdAt.isBefore(Instant.now().minus(90, ChronoUnit.DAYS))){
// new OldPostPreReplySheet(getActivity(), notAgain->{
// if(notAgain)
// GlobalUserPreferences.optOutOfPreReplySheet(GlobalUserPreferences.PreReplySheetType.OLD_POST, null, null);
// proceed.run();
// }, status).show();
// }else{
// proceed.run();
// }


proceed.run();
}

protected void onModifyItemViewHolder(BindableViewHolder<StatusDisplayItem> holder){}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void setStatus(Status status){
statusID=status.id;
boostBtn.setCompoundDrawablesWithIntrinsicBounds(0, switch(status.visibility){
case DIRECT -> R.drawable.ic_boost_disabled_24px;
case PUBLIC, UNLISTED -> R.drawable.ic_boost;
case PUBLIC, UNLISTED, LOCAL -> R.drawable.ic_boost;
case PRIVATE -> R.drawable.ic_boost_private;
}, 0, 0);
boostBtn.setEnabled(status.visibility!=StatusPrivacy.DIRECT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public ComposeLanguageAlertViewController(Context context, String preferred, Sel
int i=0;
boolean found=false;
for(SpecialLocaleInfo li:specialLocales){
if(null!=li.locale&&li.locale.equals(previouslySelected.locale)){
selectedLocale=li.locale;
if(null!=li.language&&li.language.equals(previouslySelected.language)){
selectedLocale=li.language;
selectedIndex=i;
found=true;
break;
Expand Down

0 comments on commit 64e82bd

Please sign in to comment.