Fixes potential crashes

This commit is contained in:
tom79 2017-08-29 16:48:28 +02:00
parent 71d533dadf
commit 120ce335fd
3 changed files with 2 additions and 5 deletions

View File

@ -314,6 +314,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
if(isAccountPrivate){
if( tootReply == null) {
visibility = "private";
toot_visibility.setImageResource(R.drawable.ic_action_lock_closed);
}else {
if( visibility.equals("direct") ){
toot_visibility.setImageResource(R.drawable.ic_local_post_office);

View File

@ -76,7 +76,7 @@ public class StreamingUserAsyncTask extends AsyncTask {
if( connectionHashMap.get(acct+userId) != null) {
try {
connectionAlive = (connectionHashMap.get(acct + userId).getResponseCode() == 200);
} catch (IOException e) {
} catch (Exception e) {
connectionAlive = false;
}
}

View File

@ -263,10 +263,6 @@ public class StreamingService extends Service implements OnRetrieveStreamingInte
//User receiving the notification is connected and application is to front, notification won't be pushed
//Instead, the interaction is done in the activity
if( activityVisible && isCurrentAccountLoggedIn(acct, userId)){
//If the owner published the toot we stop
if( event == StreamingUserAsyncTask.EventStreaming.UPDATE && account != null &&
status.getAccount().getAcct().trim().equals(acct.trim()) && status.getAccount().getId().trim().equals(userId.trim()))
return;
notify = false;
Intent intentBC = new Intent(Helper.RECEIVE_DATA);
intentBC.putExtra("eventStreaming", event);