wip: Migrate to Trixnity
This commit is contained in:
@@ -16,22 +16,6 @@ import ru.risdeveau.pixeldragon.util.getRoomStore
|
||||
import splitties.experimental.ExperimentalSplittiesApi
|
||||
import splitties.init.appCtx
|
||||
|
||||
//data class Me (val userId: String, val deviceId: String)
|
||||
//data class UserProfile (val displayName: String, val avatarUrl: String, val other: JSONObject)
|
||||
//
|
||||
///**
|
||||
// * This func is to validate the token
|
||||
// */
|
||||
//suspend fun getMe(): Me? {
|
||||
// val r = webClient.get("$baseUrl/account/whoami") { bearerAuth(token) }
|
||||
// if (r.status != HttpStatusCode.OK) {
|
||||
// Log.e("getMe", r.bodyAsText())
|
||||
// return null
|
||||
// }
|
||||
//
|
||||
// val json = JSONObject(r.bodyAsText())
|
||||
// return Me(json.getString("user_id"), json.getString("device_id"))
|
||||
//}
|
||||
|
||||
@OptIn(ExperimentalSplittiesApi::class)
|
||||
suspend fun login(server: String, login: String, pass: String): Boolean {
|
||||
@@ -55,19 +39,4 @@ suspend fun login(server: String, login: String, pass: String): Boolean {
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
//suspend fun getAccountData(user: String, state: String): JSONObject? {
|
||||
// val r = webClient.get("$baseUrl/user/$user/account_data/$state") { bearerAuth(token) }
|
||||
// if (r.status != HttpStatusCode.OK) return null
|
||||
// return JSONObject(r.bodyAsText())
|
||||
//}
|
||||
//
|
||||
//suspend fun getUserProfile(userId: String): UserProfile? {
|
||||
// val r = webClient.get("$baseUrl/profile/$userId") { bearerAuth(token) }
|
||||
// if (r.status != HttpStatusCode.OK) return null
|
||||
// val json = JSONObject(r.bodyAsText())
|
||||
// val name = json.optString("displayname", ""); json.remove("displayname")
|
||||
// val avatar = json.optString("avatar_url", ""); json.remove("avatar_url")
|
||||
// return UserProfile(name, avatar, json)
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user