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
9b7b38f3
Commit
9b7b38f3
authored
Nov 16, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify docs
parent
7ad8f4e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+19
-9
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
9b7b38f3
...
@@ -137,14 +137,7 @@ open class QQ internal constructor(bot: Bot, id: UInt) : Contact(bot, id) {
...
@@ -137,14 +137,7 @@ open class QQ internal constructor(bot: Bot, id: UInt) : Contact(bot, id) {
/**
/**
* 更新个人资料.
* 更新个人资料.
*
* 将会同步更新 property [profile]
* 这个方法会尽可能更新已有的 [Profile] 对象的值, 而不是用新的对象替换
* 若 [QQ.profile] 已经初始化, 则在获取到新的 profile 时通过 [Profile.copyFrom] 来更新已有的 [QQ.profile]. 仍然返回 [QQ.profile]
* 因此, 对于以下代码:
* ```kotlin
* val old = qq.profile
* qq.updateProfile() === old // true, 因为只是更新了 qq.profile 的值
* ```
*/
*/
suspend
fun
updateProfile
():
Profile
=
bot
.
withSession
{
suspend
fun
updateProfile
():
Profile
=
bot
.
withSession
{
_profile
=
RequestProfileDetailsPacket
(
bot
.
qqAccount
,
id
,
sessionKey
)
_profile
=
RequestProfileDetailsPacket
(
bot
.
qqAccount
,
id
,
sessionKey
)
...
@@ -205,7 +198,24 @@ data class Profile(
...
@@ -205,7 +198,24 @@ data class Profile(
val
homepage
:
String
?,
val
homepage
:
String
?,
val
email
:
String
?,
val
email
:
String
?,
val
company
:
String
?
val
company
:
String
?
)
)
{
override
fun
toString
():
String
=
"Profile(qq=$qq, "
+
"nickname=$nickname, "
+
"gender=$gender, "
+
(
englishName
?.
plus
(
"englishName=$englishName, "
)
?:
""
)
+
(
chineseName
?.
plus
(
"chineseName=$chineseName, "
)
?:
""
)
+
(
qAge
?.
toString
()
?.
plus
(
"qAge=$qAge, "
)
?:
""
)
+
(
zipCode
?.
plus
(
"zipCode=$zipCode, "
)
?:
""
)
+
(
phone
?.
plus
(
"phone=$phone, "
)
?:
""
)
+
(
birthday
?.
toString
()
?.
plus
(
"birthday=$birthday, "
)
?:
""
)
+
(
personalStatement
?.
plus
(
"personalStatement=$personalStatement, "
)
?:
""
)
+
(
school
?.
plus
(
"school=$school, "
)
?:
""
)
+
(
homepage
?.
plus
(
"homepage=$homepage, "
)
?:
""
)
+
(
email
?.
plus
(
"email=$email, "
)
?:
""
)
+
(
company
?.
plus
(
"company=$company?,"
)
?:
""
)
+
")"
// 最终会是 ", )", 但这并不影响什么.
}
/**
/**
* 性别
* 性别
...
...
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