Fixes issue #300: Default post visibility for locked accounts
This commit is contained in:
parent
4c2237b371
commit
84fc31d2a4
|
@ -414,23 +414,9 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
||||||
if (!sharedUri.isEmpty()) {
|
if (!sharedUri.isEmpty()) {
|
||||||
uploadSharedImage(sharedUri);
|
uploadSharedImage(sharedUri);
|
||||||
}
|
}
|
||||||
String visibilityCheck = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
|
String defaultVisibility = account.isLocked()?"private":"public";
|
||||||
boolean isAccountPrivate = (account.isLocked() || visibilityCheck.equals("private"));
|
|
||||||
if(isAccountPrivate){
|
|
||||||
if( tootReply == null) {
|
|
||||||
visibility = "private";
|
|
||||||
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
|
|
||||||
}else {
|
|
||||||
if( visibility.equals("direct") ){
|
|
||||||
toot_visibility.setImageResource(R.drawable.ic_mail_outline_toot);
|
|
||||||
}else{
|
|
||||||
visibility = "private";
|
|
||||||
toot_visibility.setImageResource(R.drawable.ic_lock_outline_toot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if( tootReply == null){
|
if( tootReply == null){
|
||||||
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
|
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case "public":
|
case "public":
|
||||||
toot_visibility.setImageResource(R.drawable.ic_public_toot);
|
toot_visibility.setImageResource(R.drawable.ic_public_toot);
|
||||||
|
@ -446,7 +432,6 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
toot_sensitive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
toot_sensitive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
|
|
@ -434,8 +434,9 @@ public class SettingsFragment extends Fragment {
|
||||||
changeDrawableColor(context, set_toot_visibility, R.color.white);
|
changeDrawableColor(context, set_toot_visibility, R.color.white);
|
||||||
}
|
}
|
||||||
//Only displayed for non locked accounts
|
//Only displayed for non locked accounts
|
||||||
if (account != null && !account.isLocked()) {
|
if (account != null ) {
|
||||||
String tootVisibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), "public");
|
String defaultVisibility = account.isLocked()?"private":"public";
|
||||||
|
String tootVisibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
||||||
switch (tootVisibility) {
|
switch (tootVisibility) {
|
||||||
case "public":
|
case "public":
|
||||||
set_toot_visibility.setImageResource(R.drawable.ic_public);
|
set_toot_visibility.setImageResource(R.drawable.ic_public);
|
||||||
|
|
Loading…
Reference in New Issue