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

Integration ability #89

Open
tmolitor-stud-tu opened this issue Sep 8, 2024 · 3 comments
Open

Integration ability #89

tmolitor-stud-tu opened this issue Sep 8, 2024 · 3 comments

Comments

@tmolitor-stud-tu
Copy link

I'm trying to integrate your Chat UI into Monal, an open source XMPP chat app (https://github.com/monal-im/Monal).

While doing so, I've noticed, that your data models (Message, User etc.) are structs rather than protocols implemented by structs or classes.

That makes it very difficult to extend/change the behavior of those models, because structs can not inherit from other structs, but only from protocols and extensions for a struct aren't allowed to add stored properties. (https://stackoverflow.com/a/56183391)

I'm planning to change the model structs to classes and create a pull request.
Is such a PR (and generally other PRs improving things if I come along them) welcome in this project or not?

(I don't want to invest time if it's clear from the outset that my prs won't be merged anyway.)

@f3dm76
Copy link
Collaborator

f3dm76 commented Sep 8, 2024

Hey @tmolitor-stud-tu, yes, PRs are welcome and well appreciated. I agree protocols would be much better than structs, but I remember I encountered some swiftUI specific problems while trying to implements it through protocols or classes, however I don't remember the specifics. So if you manage to make it work, without changing the API too much, that would be simply wonderful. Have a brilliant day!

@tmolitor-stud-tu
Copy link
Author

Great, I'll give it a go then! :)

@tmolitor-stud-tu
Copy link
Author

I'm trying something seemingly simple like having my User model return a UIKit UIImage or SwiftUI Image as avatar image instead of providing an URL (in Monal everything is already downloaded and cached etc. and our internal API already returns a proper UIImage).
The goal would be to do this without having to rewrite or copy over a huge portion of Views from ExyteChat to Monal.

But this seems nearly impossible given that, for example, the ChatMessageView, MessageView etc. are all not public and very interlinked.

I'm not sure if I'll manage to make this "simple" task possible without rewriting most of your code :(

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

No branches or pull requests

2 participants