I would bet my left hand that it’s possible, but is it feasible to use Matrix for the messaging? Or is this simply out the scope for the project?
So the protocol is way, way different and massively out of scope to actually reimplement, so it would never make sense to have chugging along within the Lemmy backend server itself.
However, embedding Matrix rooms in webpages is something the Matrix devs want to make more straightforward (Gitter does this nicely and they’re shooting to subsume all of its functionality) so it’s not too hard to imagine some kind of integration with a. a separate Matrix server that gives permissions to b. a Matrix bot to manage creation of new rooms c. UI extensions to show this alongside communities.
However!
Lemmy is deceptively shiny and awesome, but there’s still a lot of way more high-priority stuff that needs doing before this kind of huge feature extension is even discussed seriously, so the devs need to focus on that kind of thing.
Once the Element devs get embedded rooms a bit further down the road, this seems like a really doable project for a motivated Lemmy user to try adding on, though!
It would probably be possible to embed a Matrix client into a Lemmy instance by way of Hydrogen Web or https://cactus.chat, but automatically giving each Lemmy instance user their own Matrix account tied to their Lemmy account would be much harder and would require hosting an entire Matrix instance alongside Lemmy.
maybe thats not necessary, perhaps something like granting your matrix account acess to the lemmy website and then it would obly connect to the servers without the need of having to host an instance
the problem is Lemmy works on a different protocol. Matrix clients can’t handle ActivityPub data.
I was thinking more of a solution with cactus chat. I don’t know how much work it would be to tie that into a PM system but it would be cool to be able to message people on Matrix without leaving the site!
With XMPP this would be relatively easy by adding a project like ConverseJS or JSXC to lemmy-ui. Basically something that can be done right now with minimal code changes.
However maybe it would be interesting to add a simple addon system to Lemmy?
Please, ConverseJS no. Anything but not that.
I have suffered the bad rendering and delays in many instances in last version in Firefox ESR and UXP-based browsers.
It is a complete nightmare.
already implemented. if you add your Matrix address in your user profile, other users will see a button to contact you via Matrix
This is just a link, I’m thinking about making a UI within Lemmy itself to chat using Matrix.
To be frank I don’t see the advantage here. A project dedicated to making a good chat client will almost certianly make a better tool than lemmy trying to make a discussion form. It seems much better to keep the two features separate and let each project focus on itself.
i think that even if the developers had the time and resources to do that, they would consider it out of scope. there’s no reason alternative clients can’t do it though
I hope the opposite i.e. using Matrix protocol for federation instead of ActivityPub, this would solve a lot of problems with federation and enable chats like you wish.
What problems would this solve with federation? Seems like it would cut us off from sites like Mastodon
Did you not realize that if your instance has not yet interacted with another and you want to see the profile of a user you will never see his old posts but you will only receive new ones if you click “follow”? Or the busted counters that are different depending on how your instance is connected to the others? Practically with ActivityPub the information hardly spreads, with Matrix you have the assured consistency.
And then the Access Control Lists, they are not supported by ActivityPub so no stuff like private groups. When it comes to Matrix,they are built-in.
And Matrix defines APIs for both server-to-server federation and client-server communication, while ActivityPub is currently only used for federation. Client-server ActivityPub APIs have been discarded in favor of thin-client APIs such as Mastodon’s.
Matrix continually adds new features. ActivityPub is stopped and too generic, it could be expanded in many ways for different use cases but each group of people works on it separately and for now without big results (see ForgeFed).
Lemmy’s goal is to be a link aggregator for the Fediverse, switching to the Matrix protocol would completely abandon that. Switching is simply out of question for the project as far as I know. Lemmy is also not even close to a finished product yet so current issues with federation are expected.
I’m not talking about Lemmy, but the entire Fediverse. Matrix is not for instant messaging only, as its authors keep saying. Matrix is basically a decentralized database for real-time content with permissions and end-to-end encryption built-in. ActivityPub is good only for public content and can’t guarantee a modern user experience when it comes to federation, as I said as the network grows it adds inconsistencies and common users are confused by it.
P.S. nothing stops someone from implementing both Matrix and ActivityPub on the same server: the former to federate with other Matrix servers and the latter to keep the federation with Mastodon & Co.