Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fga/auto accept invite #3531

Merged
merged 5 commits into from
Jun 28, 2021
Merged

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Jun 18, 2021

This PR introduces AutoAcceptInvite. It can be enabled at compile time for now.

@ganfra ganfra requested a review from bmarty June 18, 2021 15:31
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor remarks

@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
fun entersBackground() {
compositeDisposable.clear()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never disposed then? this change is a bit weird here.
Maybe move the code from init {} to entersForeground()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope I want the invites to be accepted when the app is in background so I can receive calls.
Its just to keep a reference to the disposable so it doesn't get GC

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you will restore this line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

// also auto-join the virtual room if we have a matching native room
// (possibly we should only join if we've also joined the native room, then we'd also have
// to make sure we joined virtual rooms on joining a native one)
session.joinRoom(invitedRoomId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test the compil flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, auto join virtual room is not mandatory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you say so :)

).size
var dmInvites = 0
var roomsInvite = 0
if (!autoAcceptInvites.hideInvites) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nicer if we also had a method autoAcceptInvites.showInvites()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


interface AutoAcceptInvites {
val isEnabled: Boolean
val hideInvites: Boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default could be = isEnabled in the itf, no?
Also would be nice to add some Kdoc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes will add some.

@ganfra ganfra force-pushed the feature/fga/auto_accept_invite branch from e209f6e to 48fa9e1 Compare June 28, 2021 09:00
@bmarty bmarty merged commit 9bbe002 into develop Jun 28, 2021
@bmarty bmarty deleted the feature/fga/auto_accept_invite branch June 28, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants