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
899c2b7d
Commit
899c2b7d
authored
Feb 19, 2020
by
Him188
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
31adf351
adb094f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
mirai-api-http/README_CH.md
mirai-api-http/README_CH.md
+1
-1
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/data/common/MessageDTO.kt
...kotlin/net/mamoe/mirai/api/http/data/common/MessageDTO.kt
+3
-4
No files found.
mirai-api-http/README_CH.md
View file @
899c2b7d
...
@@ -389,7 +389,7 @@ Content-Type:multipart/form-data
...
@@ -389,7 +389,7 @@ Content-Type:multipart/form-data
+
[x] At,@消息
+
[x] At,@消息
+
[x] AtAll,@全体成员
+
[x] AtAll,@全体成员
+
[
] Face,表情消息
+
[
x
] Face,表情消息
+
[x] Plain,文字消息
+
[x] Plain,文字消息
+
[x] Image,图片消息
+
[x] Image,图片消息
+
[ ] Xml,Xml卡片消息
+
[ ] Xml,Xml卡片消息
...
...
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/data/common/MessageDTO.kt
View file @
899c2b7d
...
@@ -13,7 +13,6 @@ import kotlinx.serialization.SerialName
...
@@ -13,7 +13,6 @@ import kotlinx.serialization.SerialName
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.contact.Contact
import
net.mamoe.mirai.contact.Contact
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.contact.Member
import
net.mamoe.mirai.message.FriendMessage
import
net.mamoe.mirai.message.FriendMessage
import
net.mamoe.mirai.message.GroupMessage
import
net.mamoe.mirai.message.GroupMessage
import
net.mamoe.mirai.message.MessagePacket
import
net.mamoe.mirai.message.MessagePacket
...
@@ -80,7 +79,7 @@ sealed class MessageDTO : DTO
...
@@ -80,7 +79,7 @@ sealed class MessageDTO : DTO
/*
/*
Extend function
Extend function
*/
*/
suspend
fun
MessagePacket
<*,
*>.
toDTO
():
MessagePacketDTO
=
when
(
this
)
{
fun
MessagePacket
<*,
*>.
toDTO
():
MessagePacketDTO
=
when
(
this
)
{
is
FriendMessage
->
FriendMessagePacketDTO
(
QQDTO
(
sender
))
is
FriendMessage
->
FriendMessagePacketDTO
(
QQDTO
(
sender
))
is
GroupMessage
->
GroupMessagePacketDTO
(
MemberDTO
(
sender
))
is
GroupMessage
->
GroupMessagePacketDTO
(
MemberDTO
(
sender
))
else
->
UnKnownMessagePacketDTO
(
"UnKnown Message Packet"
)
else
->
UnKnownMessagePacketDTO
(
"UnKnown Message Packet"
)
...
@@ -94,7 +93,7 @@ fun Message.toDTO() = when (this) {
...
@@ -94,7 +93,7 @@ fun Message.toDTO() = when (this) {
is
MessageSource
->
MessageSourceDTO
(
messageUid
)
is
MessageSource
->
MessageSourceDTO
(
messageUid
)
is
At
->
AtDTO
(
target
,
display
)
is
At
->
AtDTO
(
target
,
display
)
is
AtAll
->
AtAllDTO
(
0L
)
is
AtAll
->
AtAllDTO
(
0L
)
is
Face
->
FaceDTO
(
id
.
value
.
toInt
()
)
is
Face
->
FaceDTO
(
id
)
is
PlainText
->
PlainDTO
(
stringValue
)
is
PlainText
->
PlainDTO
(
stringValue
)
is
Image
->
ImageDTO
(
imageId
)
is
Image
->
ImageDTO
(
imageId
)
is
XMLMessage
->
XmlDTO
(
stringValue
)
is
XMLMessage
->
XmlDTO
(
stringValue
)
...
@@ -105,7 +104,7 @@ fun Message.toDTO() = when (this) {
...
@@ -105,7 +104,7 @@ fun Message.toDTO() = when (this) {
fun
MessageDTO
.
toMessage
(
contact
:
Contact
)
=
when
(
this
)
{
fun
MessageDTO
.
toMessage
(
contact
:
Contact
)
=
when
(
this
)
{
is
AtDTO
->
At
((
contact
as
Group
)[
target
])
is
AtDTO
->
At
((
contact
as
Group
)[
target
])
is
AtAllDTO
->
AtAll
is
AtAllDTO
->
AtAll
is
FaceDTO
->
Face
(
FaceId
(
faceId
.
toUByte
())
)
is
FaceDTO
->
Face
(
faceId
)
is
PlainDTO
->
PlainText
(
text
)
is
PlainDTO
->
PlainText
(
text
)
is
ImageDTO
->
Image
(
imageId
)
is
ImageDTO
->
Image
(
imageId
)
is
XmlDTO
->
XMLMessage
(
xml
)
is
XmlDTO
->
XMLMessage
(
xml
)
...
...
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