Ignore old Group settings. Fix #373

This commit is contained in:
Him188 2020-06-16 15:20:33 +08:00
parent 245d52149e
commit 877a8efed3

View File

@ -129,7 +129,7 @@ internal class GroupImpl(
get() = _announcement get() = _announcement
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
if (_announcement != newValue) { //if (_announcement != newValue) {
val oldValue = _announcement val oldValue = _announcement
_announcement = newValue _announcement = newValue
launch { launch {
@ -142,7 +142,7 @@ internal class GroupImpl(
} }
GroupEntranceAnnouncementChangeEvent(oldValue, newValue, this@GroupImpl, null).broadcast() GroupEntranceAnnouncementChangeEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
} //}
} }
@ -150,7 +150,7 @@ internal class GroupImpl(
get() = _allowMemberInvite get() = _allowMemberInvite
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
if (_allowMemberInvite != newValue) { //if (_allowMemberInvite != newValue) {
val oldValue = _allowMemberInvite val oldValue = _allowMemberInvite
_allowMemberInvite = newValue _allowMemberInvite = newValue
launch { launch {
@ -163,7 +163,7 @@ internal class GroupImpl(
} }
GroupAllowMemberInviteEvent(oldValue, newValue, this@GroupImpl, null).broadcast() GroupAllowMemberInviteEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
} //}
} }
override var isAutoApproveEnabled: Boolean override var isAutoApproveEnabled: Boolean
@ -180,34 +180,34 @@ internal class GroupImpl(
TODO() TODO()
} }
@Suppress("OverridingDeprecatedMember")
override var isConfessTalkEnabled: Boolean override var isConfessTalkEnabled: Boolean
get() = _confessTalk get() = _confessTalk
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
if (_confessTalk != newValue) { //if (_confessTalk != newValue) {
val oldValue = _confessTalk val oldValue = _confessTalk
_confessTalk = newValue _confessTalk = newValue
launch { launch {
bot.network.run { bot.network.run {
TroopManagement.GroupOperation.confessTalk( TroopManagement.GroupOperation.confessTalk(
client = bot.client, client = bot.client,
groupCode = id, groupCode = id,
switch = newValue switch = newValue
).sendWithoutExpect() ).sendWithoutExpect()
}
GroupAllowConfessTalkEvent(oldValue, newValue, this@GroupImpl, true).broadcast()
} }
GroupAllowConfessTalkEvent(oldValue, newValue, this@GroupImpl, true).broadcast()
} }
// }
} }
override var isMuteAll: Boolean override var isMuteAll: Boolean
get() = _muteAll get() = _muteAll
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
if (_muteAll != newValue) { //if (_muteAll != newValue) {
val oldValue = _muteAll val oldValue = _muteAll
_muteAll = newValue _muteAll = newValue
launch { launch {
@ -220,7 +220,7 @@ internal class GroupImpl(
} }
GroupMuteAllEvent(oldValue, newValue, this@GroupImpl, null).broadcast() GroupMuteAllEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
} //}
} }
} }