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

Add option to mixin the chat user to an existing user class #115

Open
guenth39 opened this issue Jul 12, 2023 · 1 comment
Open

Add option to mixin the chat user to an existing user class #115

guenth39 opened this issue Jul 12, 2023 · 1 comment
Labels
feature New feature or request

Comments

@guenth39
Copy link

Is your feature request related to a problem?

We already have a production app and wanna add the chat functionality now. As we already have a "users" collection in firebase that contains the most information from your user class but with different naming, we asked us if it could be possible to somehow continue using our user class for the chat stuff. Of course, we could just start a new collection "chatUsers" or whatever with the FirebaseChatCoreConfig but that is a bit smelly as we already have the most of the information in our user class.

What solution would you suggest?

I would love to see somehow an option to continue using our user class. What could we imagine? Nice would be something like mixin, extend, implement your user class in our user class, but then we would somehow need an option to tell the chat package to use our class. That could be possible by passing the Type to the FirebaseChatCoreConfig or by providing a function to create the user object there.
That leads to the second idea we have so far. You could somehow offer the possibility to override the json serialization of the user class. Like that, we could map our field names to your existing ones. Sounds easy, but I don't know if it will be with serializable package and so on.
What do you think about this? Maybe you have already thought about that and we can adopt something from custom message?

@guenth39 guenth39 added the feature New feature or request label Jul 12, 2023
@guenth39
Copy link
Author

After thinking about it a bit over the weekend, I think it might be the easiest to give the option to specify a custom json converter for the user in the config? This should actually solve the problem easily.

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