aboutsummaryrefslogtreecommitdiff
path: root/connector/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'connector/xmpp')
-rw-r--r--connector/xmpp/xmpp.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/connector/xmpp/xmpp.go b/connector/xmpp/xmpp.go
index 1215a66..0573ddb 100644
--- a/connector/xmpp/xmpp.go
+++ b/connector/xmpp/xmpp.go
@@ -7,7 +7,8 @@ import (
"fmt"
"strings"
- gxmpp "github.com/mattn/go-xmpp"
+ gxmpp "github.com/matterbridge/go-xmpp"
+ "github.com/rs/xid"
log "github.com/sirupsen/logrus"
. "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
@@ -225,6 +226,7 @@ func (xm *XMPP) handleXMPP() error {
if v.Type == "groupchat" && len(remote_sp) == 2 {
event.Room = RoomID(remote_sp[0])
event.Author = UserID(remote_sp[1] + "@" + remote_sp[0])
+ event.Id = v.ID
xm.handler.Event(event)
}
}
@@ -331,10 +333,14 @@ func (xm *XMPP) Send(event *Event) error {
})
return err
} else if len(event.Room) > 0 {
+ if event.Id == "" {
+ event.Id = xid.New().String()
+ }
_, err := xm.conn.Send(gxmpp.Chat{
Type: "groupchat",
Remote: string(event.Room),
Text: event.Text,
+ ID: event.Id,
})
return err
} else {