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
0c49d8c9
Commit
0c49d8c9
authored
Nov 28, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add val idContentString
parent
72d95410
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+11
-1
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
0c49d8c9
...
@@ -59,13 +59,23 @@ inline fun <R> Contact.withSession(block: BotSession.() -> R): R {
...
@@ -59,13 +59,23 @@ inline fun <R> Contact.withSession(block: BotSession.() -> R): R {
/**
/**
* 只读联系人列表
* 只读联系人列表
*/
*/
class
ContactList
<
C
:
Contact
>
internal
constructor
(
internal
val
delegate
:
MutableContactList
<
C
>)
:
Map
<
UInt
,
C
>
by
delegate
{
class
ContactList
<
C
:
Contact
>
@PublishedApi
internal
constructor
(
internal
val
delegate
:
MutableContactList
<
C
>)
:
Map
<
UInt
,
C
>
by
delegate
{
/**
* ID 列表的字符串表示.
* 如:
* ```
* [123456, 321654, 123654]
* ```
*/
val
idContentString
:
String
get
()
=
this
.
keys
.
joinToString
(
prefix
=
"["
,
postfix
=
"]"
)
{
it
.
toLong
().
toString
()
}
override
fun
toString
():
String
=
delegate
.
toString
()
override
fun
toString
():
String
=
delegate
.
toString
()
}
}
/**
/**
* 可修改联系人列表. 只会在内部使用.
* 可修改联系人列表. 只会在内部使用.
*/
*/
@PublishedApi
internal
class
MutableContactList
<
C
:
Contact
>
:
MutableMap
<
UInt
,
C
>
by
mutableMapOf
()
{
internal
class
MutableContactList
<
C
:
Contact
>
:
MutableMap
<
UInt
,
C
>
by
mutableMapOf
()
{
override
fun
toString
():
String
=
asIterable
().
joinToString
(
separator
=
", "
,
prefix
=
"ContactList("
,
postfix
=
")"
)
{
it
.
value
.
toString
()
}
override
fun
toString
():
String
=
asIterable
().
joinToString
(
separator
=
", "
,
prefix
=
"ContactList("
,
postfix
=
")"
)
{
it
.
value
.
toString
()
}
}
}
\ No newline at end of file
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