Is your feature request related to a problem? Please describe.
Currently there is only one Account relaying messages and that works, but it's not really nice for mentions etc...
Describe the solution you'd like
At least XMPP and Matrix support so called "puppets", where the bridge could spawn a user in the room for every user from the other side of the gateway. It let it more feel like a real guy on the same protocol.
Could you give a pointer to the documentation about xmpp and matrix supporting this?
I'm not so into Matrix so I don't know how it works there...
But in XMPP you will need some External Component to implement this... but could be too much work
There is a go based bridge that does this on IRC (from Discord):
https://github.com/qaisjp/go-discord-irc
The author even expressed interest in adding this feature to Matterbridge @qaisjp
lol hi, see #667, i still plan to work on this _eventually_. i currently use matterbridge everywhere except the server that needs puppets
https://github.com/jlu5/PyLink
Another example of a nicely working IRC puppeteering bridge
It would be great if we can get this on Matrix!
@LucesEnBabel it is great in every protocol where it is theoretically possible....
Moved here: https://github.com/42wim/matterbridge/issues/667#issuecomment-616489817
Proposal to implement it via webooks in XMPP (Prosody only):
https://github.com/42wim/matterbridge/issues/1082
Not that nice, because it's a non standard thing...
Yeah, but it reuses existing already implemented code and can be a temporary solution. Because let's be realistic, a full xmpp component isn't coming anytime soon.
There's no need for webhooks to do do puppetting in xmpp. Because of a quirk of how xmpp was designed, a single xmpp connection can join a groupchat any number of times under any number of names. You can try this out yourself: just sign on in two apps then join the same groupchats in them, but pick different nicknames when you do: you'll show up as two people. Some apps will even happily let you join the same room multiple times under multiple names (not Conversations though, which is probably for the best).
To do this, matterbridge just needs to be sending stanzas like this:
<presence from='[email protected]' to='[email protected]/alice' />
<message from='[email protected]/alice' to='[email protected]/'>
<body> ..... </body>
</message>
to spoof a different user, just do
<message from='[email protected]/bob' to='[email protected]/'>
<body> ..... </body>
</message>
The full spec is here: https://xmpp.org/extensions/xep-0045.html
I'm not 100% sure about this, but I don't think you even need to send the initial presence for the messages to go through. Presence is fairly optional in xmpp.
@kousu first the presence is not optional in MUCs and you need to send it for every Nick you want because that is how you join a room in XMPP and usually you can't write in a MUC if you aren't joined.... the server will throw an error for this.
Second: I also tough about going the way with one JID and multiple nicks but it's actually not the right way to do this... you wan't to do this via a component (https://xmpp.org/extensions/xep-0114.html) and a JID at this component for every user. But this will definitely need server support because you have to configure components on the XMPP Server.
Why not? Everything matterbridge does is kind of kludgy (but very effective) glue to get systems not meant to talk to each other to talk. I don't see how there can be a right or a wrong way to make this happen.
Yeah it is the simplest option....
The external component protocol is good for adding individuals to your contact list who are on other protocols, for example having xmpp:[email protected] and xmpp:[email protected], or for connecting from XMPP to a foreign protocol (e.g. for example the biboumi component at xmpp:irc.hackint.org will let you connect to IRC rooms on irc.hackint.org from XMPP). But matterbridge explicitly is not about personal rosters or DMs, it's only about groupchats edit and it's explicitly designed around just being another user sitting in rooms.
No the component protocol is not just for that... it could basically used for everything because you could implement like a second server behind a server without needing to care about the routing and stuff. But I agree with you that this might be overkill for matterbridge.
@kousu first the presence is not optional in MUCs and you need to send it for every Nick you want because that is how you join a room in XMPP and usually you can't write in a MUC if you aren't joined.... the server will throw an error for this.
I just confirmed, you're right, https://xmpp.org/extensions/xep-0045.html#enter-muc says
In order to participate in the discussions held in a multi-user chat room, a user MUST first become an occupant by entering the room.
MUC clients MUST signal their ability to speak the MUC protocol by including in the initial presence stanza an emptyelement ...
but anyway, that isn't a big deal. It just means that matterbridge needs to hold onto a little bit of state, a flag for whether each username has sent presence or not.
Most helpful comment
Moved here: https://github.com/42wim/matterbridge/issues/667#issuecomment-616489817