aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt18
1 files changed, 5 insertions, 13 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
index 47c0ecc4..2eb37ba4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbCookie.kt
@@ -23,6 +23,7 @@ import com.pitchedapps.frost.dbflow.CookieModel
import com.pitchedapps.frost.dbflow.loadFbCookie
import com.pitchedapps.frost.dbflow.removeCookie
import com.pitchedapps.frost.dbflow.saveFbCookie
+import com.pitchedapps.frost.facebook.FbCookie.webCookie
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.cookies
@@ -30,14 +31,18 @@ import com.pitchedapps.frost.utils.launchLogin
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.subjects.SingleSubject
+import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
+import kotlinx.coroutines.yield
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
/**
* Created by Allan Wang on 2017-05-30.
+ *
+ * The following component manages all cookie transfers.
*/
object FbCookie {
@@ -97,19 +102,6 @@ object FbCookie {
}
}
- operator fun invoke() {
- L.d { "FbCookie Invoke User" }
- val manager = CookieManager.getInstance()
- manager.setAcceptCookie(true)
- val dbCookie = loadFbCookie(Prefs.userId)?.cookie
- if (dbCookie != null && webCookie == null) {
- L.d { "DbCookie found & WebCookie is null; setting webcookie" }
- GlobalScope.launch(Dispatchers.Main) {
- manager.suspendSetWebCookie(dbCookie)
- }
- }
- }
-
fun save(id: Long) {
L.d { "New cookie found" }
Prefs.userId = id