aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/services
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-03-07 00:22:15 -0500
committerAllan Wang <me@allanwang.ca>2019-03-07 00:22:15 -0500
commitcf5fd28ec74069746b49757b6a95a36851a56105 (patch)
treee4eae77f78efb04b166c5821dfba2f6eafc333db /app/src/main/kotlin/com/pitchedapps/frost/services
parente96160d7f7cf45cdb8673928ac9e2fbca63002bd (diff)
downloadfrost-cf5fd28ec74069746b49757b6a95a36851a56105.tar.gz
frost-cf5fd28ec74069746b49757b6a95a36851a56105.tar.bz2
frost-cf5fd28ec74069746b49757b6a95a36851a56105.zip
Move legacy notif model to internal call
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
index 14b6ec39..631912a3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
@@ -33,8 +33,6 @@ import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.FrostWebActivity
import com.pitchedapps.frost.db.CookieEntity
import com.pitchedapps.frost.db.FrostDatabase
-import com.pitchedapps.frost.db.NotificationModel
-import com.pitchedapps.frost.db.lastNotificationTime
import com.pitchedapps.frost.db.latestEpoch
import com.pitchedapps.frost.db.saveNotifications
import com.pitchedapps.frost.enums.OverlayContext
@@ -67,8 +65,6 @@ enum class NotificationType(
private val overlayContext: OverlayContext,
private val fbItem: FbItem,
private val parser: FrostParser<ParseNotification>,
- // Legacy; remove with dbflow
- private val getTime: (notif: NotificationModel) -> Long,
private val ringtone: () -> String
) {
@@ -77,7 +73,6 @@ enum class NotificationType(
OverlayContext.NOTIFICATION,
FbItem.NOTIFICATIONS,
NotifParser,
- NotificationModel::epoch,
Prefs::notificationRingtone
) {
@@ -90,7 +85,6 @@ enum class NotificationType(
OverlayContext.MESSAGE,
FbItem.MESSAGES,
MessageParser,
- NotificationModel::epochIm,
Prefs::messageRingtone
);
@@ -140,8 +134,7 @@ enum class NotificationType(
if (notifContents.isEmpty()) return 0
val userId = data.id
// Legacy, remove with dbflow
- val prevLatestEpoch =
- notifDao.latestEpoch(userId, channelId).takeIf { it != -1L } ?: getTime(lastNotificationTime(userId))
+ val prevLatestEpoch = notifDao.latestEpoch(userId, channelId)
L.v { "Notif $name prev epoch $prevLatestEpoch" }
if (prevLatestEpoch == -1L && !BuildConfig.DEBUG) {
L.d { "Skipping first notification fetch" }