aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-09-27 20:15:11 -0400
committerAllan Wang <me@allanwang.ca>2018-09-27 20:15:11 -0400
commit2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2 (patch)
treeb0bfb3d1bede59bc6f54030c3b2ea51b3482ee28 /app/src/main/kotlin/com/pitchedapps/frost/facebook/requests
parent3aa44ba16e52ceaf37dd28a8075b302c42785526 (diff)
downloadfrost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.tar.gz
frost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.tar.bz2
frost-2e22f2ae6a963a2e00dc4b50b4a308c80ebe68e2.zip
Fix more lints
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/requests')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Notifications.kt2
2 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
index a4b0a347..500c4102 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
@@ -115,8 +115,8 @@ fun String.getAuth(): RequestAuth {
.url(FB_URL_BASE)
.get()
.call()
- call.execute().body()?.charStream()?.useLines {
- it.forEach {
+ call.execute().body()?.charStream()?.useLines { lines ->
+ lines.forEach {
val text = StringEscapeUtils.unescapeEcmaScript(it)
val fb_dtsg = FB_DTSG_MATCHER.find(text)[1]
if (fb_dtsg != null) {
@@ -153,8 +153,8 @@ inline fun <T, reified R : Any, O> Array<T>.zip(crossinline mapper: (List<R>) ->
fun executeForNoError(call: Call): Boolean {
val body = call.execute().body() ?: return false
var empty = true
- body.charStream().useLines {
- it.forEach {
+ body.charStream().useLines { lines ->
+ lines.forEach {
if (it.contains("error")) return false
if (empty && it.isNotEmpty()) empty = false
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Notifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Notifications.kt
index 82a9364b..0d3926dc 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Notifications.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/Notifications.kt
@@ -23,5 +23,5 @@ fun RequestAuth.markNotificationRead(notifId: Long): FrostRequest<Boolean> {
fun RequestAuth.markNotificationsRead(vararg notifId: Long) =
notifId.toTypedArray().zip<Long, Boolean, Boolean>(
- { it.all { it } },
+ { it.all { self -> self } },
{ markNotificationRead(it).invoke() }) \ No newline at end of file