summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-05-23 20:51:04 +0200
committerGitHub <noreply@github.com>2020-05-23 20:51:04 +0200
commit3c4a3e3f75bcab74539512eeab40cc88a9f849a2 (patch)
tree0d8562fc5986e98bea8517a64f54a65b2bcb6f76 /bridge
parent274fb09ed4374c0732b1a7763a3c675037948822 (diff)
downloadmatterbridge-msglm-3c4a3e3f75bcab74539512eeab40cc88a9f849a2.tar.gz
matterbridge-msglm-3c4a3e3f75bcab74539512eeab40cc88a9f849a2.tar.bz2
matterbridge-msglm-3c4a3e3f75bcab74539512eeab40cc88a9f849a2.zip
Implement xep-0245 (xmpp). Closes #1137 (#1144)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/xmpp/xmpp.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go
index 7122534f..75b2b598 100644
--- a/bridge/xmpp/xmpp.go
+++ b/bridge/xmpp/xmpp.go
@@ -70,12 +70,19 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) {
if msg.Event == config.EventMsgDelete {
return "", nil
}
+
b.Log.Debugf("=> Receiving %#v", msg)
if msg.Event == config.EventAvatarDownload {
return b.cacheAvatar(&msg), nil
}
+ // Make a action /me of the message, prepend the username with it.
+ // https://xmpp.org/extensions/xep-0245.html
+ if msg.Event == config.EventUserAction {
+ msg.Username = "/me " + msg.Username
+ }
+
// Upload a file (in XMPP case send the upload URL because XMPP has no native upload support).
if msg.Extra != nil {
for _, rmsg := range helper.HandleExtra(&msg, b.General) {