diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-10-11 12:42:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 18:42:33 +0200 |
commit | 7c2d4ed566246513bc438272e436627412147d62 (patch) | |
tree | edf8d3d01a49bd7c4f5993bae6367613c32fcaac /src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt | |
parent | 0671e35163d55ab0f940aa6806a0d7bfb2876429 (diff) | |
download | skyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.gz skyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.bz2 skyhanni-7c2d4ed566246513bc438272e436627412147d62.zip |
Backend: Detekt Fixes Part 6 (#2657)
Co-authored-by: Cal <cwolfson58@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt index a8941c95a..d600cc403 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt @@ -129,9 +129,9 @@ object ChatUtils { val rawText = msgPrefix + message val text = Text.text(rawText) { - this.onClick(expireAt, oneTimeClick, onClick) - this.hover = hover.asComponent() - } + this.onClick(expireAt, oneTimeClick, onClick) + this.hover = hover.asComponent() + } if (replaceSameMessage) { text.send(getUniqueMessageIdForString(rawText)) } else { @@ -166,12 +166,14 @@ object ChatUtils { ) { val msgPrefix = if (prefix) prefixColor + CHAT_PREFIX else "" - chat(Text.text(msgPrefix + message) { - this.hover = Text.multiline(hover) - if (command != null) { - this.command = command + chat( + Text.text(msgPrefix + message) { + this.hover = Text.multiline(hover) + if (command != null) { + this.command = command + } } - }) + ) } /** @@ -194,10 +196,12 @@ object ChatUtils { prefixColor: String = "§e", ) { val msgPrefix = if (prefix) prefixColor + CHAT_PREFIX else "" - chat(Text.text(msgPrefix + message) { - this.url = url - this.hover = "$prefixColor$hover".asComponent() - }) + chat( + Text.text(msgPrefix + message) { + this.url = url + this.hover = "$prefixColor$hover".asComponent() + } + ) if (autoOpen) OSUtils.openBrowser(url) } |