Skip to content

Commit

Permalink
Fix: Stop SkyHanni messages from being sent twice by accident (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs authored Oct 16, 2024
1 parent 17b3900 commit 1d79bb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ object ChatUtils {
): Boolean {
val text = ChatComponentText(message)

if (replaceSameMessage) {
return if (replaceSameMessage) {
text.send(getUniqueMessageIdForString(message))
chat(text, false)
} else {
chat(text)
}
return chat(text)
}

fun chat(message: IChatComponent): Boolean {
fun chat(message: IChatComponent, send: Boolean = true): Boolean {
val formattedMessage = message.getFormattedTextCompat()
log.log(formattedMessage)

Expand All @@ -116,7 +116,7 @@ object ChatUtils {
return false
}

thePlayer.addChatMessage(message)
if (send) thePlayer.addChatMessage(message)
return true
}

Expand Down

0 comments on commit 1d79bb1

Please sign in to comment.