Upgrade rust sdk to v48 (#1186)
- Sends content instead of string in message reply and edit - Adds poll response and end APIs - Adds logoUri to OidcConfiguration
This commit is contained in:
parent
b8d6db2f14
commit
51bb7febd6
5 changed files with 88 additions and 5 deletions
|
|
@ -23,6 +23,7 @@ val oidcConfiguration: OidcConfiguration = OidcConfiguration(
|
|||
clientName = "Element",
|
||||
redirectUri = OidcConfig.redirectUri,
|
||||
clientUri = "https://element.io",
|
||||
logoUri = "https://element.io/mobile-icon.png",
|
||||
tosUri = "https://element.io/user-terms-of-service",
|
||||
policyUri = "https://element.io/privacy",
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class RustMatrixRoom(
|
|||
override suspend fun editMessage(originalEventId: EventId?, transactionId: TransactionId?, message: String): Result<Unit> = withContext(roomDispatcher) {
|
||||
if (originalEventId != null) {
|
||||
runCatching {
|
||||
innerRoom.edit(/* TODO use content */ message, originalEventId.value, transactionId?.value)
|
||||
innerRoom.edit(messageEventContentFromMarkdown(message), originalEventId.value, transactionId?.value)
|
||||
}
|
||||
} else {
|
||||
runCatching {
|
||||
|
|
@ -226,10 +226,8 @@ class RustMatrixRoom(
|
|||
}
|
||||
|
||||
override suspend fun replyMessage(eventId: EventId, message: String): Result<Unit> = withContext(roomDispatcher) {
|
||||
val transactionId = genTransactionId()
|
||||
// val content = messageEventContentFromMarkdown(message)
|
||||
runCatching {
|
||||
innerRoom.sendReply(/* TODO use content */ message, eventId.value, transactionId)
|
||||
innerRoom.sendReply(messageEventContentFromMarkdown(message), eventId.value, genTransactionId())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -402,6 +400,32 @@ class RustMatrixRoom(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun sendPollResponse(
|
||||
pollStartId: EventId,
|
||||
answers: List<String>
|
||||
): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
innerRoom.sendPollResponse(
|
||||
pollStartId = pollStartId.value,
|
||||
answers = answers,
|
||||
txnId = genTransactionId(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun endPoll(
|
||||
pollStartId: EventId,
|
||||
text: String
|
||||
): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
innerRoom.endPoll(
|
||||
pollStartId = pollStartId.value,
|
||||
text = text,
|
||||
txnId = genTransactionId(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun sendAttachment(files: List<File>, handle: () -> SendAttachmentJoinHandle): Result<MediaUploadHandler> {
|
||||
return runCatching {
|
||||
MediaUploadHandlerImpl(files, handle())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue