Fix some crashes
This commit is contained in:
parent
47519dedfd
commit
fde6bdcde6
|
@ -316,19 +316,6 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface,
|
|||
toot_emoji.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
switch (MainActivity.social){
|
||||
case GNU:
|
||||
toot_it.setText(getText(R.string.queet_it));
|
||||
break;
|
||||
case PLEROMA:
|
||||
toot_it.setText(getText(R.string.submit));
|
||||
break;
|
||||
case FRIENDICA:
|
||||
toot_it.setText(getText(R.string.share));
|
||||
break;
|
||||
default:
|
||||
toot_it.setText(getText(R.string.toot_it));
|
||||
}
|
||||
|
||||
drawer_layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
|
@ -405,6 +392,38 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface,
|
|||
else
|
||||
account = accountReply;
|
||||
|
||||
|
||||
if( MainActivity.social == null){
|
||||
|
||||
//Update the static variable which manages account type
|
||||
if( account.getSocial() == null || account.getSocial().equals("MASTODON"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.MASTODON;
|
||||
else if( account.getSocial().equals("PEERTUBE"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE;
|
||||
else if( account.getSocial().equals("PIXELFED"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED;
|
||||
else if( account.getSocial().equals("PLEROMA"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA;
|
||||
else if( account.getSocial().equals("GNU"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.GNU;
|
||||
else if( account.getSocial().equals("FRIENDICA"))
|
||||
MainActivity.social = UpdateAccountInfoAsyncTask.SOCIAL.FRIENDICA;
|
||||
}
|
||||
|
||||
switch (MainActivity.social){
|
||||
case GNU:
|
||||
toot_it.setText(getText(R.string.queet_it));
|
||||
break;
|
||||
case PLEROMA:
|
||||
toot_it.setText(getText(R.string.submit));
|
||||
break;
|
||||
case FRIENDICA:
|
||||
toot_it.setText(getText(R.string.share));
|
||||
break;
|
||||
default:
|
||||
toot_it.setText(getText(R.string.toot_it));
|
||||
}
|
||||
|
||||
if( tootReply != null) {
|
||||
tootReply();
|
||||
}else {
|
||||
|
|
|
@ -348,6 +348,10 @@ public class API {
|
|||
public Account verifyCredentials() {
|
||||
account = new Account();
|
||||
try {
|
||||
if( context == null) {
|
||||
setError(500, new Throwable("An error occured!"));
|
||||
return null;
|
||||
}
|
||||
String response = new HttpsConnection(context).get(getAbsoluteUrl("/accounts/verify_credentials"), 60, null, prefKeyOauthTokenT);
|
||||
account = parseAccountResponse(context, new JSONObject(response));
|
||||
if( account.getSocial().equals("PLEROMA")){
|
||||
|
|
Loading…
Reference in New Issue