This commit is contained in:
Simplxs 2024-01-10 00:15:15 +08:00
parent f47ae69653
commit fdd769d9ff
No known key found for this signature in database
GPG Key ID: E23537FF14DD6507

View File

@ -203,12 +203,6 @@ internal object PrimitiveListener {
LogCenter.log("onGroupTitleChange error: ${e.stackTraceToString()}", Level.WARN) LogCenter.log("onGroupTitleChange error: ${e.stackTraceToString()}", Level.WARN)
} }
} }
var detail5 = detail[5]
if (detail5 is ProtoList) {
detail5 = detail5.value.first { it is ProtoMap }
}
val targetUin = detail5[5].asLong
var groupId:Long var groupId:Long
try { try {
groupId = detail[4].asULong groupId = detail[4].asULong
@ -216,8 +210,16 @@ internal object PrimitiveListener {
groupId = detail[4].asList.value[0].asULong groupId = detail[4].asList.value[0].asULong
} }
detail = if (detail[5] is ProtoList) {
(detail[5] as ProtoList).value[0]
} else {
detail[5]
}
val targetUin = detail[5].asLong
// 恭喜<{\"cmd\":5,\"data\":\"qq\",\"text}\":\"nickname\"}>获得群主授予的<{\"cmd\":1,\"data\":\"https://qun.qq.com/qqweb/m/qun/medal/detail.html?_wv=16777223&bid=2504&gc=gid&isnew=1&medal=302&uin=uin\",\"text\":\"title\",\"url\":\"https://qun.qq.com/qqweb/m/qun/medal/detail.html?_wv=16777223&bid=2504&gc=gid&isnew=1&medal=302&uin=uin\"}>头衔 // 恭喜<{\"cmd\":5,\"data\":\"qq\",\"text}\":\"nickname\"}>获得群主授予的<{\"cmd\":1,\"data\":\"https://qun.qq.com/qqweb/m/qun/medal/detail.html?_wv=16777223&bid=2504&gc=gid&isnew=1&medal=302&uin=uin\",\"text\":\"title\",\"url\":\"https://qun.qq.com/qqweb/m/qun/medal/detail.html?_wv=16777223&bid=2504&gc=gid&isnew=1&medal=302&uin=uin\"}>头衔
val titleChangeInfo = detail5[2].asUtf8String val titleChangeInfo = detail[2].asUtf8String
if (titleChangeInfo.indexOf("群主授予") == -1) { if (titleChangeInfo.indexOf("群主授予") == -1) {
return return
} }
@ -300,19 +302,26 @@ internal object PrimitiveListener {
LogCenter.log("onGroupPokeAndGroupSign error: ${e.stackTraceToString()}", Level.WARN) LogCenter.log("onGroupPokeAndGroupSign error: ${e.stackTraceToString()}", Level.WARN)
} }
} }
var groupId:Long
try {
groupId = detail[4].asULong
}catch (e: ClassCastException){
groupId = detail[4].asList.value[0].asULong
}
detail = if (detail[26] is ProtoList) {
(detail[26] as ProtoList).value[0]
} else {
detail[26]
}
lateinit var target: String lateinit var target: String
lateinit var operation: String lateinit var operation: String
var action: String? = null var action: String? = null
var suffix: String? = null var suffix: String? = null
var actionImg: String? = null var actionImg: String? = null
var rankImg: String? = null var rankImg: String? = null
var groupCode:Long detail[7]
try {
groupCode = detail[4].asULong
}catch (e: ClassCastException){
groupCode = detail[4].asList.value[0].asULong
}
detail[26][7]
.asList .asList
.value .value
.forEach { .forEach {
@ -334,27 +343,27 @@ internal object PrimitiveListener {
// "sign_word" -> 我也要打卡 // "sign_word" -> 我也要打卡
} }
} }
when (detail[26][2].asInt) { when (detail[2].asInt) {
1061 -> { 1061 -> {
LogCenter.log("群戳一戳($groupCode): $operation $action $target $suffix") LogCenter.log("群戳一戳($groupId): $operation $action $target $suffix")
if (!GlobalEventTransmitter.GroupNoticeTransmitter if (!GlobalEventTransmitter.GroupNoticeTransmitter
.transGroupPoke(time, operation.toLong(), target.toLong(), action, suffix, actionImg, groupCode) .transGroupPoke(time, operation.toLong(), target.toLong(), action, suffix, actionImg, groupId)
) { ) {
LogCenter.log("群戳一戳推送失败!", Level.WARN) LogCenter.log("群戳一戳推送失败!", Level.WARN)
} }
} }
1068 -> { 1068 -> {
LogCenter.log("群打卡($groupCode): $action $target") LogCenter.log("群打卡($groupId): $action $target")
if (!GlobalEventTransmitter.GroupNoticeTransmitter if (!GlobalEventTransmitter.GroupNoticeTransmitter
.transGroupSign(time, target.toLong(), action, rankImg, groupCode) .transGroupSign(time, target.toLong(), action, rankImg, groupId)
) { ) {
LogCenter.log("群打卡推送失败!", Level.WARN) LogCenter.log("群打卡推送失败!", Level.WARN)
} }
} }
else -> { else -> {
LogCenter.log("onGroupPokeAndGroupSign unknown type ${detail[26, 2].asInt}", Level.WARN) LogCenter.log("onGroupPokeAndGroupSign unknown type ${detail[2].asInt}", Level.WARN)
} }
} }
} }