Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
17b34b9d
Commit
17b34b9d
authored
Mar 08, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify group quote
parent
b1f36704
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
27 deletions
+6
-27
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/MessageSourceImpl.kt
...in/net/mamoe/mirai/qqandroid/message/MessageSourceImpl.kt
+5
-26
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/messages.kt
...Main/kotlin/net/mamoe/mirai/qqandroid/message/messages.kt
+1
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/MessageSourceImpl.kt
View file @
17b34b9d
...
@@ -23,6 +23,7 @@ import net.mamoe.mirai.qqandroid.io.serialization.toByteArray
...
@@ -23,6 +23,7 @@ import net.mamoe.mirai.qqandroid.io.serialization.toByteArray
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.SourceMsg
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.SourceMsg
import
net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.OnlinePush
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.OnlinePush
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
...
@@ -40,7 +41,7 @@ internal class MessageSourceFromServer(
...
@@ -40,7 +41,7 @@ internal class MessageSourceFromServer(
?:
error
(
"cannot find sequenceId from ImMsgBody.SourceMsg"
)).
toLong
().
shl
(
32
)
or
?:
error
(
"cannot find sequenceId from ImMsgBody.SourceMsg"
)).
toLong
().
shl
(
32
)
or
delegate
.
pbReserve
.
loadAs
(
SourceMsg
.
ResvAttr
.
serializer
()).
origUids
!!
.
and
(
0
xFFFFFFFF
)
delegate
.
pbReserve
.
loadAs
(
SourceMsg
.
ResvAttr
.
serializer
()).
origUids
!!
.
and
(
0
xFFFFFFFF
)
override
val
toUin
:
Long
get
()
=
delegate
.
toUin
override
val
toUin
:
Long
get
()
=
delegate
.
toUin
// always 0
override
suspend
fun
ensureSequenceIdAvailable
()
{
override
suspend
fun
ensureSequenceIdAvailable
()
{
// nothing to do
// nothing to do
...
@@ -118,38 +119,16 @@ internal class MessageSourceFromMsg(
...
@@ -118,38 +119,16 @@ internal class MessageSourceFromMsg(
}
}
private
fun
toJceDataImplForGroup
():
ImMsgBody
.
SourceMsg
{
private
fun
toJceDataImplForGroup
():
ImMsgBody
.
SourceMsg
{
val
groupUin
=
Group
.
calculateGroupUinByGroupCode
(
groupId
)
return
ImMsgBody
.
SourceMsg
(
return
ImMsgBody
.
SourceMsg
(
origSeqs
=
listOf
(
delegate
.
msgHead
.
msgSeq
),
origSeqs
=
listOf
(
delegate
.
msgHead
.
msgSeq
),
senderUin
=
delegate
.
msgHead
.
fromUin
,
senderUin
=
delegate
.
msgHead
.
fromUin
,
toUin
=
groupUin
,
toUin
=
0
,
flag
=
1
,
flag
=
1
,
elems
=
delegate
.
msgBody
.
richText
.
elems
,
elems
=
delegate
.
msgBody
.
richText
.
elems
,
type
=
0
,
type
=
0
,
time
=
delegate
.
msgHead
.
msgTime
,
time
=
delegate
.
msgHead
.
msgTime
,
pbReserve
=
SourceMsg
.
ResvAttr
(
pbReserve
=
EMPTY_BYTE_ARRAY
,
origUids
=
messageRandom
.
toLong
()
and
0
xffFFffFF
srcMsg
=
EMPTY_BYTE_ARRAY
).
toByteArray
(
SourceMsg
.
ResvAttr
.
serializer
()),
srcMsg
=
MsgComm
.
Msg
(
msgHead
=
MsgComm
.
MsgHead
(
fromUin
=
delegate
.
msgHead
.
fromUin
,
// qq
toUin
=
groupUin
,
// group
msgType
=
delegate
.
msgHead
.
msgType
,
// 82?
c2cCmd
=
delegate
.
msgHead
.
c2cCmd
,
msgSeq
=
delegate
.
msgHead
.
msgSeq
,
msgTime
=
delegate
.
msgHead
.
msgTime
,
msgUid
=
messageRandom
.
toLong
()
and
0
xffFFffFF
,
// ok
groupInfo
=
MsgComm
.
GroupInfo
(
groupCode
=
groupId
),
isSrcMsg
=
true
),
msgBody
=
ImMsgBody
.
MsgBody
(
richText
=
ImMsgBody
.
RichText
(
elems
=
elems
)
)
).
toByteArray
(
MsgComm
.
Msg
.
serializer
())
)
)
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/messages.kt
View file @
17b34b9d
...
@@ -252,7 +252,7 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean): MutableList<ImMsgB
...
@@ -252,7 +252,7 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean): MutableList<ImMsgB
is
QuoteReplyToSend
->
{
is
QuoteReplyToSend
->
{
if
(
forGroup
)
{
if
(
forGroup
)
{
check
(
it
is
QuoteReplyToSend
.
ToGroup
)
{
check
(
it
is
QuoteReplyToSend
.
ToGroup
)
{
"sending a quote to group
su
ing QuoteReplyToSend.ToFriend"
"sending a quote to group
us
ing QuoteReplyToSend.ToFriend"
}
}
if
(
it
.
sender
is
Member
)
{
if
(
it
.
sender
is
Member
)
{
transformOneMessage
(
it
.
createAt
())
transformOneMessage
(
it
.
createAt
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment