Commit 5635509c authored by ryoii's avatar ryoii

Calculate groupCode, fixes #301

parent bd742915
...@@ -2,6 +2,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat ...@@ -2,6 +2,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat
import kotlinx.io.core.ByteReadPacket import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.readBytes import kotlinx.io.core.readBytes
import net.mamoe.mirai.contact.Group
import net.mamoe.mirai.event.events.BotInvitedJoinGroupRequestEvent import net.mamoe.mirai.event.events.BotInvitedJoinGroupRequestEvent
import net.mamoe.mirai.event.events.MemberJoinRequestEvent import net.mamoe.mirai.event.events.MemberJoinRequestEvent
import net.mamoe.mirai.event.events.NewFriendRequestEvent import net.mamoe.mirai.event.events.NewFriendRequestEvent
...@@ -51,7 +52,7 @@ internal class NewContact { ...@@ -51,7 +52,7 @@ internal class NewContact {
struct.msgSeq, struct.msgSeq,
msgAdditional, msgAdditional,
struct.reqUin, struct.reqUin,
groupCode, Group.calculateGroupUinByGroupCode(groupCode),
reqUinNick reqUinNick
) )
} }
...@@ -141,7 +142,7 @@ internal class NewContact { ...@@ -141,7 +142,7 @@ internal class NewContact {
bot, bot,
struct.msgSeq, struct.msgSeq,
actionUin, actionUin,
groupCode, Group.calculateGroupUinByGroupCode(groupCode),
groupName, groupName,
actionUinNick actionUinNick
) )
...@@ -152,7 +153,7 @@ internal class NewContact { ...@@ -152,7 +153,7 @@ internal class NewContact {
struct.msgSeq, struct.msgSeq,
msgAdditional, msgAdditional,
struct.reqUin, struct.reqUin,
groupCode, Group.calculateGroupUinByGroupCode(groupCode),
groupName, groupName,
reqUinNick reqUinNick
) )
...@@ -180,7 +181,7 @@ internal class NewContact { ...@@ -180,7 +181,7 @@ internal class NewContact {
true -> 11 // accept true -> 11 // accept
false -> 12 // reject false -> 12 // reject
}, },
groupCode = event.groupId, groupCode = Group.calculateGroupCodeByGroupUin(event.groupId),
msg = "", msg = "",
remark = "", remark = "",
blacklist = blackList blacklist = blackList
...@@ -207,7 +208,7 @@ internal class NewContact { ...@@ -207,7 +208,7 @@ internal class NewContact {
Structmsg.ReqSystemMsgAction( Structmsg.ReqSystemMsgAction(
actionInfo = Structmsg.SystemMsgActionInfo( actionInfo = Structmsg.SystemMsgActionInfo(
type = if (accept) 11 else 12, type = if (accept) 11 else 12,
groupCode = event.groupId groupCode = Group.calculateGroupCodeByGroupUin(event.groupId)
), ),
groupMsgType = 2, groupMsgType = 2,
language = 1000, language = 1000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment