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
LogicalDash opened this Issue Nov 29, 2016 · 18 comments

Comments

Projects
None yet
7 participants
@LogicalDash
Contributor

LogicalDash 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

This comment has been minimized.

triplefox commented Nov 29, 2016

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

@alexgleason

This comment has been minimized.

Contributor

alexgleason commented Dec 1, 2016

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

This comment has been minimized.

triplefox commented Dec 1, 2016

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

This comment has been minimized.

Contributor

alexgleason commented Dec 1, 2016

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

This comment has been minimized.

Contributor

alexgleason commented Dec 5, 2016

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

This comment has been minimized.

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 Dec 5, 2016

@alexgleason

This comment has been minimized.

Contributor

alexgleason commented Dec 5, 2016

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

alexgleason commented Dec 6, 2016

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

alexgleason commented Dec 6, 2016

@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

This comment has been minimized.

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

This comment has been minimized.

Contributor

alexgleason commented Dec 6, 2016

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

@alexgleason

This comment has been minimized.

Contributor

alexgleason commented Mar 31, 2017

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

alexgleason commented May 4, 2017

@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.

yipdw added a commit to yipdw/mastodon that referenced this issue Jan 9, 2018

Merge pull request tootsuite#311 from glitch-soc/dont-show-solo-skins
Don't show skins selector when there's only one (tootsuite#256)
@ma1uta

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment