Skip to content

Commit

Permalink
fix: correct verbose setting in forward mode (#84)
Browse files Browse the repository at this point in the history
closes #83
  • Loading branch information
Samarium150 authored Oct 13, 2022
1 parent afb3ce8 commit 2c88080
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 37 deletions.
33 changes: 0 additions & 33 deletions Module.md

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = "io.github.samarium150"
version = "6.0.4"
version = "6.0.5"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/MiraiConsoleLolicon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import java.net.Proxy
object MiraiConsoleLolicon : KotlinPlugin(
JvmPluginDescription(
id = "io.github.samarium150.mirai.plugin.mirai-console-lolicon",
version = "6.0.4",
version = "6.0.5",
name = "Lolicon"
) {
author("Samarium150")
Expand Down
8 changes: 7 additions & 1 deletion src/main/kotlin/command/Lolicon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ object Lolicon : CompositeCommand(
return@withLock
}
val image = (subject as Contact).uploadImage(stream)
val imgReceipt = sendMessage(buildMessage(subject as Contact, imageData.toReadable(url), image))
val imgReceipt = sendMessage(
buildMessage(
subject as Contact,
if (PluginConfig.verbose) imageData.toReadable(url) else "",
image
)
)
if (notificationReceipt != null)
recall(RecallType.NOTIFICATION, notificationReceipt, 0)
if (imgReceipt == null)
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/util/GeneralUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ internal fun buildMessage(contact: Contact, imageInfo: String, image: Image): Si
PluginConfig.Type.Simple -> image
PluginConfig.Type.Flash -> FlashImage(image)
PluginConfig.Type.Forward -> buildForwardMessage(contact, CustomDisplayStrategy) {
add(contact.bot, PlainText(imageInfo))
if (imageInfo.isNotEmpty())
add(contact.bot, PlainText(imageInfo))
add(contact.bot, image)
}
}
Expand Down

0 comments on commit 2c88080

Please sign in to comment.