mirror of
https://github.com/element-hq/element-android
synced 2024-11-25 02:45:37 +03:00
Create a debug method to send x times the same event
This commit is contained in:
parent
becc5a7b54
commit
8966e24925
1 changed files with 13 additions and 0 deletions
|
@ -74,6 +74,19 @@ internal class DefaultSendService @AssistedInject constructor(
|
|||
return sendEvent(event)
|
||||
}
|
||||
|
||||
// For test only
|
||||
private fun sendTextMessages(text: CharSequence, msgType: String, autoMarkdown: Boolean, times: Int): Cancelable {
|
||||
return CancelableBag().apply {
|
||||
// Send the event several times
|
||||
repeat(times) { i ->
|
||||
val event = localEchoEventFactory.createTextEvent(roomId, msgType, "$text - $i", autoMarkdown).also {
|
||||
createLocalEcho(it)
|
||||
}
|
||||
add(sendEvent(event))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendFormattedTextMessage(text: String, formattedText: String, msgType: String): Cancelable {
|
||||
val event = localEchoEventFactory.createFormattedTextEvent(roomId, TextContent(text, formattedText), msgType).also {
|
||||
createLocalEcho(it)
|
||||
|
|
Loading…
Reference in a new issue