mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 07:56:56 +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
|
||||
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
||||
|
||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||
contact.logMessageSent(chain)
|
||||
if (result.isSuccess) {
|
||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||
contact.logMessageSent(chain)
|
||||
}
|
||||
|
||||
postSendEventConstructor(contact, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
||||
|
||||
|
@ -162,8 +162,10 @@ internal class GroupImpl constructor(
|
||||
val result = GroupSendMessageHandler(this)
|
||||
.runCatching { sendMessage(message, chain, SendMessageStep.FIRST) }
|
||||
|
||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||
logMessageSent(chain)
|
||||
if (result.isSuccess) {
|
||||
// logMessageSent(result.getOrNull()?.source?.plus(chain) ?: chain) // log with source
|
||||
logMessageSent(chain)
|
||||
}
|
||||
|
||||
GroupMessagePostSendEvent(this, chain, result.exceptionOrNull(), result.getOrNull()).broadcast()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user