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

Only call createRoom when user sends message? #104

Open
giorgio79 opened this issue Feb 12, 2023 · 3 comments
Open

Only call createRoom when user sends message? #104

giorgio79 opened this issue Feb 12, 2023 · 3 comments
Labels
feature New feature or request

Comments

@giorgio79
Copy link
Contributor

Hey,

In the example, I noticed createRoom is called when the user taps on another one at https://github.com/flyerhq/flutter_firebase_chat_core/blob/main/example/lib/users.dart

I use this logic in my app, and noticed Firestore is littered with empty rooms as the user just looks at the chat page and then leaves.

Would it be easy to move this logic on chat send call? Eg user sends chat and check is made if room exists already, and add the message there, otherwise create room?

@giorgio79 giorgio79 added the feature New feature or request label Feb 12, 2023
@giorgio79
Copy link
Contributor Author

Ah notice this feature request came up before #28

@giorgio79
Copy link
Contributor Author

So the chat screen needs a room id for the chat list stream, so unsure if we can postpone room creation on first message send. https://github.com/flyerhq/flutter_firebase_chat_core/blob/main/example/lib/chat.dart

@giorgio79
Copy link
Contributor Author

PS Happy to sponsor this issue, ping me at [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant