diff --git a/xposed/src/main/java/kritor/service/GroupService.kt b/xposed/src/main/java/kritor/service/GroupService.kt index 44dde388..69e8e755 100644 --- a/xposed/src/main/java/kritor/service/GroupService.kt +++ b/xposed/src/main/java/kritor/service/GroupService.kt @@ -3,6 +3,7 @@ package kritor.service import io.grpc.Status import io.grpc.StatusRuntimeException import io.kritor.group.* +import moe.fuqiuluo.shamrock.helper.LogCenter import moe.fuqiuluo.shamrock.helper.TroopHonorHelper.decodeHonor import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty import qq.service.contact.ContactHelper @@ -213,9 +214,10 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase( return GetGroupListResponse.newBuilder().apply { groupList.forEach { groupInfo -> this.addGroupsInfo(GroupInfo.newBuilder().apply { - groupId = groupInfo.troopcode.toLong() + groupId = groupInfo.troopcode.ifNullOrEmpty { groupInfo.uin }.ifNullOrEmpty { groupInfo.troopuin }?.toLong() ?: 0 groupName = groupInfo.troopname.ifNullOrEmpty { groupInfo.troopRemark } - .ifNullOrEmpty { groupInfo.newTroopName } ?: "" + .ifNullOrEmpty { groupInfo.newTroopName } + ?: "" groupRemark = groupInfo.troopRemark ?: "" owner = groupInfo.troopowneruin?.toLong() ?: 0 addAllAdmins(GroupHelper.getAdminList(groupId)) diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt index 5a9cbfbf..6c12f61c 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt @@ -7,6 +7,7 @@ import com.tencent.qqnt.kernel.nativeinterface.MsgRecord import io.kritor.event.* import io.kritor.common.PushMessageBody import io.kritor.common.Contact +import io.kritor.common.Scene import io.kritor.common.Sender import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope @@ -44,7 +45,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { - this.scene = scene + this.scene = Scene.GROUP this.peer = record.peerUin.toString() this.subPeer = record.peerUid }.build() @@ -67,7 +68,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { - this.scene = scene + this.scene = Scene.FRIEND this.peer = record.senderUin.toString() this.subPeer = record.senderUid }.build() @@ -92,7 +93,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { - this.scene = scene + this.scene = if (groupCode > 0) Scene.STRANGER_FROM_GROUP else Scene.STRANGER this.peer = record.senderUin.toString() this.subPeer = groupCode.toString() }.build() @@ -115,7 +116,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { - this.scene = scene + this.scene = Scene.GUILD this.peer = record.guildId ?: "" this.subPeer = record.channelId ?: "" }.build()