Is your feature request related to a problem? Please describe.
Right now bridging to XMPP is very basic and implementing a full XMPP component is not being considered for now (see: https://github.com/42wim/matterbridge/issues/955 ). However user and avatar spoofing like for other platforms would be really nice in XMPP MUCs.
Describe the solution you'd like
For the Prosody XMPP server a module exist that emulates incoming and outgoing webhooks from Slack (see: https://modules.prosody.im/mod_slack_webhooks.html ). This can be used to spoof usernames in XMPP MUCs. There is also an example implementation for using it to bridge to IRC (see: https://code.dgold.eu/xmpp-irc-gateway.git/ ).
As the Slack incoming / outgoing webhook code is already included in Matterbridge (and will soon be obsolete) this would be probably an easy way to get this implemented as an alternative XMPP bridging mode. A hybrid mode like in Discord using both a bot and a webhook seems also feasible with some small changes to the Prosody module.
Thanks for looking into this :)
It seems like the Matterhook.go system could be repurposed as it already includes everything from a quick glance.
I currently don't have a Prosody XMPP server running to test it (but would consider switching from the Ejabberd one I currently run), so if anyone could try it more quickly than me with the regular Slack briding that would be great.
@weeman1337 @Polynomdivision maybe something you could also look into?
That would be awesome: I was also looking into this (but without much time and lua/prosody knowledge, and even less knowledge of slack APIs).
From what I saw:
I also thought of a matterbridge API prosody module, but I'm not sure if prosody module design would allow to have a continuous GET request to listen to the message stream...
@mazhe cool that you actually tried. Regarding the two issues you had: from a quick look at the IRC bridge that I linked, they seem to have solved those somehow.
The outgoing message issues might have been just an missing SSL certificate problem since Matterbridge is contacted on a "raw" IP?
I'm not sure, prosody is configured for http, and I defined in matterbridge.toml the webhook as WebhookBindAddress="127.0.0.1:9999"
But it seems I can't connect :
curl -v -m 2 http://127.0.0.1:9999
* Trying 127.0.0.1:9999...
* connect to 127.0.0.1 port 9999 failed: Connection refused
* Failed to connect to 127.0.0.1 port 9999: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 9999: Connection refused
Did I miss something in matterbridge configuration? (It's version 1.17.2)
Is there any movement to propose webhooks as an XMPP Extension so they would possibly be supported by other servers too and be more thann a potential matterbridge specific hack?
@Mikaela not that I am aware off, but these things tend to follow the proof of concept (which there is), the actual demand (not yet, but Matterbridge could change that), and someone willing to sit down and write the XEP proposal.
The problem is that there will be some pushback as "you can just write a server component for it" seems like a common but ultimately misguided response...
There is a new REST api module for Prosody that should also be able to allow something like described above:
https://modules.prosody.im/mod_rest.html
Updated the above link with the example IRC implementation: https://code.dgold.eu/xmpp-irc-gateway.git/
Would be still nice if this alternative connection mode for XMPP could be added to Matterbridge.
I have to say that I got kinda intrigued by this and implemented a webhook for the XMPP bridge using prosody's mod_slack_webhook. It works, but feels a tad hacky as I have to ignore every message with an ID that contains the string "webhookbot", as this is how mod_slack_webhook identifies its messages.
I will try to later create a PR.
@Polynomdivision that's awesome!
Did you look at the mod_rest module also? Maybe that is a more standardized way instead of using the Slack like module?
@poVoq Yes, I did. But the problem with mod_rest is that it currently requires either prosody trunk or prosody 0.12, which is not released yet. mod_slack_webhook works with every 0.11.x version, so I went for it. But when 0.12 is released, it would probably be better to use mod_rest
closed by #1364
Most helpful comment
closed by #1364