- Fix ClippyResponseBus subscription to use SharedFlow.collect() - Fix MatrixRestClient.putAccountData() to use httpClient not client - Add missing Log import to MatrixRestClient
This commit is contained in:
@@ -96,8 +96,10 @@ class VoiceLoop(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Subscribe to FCM fast path
|
// Subscribe to FCM fast path
|
||||||
ClippyResponseBus.subscribe { response, _ ->
|
scope.launch {
|
||||||
scope.launch { handleClippyResponse(response, path = "fcm") }
|
ClippyResponseBus.responses.collect { response ->
|
||||||
|
handleClippyResponse(response.text, path = response.path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start network monitoring
|
// Start network monitoring
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package farm.hobbs.clippyauto.matrix
|
package farm.hobbs.clippyauto.matrix
|
||||||
|
import android.util.Log
|
||||||
|
|
||||||
import io.ktor.client.*
|
import io.ktor.client.*
|
||||||
import io.ktor.client.call.*
|
import io.ktor.client.call.*
|
||||||
@@ -171,7 +172,7 @@ class MatrixRestClient(
|
|||||||
*/
|
*/
|
||||||
suspend fun putAccountData(userId: String, type: String, data: Map<String, String>): Boolean {
|
suspend fun putAccountData(userId: String, type: String, data: Map<String, String>): Boolean {
|
||||||
return try {
|
return try {
|
||||||
val response = client.put("$homeserverUrl/_matrix/client/v3/user/$userId/account_data/$type") {
|
val response = httpClient.put("$homeserverUrl/_matrix/client/v3/user/$userId/account_data/$type") {
|
||||||
header("Authorization", "Bearer $accessToken")
|
header("Authorization", "Bearer $accessToken")
|
||||||
contentType(ContentType.Application.Json)
|
contentType(ContentType.Application.Json)
|
||||||
setBody(buildJsonObject {
|
setBody(buildJsonObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user