Trying to write a bot using the api i came across the limitations of "just" sending messages to the gateways, so a way to reply to users available to users and bots would be very useful
I am not enterily sure how to adress a specific user and a specific platform using eg. irc or slack in a intuitive way..
but sending a DM to the bridge bot starting with {username}@{account} would provide enough information to search for eg. [email protected]
each platform would search for nicknames before username and optionally insert the string needed to reply eg: [email protected] as nick/user name
usig this system a bot can send respond to any user on any (DM-capable) platform, i hope
PS: actually just having the bots part implemented would be plenty features for me at the moment
Sorry, I'm a newb to your project, @42wim but it's pretty promising for my use case and so I had to reach out. I got it up and running between XMPP and Rocket.Chat in a jiff. But it only seems to work between channels, and doesn't support direct messages.
However, I take it from this FR and that it closes several other trackers, that direct message bridging is now supported... is that so? If so, I don't see how to enable that. Is there a special gateway channel format to use?
no, this FR is still open, other requests are just closed to avoid duplication
is there any plan to add support for direct messages? Actually I am planning to use matterbridge with my personal account credentials, as I do not have access to server settings, so I'd like to have also direct messages in my XMPP-world.
I've been thinking about how to support this, but I don't really see an option to have this directly in matterbridge, it's too cumbersome to chat between users as shown in a possible example here:
As in the example of @NikkyAI e.g. matterbridge is in slack as a bot called matterslack and also is running in irc server as matterbot.
So if you want to DM from yourself (user1 on irc) to user2 on slack.
This isn't very user-friendly and will be very confusing when DM multiple people.
Also the private messages can be intercepted by the person running matterbridge.
So maybe a solution for this is setting up an out-of-band chat (preferably P2P and E2EE), so the example will be:
So if you want to DM from yourself (user1 on irc) to user2 on slack:
User1/User2 chat with each other on the specific URL.
Other ideas/remarks/suggestions on how you would see DM's between two users are welcome.
For the out of band chat we could piggyback off public IRC servers? We could let users select their "provider" of choice. The ToS of freenode / rizon etc would need to be checked. GitHub Pages can of course be used for any website hosting — a fork of kiwiirc with changes specific to matterbridge.
I've always considered the following quote to be a necessary caveat for this feature:
Also the private messages can be intercepted by the person running matterbridge.
With that in mind, the idea I've had in the past is to do something like:
!mbchat user2@slack and the PM session just PMs that user until further commands are sent.Alternatively:
!mbchat user2@slack u2) and then future messages can be preceded with u2 Hello, world to send the message Hello, world to user2@slackFwiw my IRC bridge has PM support and it's really bad! I'll edit this later with info about that if I find anything useful to share.
with any kind of state like setting a target user one has to keep in mind that this has to easily work across matterbridge restarts, having to add complexion by parsing user settings at startup from some file or sqlite database would suck and potentially add more ways to crash on config change
i like the idea of using something like a fork of kiwiirc to act as webinterface for matterbridge.. as a fallback for platforms where implementing PM delivery or interaction is too annoying
i guess mtterbridge would generate tokens for each user, so one can keep track of who opened the website an is chatting.. (sounds like having to deal with state again.. and js on top of that)
Some protocols support some kind of virtual direct messaging (on xmpp this system is called transports) i believe other protocols have similar features. For the start we could just develope a a way to send dms via those systems which schould be relatively easy and possibly later think of a way to connect the other protocols.
Do we have a list of platforms that _do_ support PM bridging? Is it just XMPP?
@Humorhenker, for XMPP, I've found this info:
Do you have any other useful links? The wiki page suggests that you need to transfer credentials, which may be undesirable
Oooooo i like that kiwiirc tactic, but maybe it could be even simpler -- just drop patcon@slack and anon2@irc into urls like this:
https://kiwiirc.com/nextclient/#irc://chat.freenode.net/##matterbridge-anon2-patcon-xxxxxxxxx?nick=patcon--slack--xxxxxxxxx
https://kiwiirc.com/nextclient/#irc://chat.freenode.net/##matterbridge-anon2-patcon-xxxxxxxxx?nick=anon2--irc--xxxxxxxxx
So someone messages a matterbot with dm anon2@irc or some signal, and matterbridge sends a similar connection link to each, with a portion of room name (xxxxxxxx part) being unique to the communicating pair of users. It could be determinstically generated from some internal app state that is consistent between restarts. I would imagine there might be a salt, but this is really just to prevent harrassment. If someone goes to the trouble to reverse the salt, then the people will still see someone entering the IRC room with the two of them, and it will be obvious.
(##channels on IRC are for more ephemeral rooms, if I recall correctly.)
I've _just_ realised that if we went the way of IRC, we don't even need to use irc channels (e.g. @patcon's ##matterbridge-anon2-patcon-xxxxxxxxx) — you can just do it using IRC private messaging.
IRC channels can still be used for group PMs.
Good point! A room still feels most straightforward imho, as we don't need to tell people to type some techno-genius-looking command in order to start. (kiwiIRC can't auto-run an arbitrary command on join, like desktop clients can, so can't auto-init the DM session)
But maybe I'm suffering from a failure of imagination :) What would you imagine the best-case interaction for IRC private message to be @qaisjp?
I'm thinking the best we could do is, if message from patcon@slack to anon2@irc:
/dm @matterbot anon2@ircpatcon--slack--xxxxxxx/msg anon2--irc-xxxxxxx hi! i just joined this chatSo just one more step from the room way, but also chance of confusion if someone doesn't realize that the other person won't see the messages they type before arrival. Of course, the same issue exists in the ##room tactic, but at least in there, matterbridge could theoretically drop a message to explain.
Hm, i dont want to be the one pessimistic here. But that still would be a pretty userunfriendly way afterall. Especially the fact that there will be no offline messages with that method and this whole process of initialization would turn off many users in my opinion.
Another option would be some kind of internal DMsystem where the users have to use commands with the bot to write messages like:
and the other user would recieve them directly from the bot with a note of the sender.
Would probably not be easier to implement but way more userfriendly if you ask me.
What would you imagine the best-case interaction for IRC private message to be @qaisjp?
We would fork KiwiIRC so our client automatically sets up a direct message channel.
Ideally we'd completely hide the fact that IRC is being used — lock it down a little.
still would be a pretty userunfriendly way
@Humorhenker agreed, unfortunately
Another option would be some kind of internal DMsystem where the users have to use commands with the bot to write messages like:
Originally liked this approach too. The catch of that is that being in more than one conversation is quite confusing to user. All messages would come in as DM's from matterbridge-bot and be intermixed, right? (Or am I misunderstanding?) Technically doable though.
We would fork KiwiIRC so our client automatically sets up a direct message channel.
@qaisjp Ah, ok, wasn't expecting that scope. I guess I'm lacking a sense of what scope there's willingness to accomodate (e.g. setting up a mandatory supporting platform)
re: IRC private message approach. seems quite onerous, especially since it doesn't seem to offer a significantly better experience than simply using an obfuscated public channel. IRC PM's seeming require either (1) build/host a custom kiwiIRC client, or (2) expect user to run some IRC commands on join.
i kind of do not get.. if we plan between using a existing irc backend.. and hosting one.. why not implement the message routing between clients on the already running program? (matterbridge)
if we plan between using a existing irc backend.. and hosting one.
Nothing would be hosted. Existing services would be piggybacked, so it's privacy preserving (the bridge doesn't see PMs).
why not implement the message routing between clients on the already running program? (matterbridge)
Do you mean the first example here https://github.com/42wim/matterbridge/issues/191#issuecomment-573348118 and here https://github.com/42wim/matterbridge/issues/191#issuecomment-574268857?
privacy preserving (the bridge doesn't see PMs).
I dont get how that would offer more privacy. The bridge hoster sees every message with bridged channels nevertheless. You will need to trust the bridge hoster.
Why should we outsource the trust to some irc operators then? Because now the users would have to trust the irc operators for DMs while the whole process is rather transparent so they might not even know that.
Thanks for the useful feedback!
I like the idea of using kiwiirc instead of developing something from scratch ;-)
@Humorhenker wrt to privacy, matterbridge now only does "public/group" channels, as in data meant to be at lease some what public. Private/direct messages are something else.
Of course when using irc we would just move the problem, that's why I proposed P2P with E2EE.
But that's probably too ambitious, so maybe we can start with the low-hanging fruit for now.
Grouping the suggestions together we end up with something like this:
Wrt to that irc server: using a public irc-server probably opens up the "private" messages to more people then just the matterbridge owner (as @Humorhenker correctly notices).
So maybe we can add a built-in irc server to matterbridge so users can choose to use a public/private or built-in irc server.
built-in irc server
after doing a quick search https://github.com/fimad/ggircd/ seems to be a good fit. Small and easy to implement.
Afterall there will be the problem of no offline messages when we deside to use irc. That is a huge downpoint for me.
TBH if I wanted to PM someone on another platform, I'd just switch platform.
If we forked kiwiirc (instead of just using it) we could make it so that messages are saved in localStorage? Not great cross-platform but it's better than nothing?
Most helpful comment
is there any plan to add support for direct messages? Actually I am planning to use matterbridge with my personal account credentials, as I do not have access to server settings, so I'd like to have also direct messages in my XMPP-world.