Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bffd20fc authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Update /e/ account contacts and calendar sync URL, don't create a test account anymore

parent 8df12136
Loading
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -191,20 +191,8 @@ class EeloAuthenticatorFragment : Fragment(), AuthorizationService.TokenResponse
    override fun onTokenRequestCompleted(response: TokenResponse?, ex: AuthorizationException?) {
        authState?.update(response, ex)

        progress_bar.visibility = View.GONE
        successful_oauth_text_view.visibility = View.VISIBLE

        val account = Account("user1@e.email", getString(R.string.eelo_account_type))

        val userData = AccountSettings.initialUserData(Credentials("user1@e.email",
                null, AuthState(), null))

        val accountManager = AccountManager.get(activity)
        if (!accountManager.addAccountExplicitly(account, null, userData)) {
            Toast.makeText(context, "Failed to create test account", Toast.LENGTH_LONG).show()
        }
        else {
            Toast.makeText(context, "Successfully created test account", Toast.LENGTH_LONG).show()
        validateLoginData("user1", authState!!)?.let { info ->
            DetectConfigurationFragment.newInstance(info).show(fragmentManager, null)
        }

        // TODO Get the userId for future requests
@@ -361,7 +349,7 @@ class EeloAuthenticatorFragment : Fragment(), AuthorizationService.TokenResponse
    }

    private fun validateLoginData(emailAddress: String, authState: AuthState): LoginInfo? {
        val baseUrl = Uri.parse("https://apidata.googleusercontent.com/caldav/v2/$emailAddress/events")
        val baseUrl = Uri.parse("https://nc.test.eelo.io/remote.php/dav/")
        val uri = validateBaseUrl(baseUrl, false, { message ->
            view!!.urlpwd_base_url.error = message
        })
+0 −11
Original line number Diff line number Diff line
@@ -11,15 +11,4 @@
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

    <TextView
        android:id="@+id/successful_oauth_text_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textSize="16sp"
        android:visibility="gone"
        android:padding="16dp"
        android:gravity="center"
        android:text="Successfully received OAuth token. Contacts and calendar syncing is currently not supported for eelo accounts."/>

</RelativeLayout>
 No newline at end of file