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
68d86a92
Commit
68d86a92
authored
Feb 07, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce _ vars
parent
ca43cf68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
95 deletions
+118
-95
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
...ommonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
+118
-95
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
View file @
68d86a92
...
@@ -20,7 +20,6 @@ import net.mamoe.mirai.qqandroid.utils.toIpV4AddressString
...
@@ -20,7 +20,6 @@ import net.mamoe.mirai.qqandroid.utils.toIpV4AddressString
import
net.mamoe.mirai.utils.*
import
net.mamoe.mirai.utils.*
import
net.mamoe.mirai.utils.io.toUHexString
import
net.mamoe.mirai.utils.io.toUHexString
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.CoroutineContext
import
kotlin.properties.Delegates
internal
abstract
class
ContactImpl
:
Contact
{
internal
abstract
class
ContactImpl
:
Contact
{
override
fun
hashCode
():
Int
{
override
fun
hashCode
():
Int
{
...
@@ -51,6 +50,7 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
...
@@ -51,6 +50,7 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
)
{
"send message failed"
}
)
{
"send message failed"
}
}
}
}
}
override
suspend
fun
uploadImage
(
image
:
ExternalImage
):
Image
=
try
{
override
suspend
fun
uploadImage
(
image
:
ExternalImage
):
Image
=
try
{
bot
.
network
.
run
{
bot
.
network
.
run
{
val
response
=
LongConn
.
OffPicUp
(
val
response
=
LongConn
.
OffPicUp
(
...
@@ -129,8 +129,8 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
...
@@ -129,8 +129,8 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
internal
class
MemberImpl
(
internal
class
MemberImpl
(
qq
:
QQImpl
,
qq
:
QQImpl
,
initG
roupCard
:
String
,
var
_g
roupCard
:
String
,
initS
pecialTitle
:
String
,
var
_s
pecialTitle
:
String
,
group
:
GroupImpl
,
group
:
GroupImpl
,
override
val
coroutineContext
:
CoroutineContext
,
override
val
coroutineContext
:
CoroutineContext
,
override
val
permission
:
MemberPermission
override
val
permission
:
MemberPermission
...
@@ -138,32 +138,36 @@ internal class MemberImpl(
...
@@ -138,32 +138,36 @@ internal class MemberImpl(
override
val
group
:
GroupImpl
by
group
.
unsafeWeakRef
()
override
val
group
:
GroupImpl
by
group
.
unsafeWeakRef
()
val
qq
:
QQImpl
by
qq
.
unsafeWeakRef
()
val
qq
:
QQImpl
by
qq
.
unsafeWeakRef
()
override
var
groupCard
:
String
override
var
groupCard
:
String
by
Delegates
.
observable
(
initGroupCard
)
{
_
,
old
,
new
->
get
()
=
_groupCard
set
(
newValue
)
{
group
.
checkBotPermissionOperator
()
group
.
checkBotPermissionOperator
()
if
(
new
!=
old
)
{
if
(
_groupCard
!=
newValue
)
{
_groupCard
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
EditGroupNametag
(
TroopManagement
.
EditGroupNametag
(
bot
.
client
,
bot
.
client
,
this
@MemberImpl
,
this
@MemberImpl
,
new
newValue
).
sendWithoutExpect
()
).
sendWithoutExpect
()
}
}
}
}
}
}
}
}
override
var
specialTitle
:
String
by
Delegates
.
observable
(
initSpecialTitle
)
{
_
,
old
,
new
->
override
var
specialTitle
:
String
get
()
=
_specialTitle
set
(
newValue
)
{
group
.
checkBotPermissionOperator
()
group
.
checkBotPermissionOperator
()
if
(
new
!=
old
)
{
if
(
_specialTitle
!=
newValue
)
{
_specialTitle
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
EditSpecialTitle
(
TroopManagement
.
EditSpecialTitle
(
bot
.
client
,
bot
.
client
,
this
@MemberImpl
,
this
@MemberImpl
,
new
newValue
).
sendWithoutExpect
()
).
sendWithoutExpect
()
}
}
}
}
...
@@ -233,19 +237,22 @@ internal class GroupImpl(
...
@@ -233,19 +237,22 @@ internal class GroupImpl(
bot
:
QQAndroidBot
,
override
val
coroutineContext
:
CoroutineContext
,
bot
:
QQAndroidBot
,
override
val
coroutineContext
:
CoroutineContext
,
override
val
id
:
Long
,
override
val
id
:
Long
,
val
uin
:
Long
,
val
uin
:
Long
,
initN
ame
:
String
,
var
_n
ame
:
String
,
initA
nnouncement
:
String
,
var
_a
nnouncement
:
String
,
initA
llowMemberInvite
:
Boolean
,
var
_a
llowMemberInvite
:
Boolean
,
initC
onfessTalk
:
Boolean
,
var
_c
onfessTalk
:
Boolean
,
initM
uteAll
:
Boolean
,
var
_m
uteAll
:
Boolean
,
initA
utoApprove
:
Boolean
,
var
_a
utoApprove
:
Boolean
,
initA
nonymousChat
:
Boolean
,
var
_a
nonymousChat
:
Boolean
,
override
val
members
:
ContactList
<
Member
>
override
val
members
:
ContactList
<
Member
>
)
:
ContactImpl
(),
Group
{
)
:
ContactImpl
(),
Group
{
override
var
name
by
Delegates
.
observable
(
initName
)
{
_
,
oldValue
,
newValue
->
override
var
name
:
String
get
()
=
_name
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
this
.
checkBotPermissionOperator
()
if
(
oldValue
!=
newValue
)
{
if
(
_name
!=
newValue
)
{
_name
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
GroupOperation
.
name
(
TroopManagement
.
GroupOperation
.
name
(
...
@@ -258,9 +265,12 @@ internal class GroupImpl(
...
@@ -258,9 +265,12 @@ internal class GroupImpl(
}
}
}
}
override
var
announcement
:
String
by
Delegates
.
observable
(
initAnnouncement
)
{
_
,
oldValue
,
newValue
->
override
var
announcement
:
String
get
()
=
_announcement
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
this
.
checkBotPermissionOperator
()
if
(
oldValue
!=
newValue
)
{
if
(
_announcement
!=
newValue
)
{
_announcement
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
GroupOperation
.
memo
(
TroopManagement
.
GroupOperation
.
memo
(
...
@@ -274,9 +284,12 @@ internal class GroupImpl(
...
@@ -274,9 +284,12 @@ internal class GroupImpl(
}
}
override
var
allowMemberInvite
:
Boolean
by
Delegates
.
observable
(
initAllowMemberInvite
)
{
_
,
oldValue
,
newValue
->
override
var
allowMemberInvite
:
Boolean
get
()
=
_allowMemberInvite
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
this
.
checkBotPermissionOperator
()
if
(
oldValue
!=
newValue
)
{
if
(
_allowMemberInvite
!=
newValue
)
{
_allowMemberInvite
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
GroupOperation
.
allowMemberInvite
(
TroopManagement
.
GroupOperation
.
allowMemberInvite
(
...
@@ -289,17 +302,24 @@ internal class GroupImpl(
...
@@ -289,17 +302,24 @@ internal class GroupImpl(
}
}
}
}
override
var
autoApprove
:
Boolean
by
Delegates
.
observable
(
initAutoApprove
)
{
_
,
oldValue
,
newValue
->
override
var
autoApprove
:
Boolean
TODO
(
"Group.autoApprove implementation"
)
get
()
=
_autoApprove
set
(
newValue
)
{
TODO
()
}
}
override
val
anonymousChat
:
Boolean
by
Delegates
.
observable
(
initAnonymousChat
)
{
_
,
oldValue
,
newValue
->
override
var
anonymousChat
:
Boolean
TODO
(
"Group.anonymousChat implementation"
)
get
()
=
_anonymousChat
set
(
newValue
)
{
TODO
()
}
}
override
var
confessTalk
:
Boolean
by
Delegates
.
observable
(
initConfessTalk
)
{
_
,
oldValue
,
newValue
->
override
var
confessTalk
:
Boolean
get
()
=
_confessTalk
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
this
.
checkBotPermissionOperator
()
if
(
oldValue
!=
newValue
)
{
if
(
_confessTalk
!=
newValue
)
{
_confessTalk
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
GroupOperation
.
confessTalk
(
TroopManagement
.
GroupOperation
.
confessTalk
(
...
@@ -313,9 +333,12 @@ internal class GroupImpl(
...
@@ -313,9 +333,12 @@ internal class GroupImpl(
}
}
override
var
muteAll
:
Boolean
by
Delegates
.
observable
(
initMuteAll
)
{
_
,
oldValue
,
newValue
->
override
var
muteAll
:
Boolean
get
()
=
_muteAll
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
this
.
checkBotPermissionOperator
()
if
(
oldValue
!=
newValue
)
{
if
(
_muteAll
!=
newValue
)
{
_muteAll
=
newValue
launch
{
launch
{
bot
.
network
.
run
{
bot
.
network
.
run
{
TroopManagement
.
GroupOperation
.
muteAll
(
TroopManagement
.
GroupOperation
.
muteAll
(
...
...
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