mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 11:09:10 +08:00
Fix message logging
This commit is contained in:
parent
3644ff0035
commit
8870558d4c
@ -250,8 +250,10 @@ internal suspend fun <C : User> SendMessageHandler<out C>.sendMessageImpl(
|
|||||||
val result = this
|
val result = this
|
||||||
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
||||||
|
|
||||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
if (result.isSuccess) {
|
||||||
contact.logMessageSent(chain)
|
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||||
|
contact.logMessageSent(chain)
|
||||||
|
}
|
||||||
|
|
||||||
postSendEventConstructor(contact, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
postSendEventConstructor(contact, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
||||||
|
|
||||||
|
@ -162,8 +162,10 @@ internal class GroupImpl constructor(
|
|||||||
val result = GroupSendMessageHandler(this)
|
val result = GroupSendMessageHandler(this)
|
||||||
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
||||||
|
|
||||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
if (result.isSuccess) {
|
||||||
logMessageSent(chain)
|
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||||
|
logMessageSent(chain)
|
||||||
|
}
|
||||||
|
|
||||||
GroupMessagePostSendEvent(this, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
GroupMessagePostSendEvent(this, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user