Commit d0620c5 1 parent 8f3e7d5 commit d0620c5 Copy full SHA for d0620c5
File tree 1 file changed +17
-7
lines changed
mirai-core/src/commonMain/kotlin/message/protocol/impl
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -157,17 +157,27 @@ internal class QuoteReplyProtocol : MessageProtocol(PRIORITY_METADATA) {
157
157
markAsConsumed()
158
158
collect(ImMsgBody .Elem (srcMsg = source.toJceData()))
159
159
if (sourceCommon.kind == MessageSourceKind .GROUP ) {
160
- if (source is OnlineMessageSource .Incoming .FromGroup ) {
161
- val sender0 = source.sender
162
- if (sender0 !is AnonymousMember ) {
163
- processAlso(At (sender0))
160
+
161
+ @Suppress(" RemoveExplicitTypeArguments" )
162
+ val needPlusAt = sequence<Boolean > {
163
+ if (source is OnlineMessageSource .Incoming .FromGroup ) {
164
+ try {
165
+ val sender0 = source.sender
166
+ yield (sender0 !is AnonymousMember )
167
+ } catch (_: IllegalStateException ) {
168
+ // Member not available now
169
+ }
164
170
}
171
+
172
+ yield (sourceCommon.fromId != 80000000L )
173
+ }
174
+
175
+ if (needPlusAt.first()) {
176
+ processAlso(At (sourceCommon.fromId))
177
+
165
178
// transformOneMessage(PlainText(" "))
166
179
// removed by https://github.com/mamoe/mirai/issues/524
167
180
// 发送 QuoteReply 消息时无可避免的产生多余空格 #524
168
- } else if (sourceCommon.fromId != 80000000L ) {
169
- // https://github.com/mamoe/mirai/issues/2501 OfflineMessageSource quote replying
170
- processAlso(At (sourceCommon.fromId))
171
181
}
172
182
}
173
183
}
You can’t perform that action at this time.
0 commit comments