mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 修复群消息撤回事件群号获取错误
This commit is contained in:
parent
4dafa75944
commit
1d0a0731fb
@ -452,17 +452,19 @@ internal object PrimitiveListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun onGroupRecall(time: Long, pb: ProtoMap) {
|
private suspend fun onGroupRecall(time: Long, pb: ProtoMap) {
|
||||||
val groupCode = pb[1, 1, 1].asULong
|
var detail = pb[1, 3, 2]
|
||||||
val readPacket = ByteReadPacket(pb[1, 3, 2].asByteArray)
|
if (detail !is ProtoMap) {
|
||||||
try {
|
try {
|
||||||
/**
|
val readPacket = ByteReadPacket(detail.asByteArray)
|
||||||
* 真是不理解这个傻呗设计,有些群是正常的Protobuf,有些群要去掉7字节
|
readPacket.discardExact(4)
|
||||||
*/
|
|
||||||
val detail = if (readPacket.readBuf32Long() == groupCode) {
|
|
||||||
readPacket.discardExact(1)
|
readPacket.discardExact(1)
|
||||||
ProtoUtils.decodeFromByteArray(readPacket.readBytes(readPacket.readShort().toInt()))
|
detail = ProtoUtils.decodeFromByteArray(readPacket.readBytes(readPacket.readShort().toInt()))
|
||||||
} else pb[1, 3, 2]
|
readPacket.release()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
LogCenter.log("onGroupRecall error: ${e.stackTraceToString()}", Level.WARN)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val groupCode = detail[4].asULong
|
||||||
val operatorUid = detail[11, 1].asUtf8String
|
val operatorUid = detail[11, 1].asUtf8String
|
||||||
val targetUid = detail[11, 3, 6].asUtf8String
|
val targetUid = detail[11, 3, 6].asUtf8String
|
||||||
val msgSeq = detail[11, 3, 1].asLong
|
val msgSeq = detail[11, 3, 1].asLong
|
||||||
@ -482,9 +484,6 @@ internal object PrimitiveListener {
|
|||||||
) {
|
) {
|
||||||
LogCenter.log("群消息撤回推送失败!", Level.WARN)
|
LogCenter.log("群消息撤回推送失败!", Level.WARN)
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
readPacket.release()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun onGroupApply(time: Long, pb: ProtoMap) {
|
private suspend fun onGroupApply(time: Long, pb: ProtoMap) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user