aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
index f05c42e9..00a1432f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt
@@ -16,7 +16,7 @@
*/
package com.pitchedapps.frost.facebook.parsers
-import com.pitchedapps.frost.dbflow.CookieModel
+import com.pitchedapps.frost.db.CookieEntity
import com.pitchedapps.frost.facebook.FB_EPOCH_MATCHER
import com.pitchedapps.frost.facebook.FB_MESSAGE_NOTIF_ID_MATCHER
import com.pitchedapps.frost.facebook.FbItem
@@ -46,6 +46,10 @@ data class FrostMessages(
val seeMore: FrostLink?,
val extraLinks: List<FrostLink>
) : ParseNotification {
+
+ override val isEmpty: Boolean
+ get() = threads.isEmpty()
+
override fun toString() = StringBuilder().apply {
append("FrostMessages {\n")
append(threads.toJsonString("threads", 1))
@@ -54,7 +58,7 @@ data class FrostMessages(
append("}")
}.toString()
- override fun getUnreadNotifications(data: CookieModel) =
+ override fun getUnreadNotifications(data: CookieEntity) =
threads.asSequence().filter(FrostThread::unread).map {
with(it) {
NotificationContent(
@@ -64,7 +68,8 @@ data class FrostMessages(
title = title,
text = content ?: "",
timestamp = time,
- profileUrl = img
+ profileUrl = img,
+ unread = unread
)
}
}.toList()