aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-17 15:32:57 -0700
committerAllan Wang <me@allanwang.ca>2017-06-17 15:32:57 -0700
commit377c96d36418fa1a5709df5ebf4ef87c9cef46c5 (patch)
treec96e9cad924e3fa9c803ba960e4f63ae7ba02d8b /app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt
parent125cd16f844a27722c947de8be04c4a885c8b6d4 (diff)
downloadfrost-377c96d36418fa1a5709df5ebf4ef87c9cef46c5.tar.gz
frost-377c96d36418fa1a5709df5ebf4ef87c9cef46c5.tar.bz2
frost-377c96d36418fa1a5709df5ebf4ef87c9cef46c5.zip
Add proper external link parsing
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt
index 28aadf21..85765541 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/NotificationService.kt
@@ -36,12 +36,12 @@ class NotificationService : IntentService(NotificationService::class.java.simple
L.i("Handling notifications for $id")
if (id == -1L) return
val data = loadFbCookie(id) ?: return
- L.i("Using data $data")
+ L.v("Using data $data")
val doc = Jsoup.connect(FbTab.NOTIFICATIONS.url).cookie(FACEBOOK_COM, data.cookie).get()
val unreadNotifications = doc.getElementById("notifications_list").getElementsByClass("aclb")
var notifCount = 0
var latestEpoch = lastNotificationTime(data.id)
- L.i("Latest Epoch $latestEpoch")
+ L.v("Latest Epoch $latestEpoch")
unreadNotifications.forEach {
elem ->
val notif = parseNotification(data, elem)
@@ -110,14 +110,4 @@ class NotificationService : IntentService(NotificationService::class.java.simple
NotificationManagerCompat.from(this).notify("frost_$userId", userId.toInt(), notifBuilder.build())
}
- private fun log(element: Element) {
- with(element) {
- L.i("\n\nElement ${text()}")
- attributes().forEach {
- L.i("attr ${it.html()}")
- }
- L.i("Content ${html()}")
- }
- }
-
} \ No newline at end of file