diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java index 4bdff3791..eb56565f3 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/TwidereConstants.java @@ -147,6 +147,7 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst String QUERY_PARAM_VALUE_USERS = "users"; String QUERY_PARAM_VALUE_TWEETS = "tweets"; String QUERY_PARAM_SHOW_NOTIFICATION = "show_notification"; + String QUERY_PARAM_NOTIFY_CHANGE = "notify_change"; String QUERY_PARAM_LAT = "lat"; String QUERY_PARAM_LNG = "lng"; String QUERY_PARAM_URL = "url"; diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/provider/TwidereDataProvider.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/provider/TwidereDataProvider.kt index 7db929994..135be4e77 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/provider/TwidereDataProvider.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/provider/TwidereDataProvider.kt @@ -486,6 +486,7 @@ class TwidereDataProvider : ContentProvider(), LazyLoadCallback { } private fun notifyContentObserver(uri: Uri) { + if (!uri.getBooleanQueryParameter(QUERY_PARAM_NOTIFY_CHANGE, true)) return handler.post { context?.contentResolver?.notifyChange(uri, null) } diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetActivitiesTask.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetActivitiesTask.kt index e03d9f075..b8dfd4ccd 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetActivitiesTask.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetActivitiesTask.kt @@ -15,7 +15,7 @@ import org.mariotaku.microblog.library.twitter.model.ResponseList import org.mariotaku.sqliteqb.library.Expression import org.mariotaku.twidere.R import org.mariotaku.twidere.TwidereConstants.LOGTAG -import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_SHOW_NOTIFICATION +import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_NOTIFY_CHANGE import org.mariotaku.twidere.constant.loadItemLimitKey import org.mariotaku.twidere.extension.model.newMicroBlogInstance import org.mariotaku.twidere.model.AccountDetails @@ -161,7 +161,7 @@ abstract class GetActivitiesTask( olderCount = DataStoreUtils.getActivitiesCount(context, contentUri, minPositionKey, Activities.POSITION_KEY, false, arrayOf(details.key)) } - val writeUri = UriUtils.appendQueryParameters(contentUri, QUERY_PARAM_SHOW_NOTIFICATION, notify) + val writeUri = UriUtils.appendQueryParameters(contentUri, QUERY_PARAM_NOTIFY_CHANGE, notify) if (deleteBound[0] > 0 && deleteBound[1] > 0) { val where = Expression.and( Expression.equalsArgs(Activities.ACCOUNT_KEY), diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetStatusesTask.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetStatusesTask.kt index c2c6497c9..8a198ce38 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetStatusesTask.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/task/twitter/GetStatusesTask.kt @@ -19,7 +19,7 @@ import org.mariotaku.sqliteqb.library.Columns import org.mariotaku.sqliteqb.library.Expression import org.mariotaku.twidere.R import org.mariotaku.twidere.TwidereConstants.LOGTAG -import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_SHOW_NOTIFICATION +import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_NOTIFY_CHANGE import org.mariotaku.twidere.constant.loadItemLimitKey import org.mariotaku.twidere.extension.model.newMicroBlogInstance import org.mariotaku.twidere.model.AccountDetails @@ -151,7 +151,7 @@ abstract class GetStatusesTask( sinceSortId: Long, maxSortId: Long, loadItemLimit: Int, notify: Boolean): Int { val uri = contentUri - val writeUri = UriUtils.appendQueryParameters(uri, QUERY_PARAM_SHOW_NOTIFICATION, notify) + val writeUri = UriUtils.appendQueryParameters(uri, QUERY_PARAM_NOTIFY_CHANGE, notify) val resolver = context.contentResolver val noItemsBefore = DataStoreUtils.getStatusCount(context, uri, accountKey) <= 0 val values = arrayOfNulls(statuses.size)