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

Matrix integration #311

Closed
clayote opened this issue Nov 29, 2016 · 25 comments
Closed

Matrix integration #311

clayote opened this issue Nov 29, 2016 · 25 comments

Comments

@clayote
Copy link
Contributor

clayote commented Nov 29, 2016

As an alternative to direct messages and whatnot, let server admins hook your Mastodon profile into a Matrix server running locally, such that the Mastodon user @LogicalDash@mastodon.social is also the Matrix user @LogicalDash:mastodon.social -- and/or, let the user link their own Matrix account on a different server with their Mastodon account.

Then add user interface bits to make it easy to switch between the protocols...

  1. Simple link on user profile that starts a chat with this user in another window via http://riot.im
  2. Embedded chat in the same window
@triplefox
Copy link

This will do a lot to solve people's concerns over privacy!

@alexgleason
Copy link
Contributor

I think this makes a lot of sense. A lot of people want direct messages and Matrix seems like a great thing to explore.

@triplefox
Copy link

This comment is more speculative in nature than most of the ones I post in issue threads, but I think it goes here.

As I'm reading more about Matrix the thought comes to mind that it might actually be a healthier federation platform than GNUSocial, overall. The difference is that while GS is application-centric(making the specific features of a social network decentralized) and has accumulated its technical lessons through the slings and arrows of outrageous fortune, Matrix has a more ground-up ambitious goal of being able to bridge to all sorts of protocols, including existing social networks, IRC, Telegram, XMPP, IOT systems, etc. It's a more generalized technology, and it enjoys commercial backing and the ecosystem benefits that come with that. A lot of the features we might want are receiving consideration there, too.

What this means for Mastodon, architecturally speaking, is that one path the technology could take is to build towards a Matrix-centric implementation while retaining roots in this one through bridging. At that point, we enter an era with a potential diversity of social networks, each with their small quirks and variations, but all mostly accessible from one another. At the end of the day, as long as we have our federated network and the technical underpinnings are stable, the particulars don't matter.

@alexgleason
Copy link
Contributor

I thought I understood Matrix, but I don't. What's the practical next step for getting direct messaging to work in Mastodon?

I thought Matrix was only a chat platform. Now I am intrigued, but I have even more questions than before.

I don't think GNU Social supports direct messaging, so incorporating a solution will have to involve using a different piece of software that bridges with Mastodon. What would that software be, Matrix-based or not?

@alexgleason
Copy link
Contributor

Here is more information about Matrix. https://matrix.org/docs/guides/faq.html

From my understanding, it is a chat platform. See "The difference between Matrix and XMPP."

In theory XMPP can be used in a more general way too, but that doesn't mean it will be or should be. Matrix and XMPP just send plain text from one resource to another. Of course, that text could be on any format (JSON, YAML, Python source code, whatever), and you could rig up a system to handle messages however you want.

I think the developers of Matrix just want you to know its theoretical potential whether it should be used that way is a different story. For Mastodon, I could see it handling the server-to-server communications since it stores a history of interactions. But maybe that's overkill when we can do the same thing using HTTP without much trouble.

For a chat platform, though, it probably makes sense.

@Gargron
Copy link
Member

Gargron commented Dec 5, 2016

I think this is rather out of scope for Mastodon. Integrated chat will always be worse than a program that is dedicated to chats; coupling Mastodon with one more technology will be a hit on maintainability and ease of self-hosting. I don't see myself investing time into a Matrix integration any time soon. Sorry.

@Gargron Gargron closed this as completed Dec 5, 2016
@alexgleason
Copy link
Contributor

Cool, I agree it's out of scope for Mastodon, sort of. First the community needs to build a bridge between Matrix and Mastodon's local user profiles. If that works, it might make sense to allow server admins to enable some sort of generic UI element to guide people on how direct messaging works from within Mastodon.

@ara4n
Copy link

ara4n commented Dec 6, 2016

@Gargron, all: just to be clear - Matrix isn't a chat platform; it's just an open federated object database with realtime pubsub semantics. You could publish content from gnusocial or mastodon into it, or receive it for that matter. And yes, you could also use it for chat, or VoIP, or whatever other data sharing you needed. In return, you get bleeding edge E2E encryption and the ability to hook up to the whole Matrix ecosystem of clients, bots, bridges, integrations etc.

I completely sympathise with the project itself not wanting to write an integration/bridge to Matrix, but I hope that someone from the mastodon community picks it up. (That said, i'm biased, given i work on Matrix :)

@alexgleason
Copy link
Contributor

@ara4n Thank you for chiming in!

I'm still a bit unclear about how it all works, but it's getting slightly clearer. I stand corrected. I think the video on https://riot.im/ shows a good visualization of Matrix's goals.

I'm excited about the potential, but having difficulty understanding all the capabilities.

@ara4n
Copy link

ara4n commented Dec 6, 2016

The simplest way of thinking of it is being like Git, but for realtime data. The animation at the bottom of https://matrix.org might be more illuminating. You basically do an HTTP PUT to a Matrix server with a blob of JSON; that server signs it into a Merkle DAG and PUTs it out to the other servers participating in the room. Other clients on the participating servers receive it (via long-lived HTTP GET or whatever), and the game continues. It's just an openly federated JSON db. Data integrity is maintained through the signatures in the Merkle DAG (and signatures on federation traffic) - and end-to-end encryption is provided by Olm (https://matrix.org/git/olm/about) - our own implementation of Signal's double ratchet. https://matrix.org/blog/2016/11/21/matrixs-olm-end-to-end-encryption-security-assessment-released-and-implemented-cross-platform-on-riot-at-last/ has painful amounts of detail about where we're at with E2E.

@ara4n
Copy link

ara4n commented Dec 6, 2016

Oh, and in terms of capabilities: right now we've defined schemas for room membership, IM and VoIP datatypes. Threaded messaging is on the horizon though, complete with bridges to stuff like SMTP, IMAP, NNTP, twitter, GNU Social etc. At which point it might become a bit more relevant to mastodon!

@alexgleason
Copy link
Contributor

@ara4n Thank you! This clear a lot up, especially the graph on the Matrix homepage, and understanding that data is sent in JSON.

I also found this document which explains how "rooms" work, as well as all the other built-in Matrix objects.

I'm wondering about the room concept in relation to Mastodon. All of Mastodon's events take place within a single "room". It seems like rooms can theoretically be used for anything. They could represent different database tables, or multiple channels of the same type of object (like IRC rooms). I'm not sure how this abstract concept can translate into bridging everything together in a meaningful way. Ideally a "room" would mean the same thing for every platform, right?

@ara4n
Copy link

ara4n commented Dec 6, 2016

So a 'room' in Matrix is analogous to an IRC channel - it's a place with a bunch of connected users (which may be human, bots, or whatever), a set of arbitrary key/value information (e.g. the name of the room), and a timeline of arbitrary conversation data.

When bridging into something with twitter-style semantics, so far we've gone and created rooms to represent all the various 'views' of that world - e.g. a room per hashtag, a room per username, etc. Messages may end up getting duplicated across multiple rooms (e.g. if they have multiple hashtags or multiple mentions) but this isn't the end of the world. One of our GSoC projects this year was in fact building a twitter bridge with this sort of behaviour: https://half-shot.github.io/matrix-appservice-twitter. (Currently duplicated messages aren't factored out, but in future we plan to do this, much like git factors out duplicate content).

Obviously there are many different ways to solve this problem though - and once threading lands in Matrix we may well see the ability for threads to span rooms, or rooms to be derived from sections of thread, or the so-called "multi-DAG" architecture where there's one set of global messages tied together into multiple different DAGs to create different rooms or views. But we're not there yet :)

@alexgleason
Copy link
Contributor

Thank you for clarifying! I'm very excited to see where Matrix goes. 😃

@clayote clayote mentioned this issue Jan 9, 2017
@alexgleason
Copy link
Contributor

Since reading this post I have been using and experimenting with Matrix. It's fantastic. It is more than just a chat platform, but chat is currently its most widespread use case.

The definitive Matrix server is called Synapse. If you set up Synapse on your server, people on Matrix can send you messages on a custom domain. I might be @alex:animalliberation.social.

Just a thought, but it would be very very cool for Synapse and Mastodon to share user accounts. I'm not sure how to do that... both have robust APIs so maybe one could authenticate through the other? Or maybe they could both enable LDAP integration.

I don't think there's any question that direct chatting with users is a very important part of a social network. With chat and microblogging together all we are missing is events to match Facebook's features.

@alxlg
Copy link

alxlg commented May 3, 2017

Just FYI, on disroot.org this is done with Matrix and Diaspora (one account to get e-mail address, diaspora account, Matrix one and other services).
Also, afaik the "@user:domain.com" syntax in Matrix is intended just for inner use. The users shouldn't be aware of that. Instead, you can find other users with 3PID (3th party IDs) like e-mail address or phone number. So ideally also a Mastodon ID could be a 3PID.

@alexgleason
Copy link
Contributor

@alxlg Thank you! This is just one more piece to the puzzle. Disroot is using PWM and LDAP. If we can get LDAP support for Mastodon it will be possible to combine these.

hannahwhy added a commit to hannahwhy/mastodon that referenced this issue Jan 9, 2018
Don't show skins selector when there's only one (mastodon#256)
@ma1uta
Copy link

ma1uta commented Jun 16, 2018

Sorry for posting in an old issue. I wrote matrix <=> mastodon bridge https://github.com/ma1uta/mxtoot where you can add a bot in the matrix which can toot messages, reply and boost statuses.

@du-song
Copy link

du-song commented Apr 19, 2021

Also borrow this old issue and share a tiny little self service tool to create Matrix account for Mastodon users with same id: https://github.com/freewizard/fediverse-matrix-keygen

This is meant to be a lightweight stop-gap solution, before an official LDAP and/or OpenID in Mastodon, or support of AP acct as 3P ID in Matrix Identity Server.

@mulles
Copy link

mulles commented Apr 27, 2022

@ara4n this issue might have a higher relevance today because of the twitter acquisition happening right now. And the interesting activity happening on mastodon, as some interesting personalities (@janboehm@mastodon.social) are discovering it :)
I was happy discovering that mastodon.matrix.org exists.

But https://github.com/ma1uta/mxtoot does not seems very active :)

A good integration/bridging of both rising projects might the dream of interoperability coming true :) And with threads best time to get it right. You made integrated gitter in short time , you can do it with mastodon ;)

Good Luck and fun :)

@schrmh
Copy link

schrmh commented Apr 28, 2022

@Gargron I'd like to hear your stance on this in 2022 (especially since you only commented once and that was when people thought that Matrix was about chat only).
Matrix is way more mature than back in 2016 and many things like threading are real now. It is important enough (has around 50 million users and as you might know it will play an important role especially in germany: it will be used in by the gematik as well as Schleswig-Holstein and it is used by the Bundeswehr already). I feel like it is only a matter of time until someone creates a Matrix client that looks and feels like a client for a popular social network service...

So is there potentially a road for Matrix and Mastodon to come closer together?

@Ericson2314
Copy link

It would be especially interesting of one of them attains the long-wished goal of having user accounts that are not tied to a specific instance/homeserver.

@HammyHavoc
Copy link

@Gargron I'd like to hear your stance on this in 2022 (especially since you only commented once and that was when people thought that Matrix was about chat only).
Matrix is way more mature than back in 2016 and many things like threading are real now. It is important enough (has around 50 million users and as you might know it will play an important role especially in germany: it will be used in by the gematik as well as Schleswig-Holstein and it is used by the Bundeswehr already). I feel like it is only a matter of time until someone creates a Matrix client that looks and feels like a client for a popular social network service...

So is there potentially a road for Matrix and Mastodon to come closer together?

There are Matrix clients now that mimic social networks. Just so you know. Several projects I've seen, including a Facebook-like.

@thecyberd3m0n
Copy link

thecyberd3m0n commented Jan 1, 2023

I see 2 important features here

  1. when user creates account @john@fediverse.server on my instance, I would like him to force to also create Matrix account on my synapse (:john:chat.fediverse.server). It may be simple redirect after mail verification.

  2. I would like to put "direct message" button at his profile which will other redirect user to Element client to contact him.

@du-song
Copy link

du-song commented Jan 5, 2023

@thecyberd3m0n very close but not exactly same as you described, I built a small tool to allow your Mastodon users to create Matrix accounts with same id: https://github.com/freewizard/fediverse-matrix-keygen

ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this issue Jul 6, 2023
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