Fixing Test cases

This commit is contained in:
Vitor Pamplona
2023-07-24 11:54:09 -04:00
parent e83cfe4f07
commit d68b14532d
4 changed files with 21 additions and 16 deletions
@@ -9,7 +9,12 @@ import com.vitorpamplona.amethyst.service.bechToBytes
import com.vitorpamplona.amethyst.service.nip19.Nip19
import com.vitorpamplona.amethyst.service.toNpub
class NewMessageTagger(var channelHex: String?, var mentions: List<User>?, var replyTos: List<Note>?, var message: String) {
class NewMessageTagger(
var message: String,
var mentions: List<User>? = null,
var replyTos: List<Note>? = null,
var channelHex: String? = null
) {
val directMentions = mutableSetOf<HexKey>()
@@ -130,7 +130,7 @@ open class NewPostViewModel() : ViewModel() {
}
fun sendPost(relayList: List<Relay>? = null) {
val tagger = NewMessageTagger(originalNote?.channelHex(), mentions, replyTos, message.text)
val tagger = NewMessageTagger(message.text, mentions, replyTos, originalNote?.channelHex())
tagger.run()
val zapReceiver = if (wantsForwardZapTo) {
@@ -272,10 +272,10 @@ fun ChannelScreen(
EditFieldRow(newPostModel, isPrivate = false, accountViewModel = accountViewModel) {
scope.launch(Dispatchers.IO) {
val tagger = NewMessageTagger(
channelHex = channel.idHex,
message = newPostModel.message.text,
mentions = listOfNotNull(replyTo.value?.author),
replyTos = listOfNotNull(replyTo.value),
message = newPostModel.message.text
channelHex = channel.idHex
)
tagger.run()
if (channel is PublicChatChannel) {