Clean and add towncrier

This commit is contained in:
ganfra 2021-06-18 17:30:32 +02:00
parent 6b10406622
commit c551cf3058
6 changed files with 8 additions and 10 deletions

View File

@ -386,7 +386,4 @@ internal abstract class SessionModule {
@Binds
abstract fun bindEventSenderProcessor(processor: EventSenderProcessorCoroutine): EventSenderProcessor
}

View File

@ -0,0 +1 @@
Introduces AutoAcceptInvites which can be enabled at compile time.

View File

@ -208,7 +208,7 @@ private val autoAcceptInvites: AutoAcceptInvites)
val activeSpaceRoomId = groupingMethod.spaceSummary?.roomId
var dmInvites = 0
var roomsInvite = 0
if(!autoAcceptInvites.hideInvites) {
if (!autoAcceptInvites.hideInvites) {
dmInvites = session.getRoomSummaries(
roomSummaryQueryParams {
memberships = listOf(Membership.INVITE)

View File

@ -24,6 +24,6 @@ interface AutoAcceptInvites {
}
class CompileTimeAutoAcceptInvites @Inject constructor() : AutoAcceptInvites {
override val isEnabled = true
override val hideInvites = false
override val isEnabled = false
override val hideInvites = isEnabled
}

View File

@ -256,10 +256,10 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
}
}
is InviteNotifiableEvent -> {
if(autoAcceptInvites.hideInvites){
if (autoAcceptInvites.hideInvites) {
// Forget this event
eventIterator.remove()
}else {
} else {
invitationEvents.add(event)
}
}

View File

@ -121,9 +121,9 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp
.throttleFirst(300, TimeUnit.MILLISECONDS)
.observeOn(Schedulers.computation())
.subscribe {
val inviteCount = if(autoAcceptInvites.hideInvites){
val inviteCount = if (autoAcceptInvites.hideInvites) {
0
}else {
} else {
session.getRoomSummaries(
roomSummaryQueryParams { this.memberships = listOf(Membership.INVITE) }
).size