Fixes notification issue
This commit is contained in:
parent
a4136c496e
commit
4ed8525e7e
|
@ -809,7 +809,7 @@ public abstract class BaseMainActivity extends AppCompatActivity
|
|||
});
|
||||
|
||||
|
||||
|
||||
// Asked once for notification opt-in
|
||||
boolean popupShown = sharedpreferences.getBoolean(Helper.SET_POPUP_PUSH, false);
|
||||
if(!popupShown){
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this);
|
||||
|
|
|
@ -57,7 +57,6 @@ public class RetrieveNotificationsAsyncTask extends AsyncTask<Void, Void, Void>
|
|||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
|
||||
API api = new API(this.contextReference.get(), instance, token);
|
||||
if( acct == null)
|
||||
apiResponse = api.getNotifications(max_id, display);
|
||||
|
|
|
@ -16,7 +16,6 @@ package fr.gouv.etalab.mastodon.client;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.loopj.android.http.AsyncHttpClient;
|
||||
|
@ -1222,8 +1221,8 @@ public class API {
|
|||
params.put("max_id", max_id);
|
||||
if( since_id != null )
|
||||
params.put("since_id", since_id);
|
||||
if( 0 > limit || limit > 40)
|
||||
limit = 40;
|
||||
if( 0 > limit || limit > 30)
|
||||
limit = 30;
|
||||
params.put("limit",String.valueOf(limit));
|
||||
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
|
|
@ -107,11 +107,10 @@ public class NotificationsSyncJob extends Job implements OnRetrieveNotifications
|
|||
//Check which notifications the user wants to see
|
||||
boolean notif_follow = sharedpreferences.getBoolean(Helper.SET_NOTIF_FOLLOW, true);
|
||||
boolean notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
|
||||
boolean notif_ask = sharedpreferences.getBoolean(Helper.SET_NOTIF_ASK, true);
|
||||
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
|
||||
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
|
||||
//User disagree with all notifications
|
||||
if( !notif_follow && !notif_add && !notif_ask && !notif_mention && !notif_share)
|
||||
if( !notif_follow && !notif_add && !notif_mention && !notif_share)
|
||||
return; //Nothing is done
|
||||
//No account connected, the service is stopped
|
||||
if(!Helper.isLoggedIn(getContext()))
|
||||
|
|
Loading…
Reference in New Issue