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
e9591981
Commit
e9591981
authored
Apr 13, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shortcuts, fix type issue
parent
45784c01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
19 deletions
+34
-19
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
...commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
...Main/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
+6
-17
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
...monMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
+27
-1
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
View file @
e9591981
...
...
@@ -270,7 +270,7 @@ interface MessageMetadata : SingleMessage {
*/
@SinceMirai
(
"0.34.0"
)
@MiraiExperimentalAPI
interface
ConstrainSingle
<
M
:
Message
>
:
MessageMetadata
{
interface
ConstrainSingle
<
out
M
:
Message
>
:
MessageMetadata
{
val
key
:
Message
.
Key
<
M
>
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
View file @
e9591981
...
...
@@ -39,12 +39,12 @@ import kotlin.jvm.JvmSynthetic
*/
@OptIn
(
MiraiExperimentalAPI
::
class
)
@SinceMirai
(
"0.33.0"
)
sealed
class
MessageSource
:
Message
,
MessageMetadata
,
ConstrainSingle
<
Online
MessageSource
>
{
sealed
class
MessageSource
:
Message
,
MessageMetadata
,
ConstrainSingle
<
MessageSource
>
{
companion
object
Key
:
Message
.
Key
<
MessageSource
>
{
override
val
typeName
:
String
get
()
=
"MessageSource"
}
final
override
val
key
:
Message
.
Key
<
OnlineMessageSource
>
get
()
=
OnlineMessageSource
final
override
val
key
:
Message
.
Key
<
MessageSource
>
get
()
=
Key
/**
* 所属 [Bot]
...
...
@@ -153,13 +153,6 @@ sealed class OnlineMessageSource : MessageSource() {
abstract
override
val
target
:
QQ
final
override
val
subject
:
QQ
get
()
=
target
// final override fun toString(): String = "OnlineMessageSource.ToFriend(target=${target.id})"
@PlannedRemoval
(
"1.0.0"
)
@Deprecated
(
"for binary compatibility until 1.0.0"
,
level
=
DeprecationLevel
.
HIDDEN
)
@
get
:
JvmName
(
"sender"
)
@
get
:
JvmSynthetic
final
override
val
sender2
:
Bot
get
()
=
sender
}
abstract
class
ToTemp
:
Outgoing
()
{
...
...
@@ -188,8 +181,7 @@ sealed class OnlineMessageSource : MessageSource() {
*/
sealed
class
Incoming
:
OnlineMessageSource
()
{
companion
object
Key
:
Message
.
Key
<
Incoming
>
{
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming"
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming"
}
abstract
override
val
sender
:
QQ
// out QQ
...
...
@@ -199,8 +191,7 @@ sealed class OnlineMessageSource : MessageSource() {
abstract
class
FromFriend
:
Incoming
()
{
companion
object
Key
:
Message
.
Key
<
FromFriend
>
{
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromFriend"
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromFriend"
}
abstract
override
val
sender
:
QQ
...
...
@@ -211,8 +202,7 @@ sealed class OnlineMessageSource : MessageSource() {
abstract
class
FromTemp
:
Incoming
()
{
companion
object
Key
:
Message
.
Key
<
FromTemp
>
{
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromTemp"
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromTemp"
}
abstract
override
val
sender
:
Member
...
...
@@ -223,8 +213,7 @@ sealed class OnlineMessageSource : MessageSource() {
abstract
class
FromGroup
:
Incoming
()
{
companion
object
Key
:
Message
.
Key
<
FromGroup
>
{
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromGroup"
override
val
typeName
:
String
get
()
=
"OnlineMessageSource.Incoming.FromGroup"
}
abstract
override
val
sender
:
Member
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
View file @
e9591981
...
...
@@ -9,11 +9,12 @@
@
file
:
JvmMultifileClass
@
file
:
JvmName
(
"MessageUtils"
)
@
file
:
Suppress
(
"NOTHING_TO_INLINE"
)
@
file
:
Suppress
(
"NOTHING_TO_INLINE"
,
"unused"
)
package
net.mamoe.mirai.message.data
import
kotlinx.coroutines.Job
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.message.MessageReceipt
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
...
...
@@ -47,6 +48,31 @@ class QuoteReply(val source: MessageSource) : Message, MessageMetadata, Constrai
override
fun
contentToString
():
String
=
""
}
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
id
:
Int
get
()
=
source
.
id
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
fromId
:
Long
get
()
=
source
.
fromId
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
targetId
:
Long
get
()
=
source
.
targetId
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
originalMessage
:
MessageChain
get
()
=
source
.
originalMessage
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
time
:
Int
get
()
=
source
.
time
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
bot
:
Bot
get
()
=
source
.
bot
@JvmSynthetic
suspend
inline
fun
QuoteReply
.
recall
()
=
this
.
source
.
recall
()
...
...
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