diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-28 23:53:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-28 23:53:40 -0700 |
commit | 73e16427879908e8b46b7c9fe1e87b0df838fa78 (patch) | |
tree | c3ae5a6890b0797110f397b99812362312c07ff6 /app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt | |
parent | 58309cfd62ed26f3cf5d2b1cb933f50078937a3a (diff) | |
parent | f5ae18fc0d824dbdce5523128f9ded86bdfa6d08 (diff) | |
download | frost-73e16427879908e8b46b7c9fe1e87b0df838fa78.tar.gz frost-73e16427879908e8b46b7c9fe1e87b0df838fa78.tar.bz2 frost-73e16427879908e8b46b7c9fe1e87b0df838fa78.zip |
Merge branch 'dev' into desktop-url-convert
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/parsers/NotifParser.kt | 5 |
1 files changed, 3 insertions, 2 deletions
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..af342d04 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 @@ -103,15 +103,16 @@ private class NotifParserImpl : FrostParserBase<FrostNotifs>(false) { private fun parseNotif(element: Element): FrostNotif? { val a = element.getElementsByTag("a").first() ?: return null + a.selectFirst("span.accessible_elem")?.remove() 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 + a.text().replace("\u00a0", " ").removeSuffix(timeString).trim() // remove val thumbnail = element.selectFirst("img.thumbnail")?.attr("src") return FrostNotif( id = id, |