Skip to content

Commit 2c88080

Browse files
authored
fix: correct verbose setting in forward mode (#84)
closes #83
1 parent afb3ce8 commit 2c88080

File tree

5 files changed

+11
-37
lines changed

5 files changed

+11
-37
lines changed

Module.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
}
1111

1212
group = "io.github.samarium150"
13-
version = "6.0.4"
13+
version = "6.0.5"
1414

1515
repositories {
1616
mavenCentral()

src/main/kotlin/MiraiConsoleLolicon.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import java.net.Proxy
3535
object MiraiConsoleLolicon : KotlinPlugin(
3636
JvmPluginDescription(
3737
id = "io.github.samarium150.mirai.plugin.mirai-console-lolicon",
38-
version = "6.0.4",
38+
version = "6.0.5",
3939
name = "Lolicon"
4040
) {
4141
author("Samarium150")

src/main/kotlin/command/Lolicon.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ object Lolicon : CompositeCommand(
117117
return@withLock
118118
}
119119
val image = (subject as Contact).uploadImage(stream)
120-
val imgReceipt = sendMessage(buildMessage(subject as Contact, imageData.toReadable(url), image))
120+
val imgReceipt = sendMessage(
121+
buildMessage(
122+
subject as Contact,
123+
if (PluginConfig.verbose) imageData.toReadable(url) else "",
124+
image
125+
)
126+
)
121127
if (notificationReceipt != null)
122128
recall(RecallType.NOTIFICATION, notificationReceipt, 0)
123129
if (imgReceipt == null)

src/main/kotlin/util/GeneralUtil.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ internal fun buildMessage(contact: Contact, imageInfo: String, image: Image): Si
137137
PluginConfig.Type.Simple -> image
138138
PluginConfig.Type.Flash -> FlashImage(image)
139139
PluginConfig.Type.Forward -> buildForwardMessage(contact, CustomDisplayStrategy) {
140-
add(contact.bot, PlainText(imageInfo))
140+
if (imageInfo.isNotEmpty())
141+
add(contact.bot, PlainText(imageInfo))
141142
add(contact.bot, image)
142143
}
143144
}

0 commit comments

Comments
 (0)