aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-09-22 22:47:07 -0700
committerAllan Wang <me@allanwang.ca>2019-09-22 22:47:07 -0700
commit142b95f0ae82a849b1e9ef390a2a068b4c792be6 (patch)
tree10e7cfbca87fdc3ad904d5b0f38e493d088496e1 /app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers
parent981d6ffb409a501e6efcf4fe0cbe719e192beee7 (diff)
downloadfrost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.tar.gz
frost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.tar.bz2
frost-142b95f0ae82a849b1e9ef390a2a068b4c792be6.zip
Optimize imports and update changelog
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/MessageParser.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt4
2 files changed, 3 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 3705448a..f754b454 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
@@ -136,7 +136,7 @@ private class MessageParserImpl : FrostParserBase<FrostMessages>(true) {
val a = element.getElementsByTag("a").first() ?: return null
val abbr = element.getElementsByTag("abbr")
val epoch = FB_EPOCH_MATCHER.find(abbr.attr("data-store"))[1]?.toLongOrNull() ?: -1L
- //fetch id
+ // fetch id
val id = FB_MESSAGE_NOTIF_ID_MATCHER.find(element.id())[1]?.toLongOrNull()
?: System.currentTimeMillis() % FALLBACK_TIME_MOD
val snippet = element.select("span.snippet").firstOrNull()
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
index f9db0a8f..ab18172f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt
@@ -105,13 +105,13 @@ private class NotifParserImpl : FrostParserBase<FrostNotifs>(false) {
val a = element.getElementsByTag("a").first() ?: return null
val abbr = element.getElementsByTag("abbr")
val epoch = FB_EPOCH_MATCHER.find(abbr.attr("data-store"))[1]?.toLongOrNull() ?: -1L
- //fetch id
+ // fetch id
val id = FB_NOTIF_ID_MATCHER.find(element.id())[1]?.toLongOrNull()
?: System.currentTimeMillis() % FALLBACK_TIME_MOD
val img = element.getInnerImgStyle()
val timeString = abbr.text()
val content =
- a.text().replace("\u00a0", " ").removeSuffix(timeString).trim() //remove &nbsp;
+ a.text().replace("\u00a0", " ").removeSuffix(timeString).trim() // remove &nbsp;
val thumbnail = element.selectFirst("img.thumbnail")?.attr("src")
return FrostNotif(
id = id,