aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-11 02:22:53 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-11 02:22:53 +0300
commitaf07773b07ed3d0138ad237906bcd8e81512a11d (patch)
treed1c9d3365bd02951635fe76e524ee396d9249b24
parenta74e2bcb7d3262073d05aa89140b1d202b7f179d (diff)
Random IDs for service messagesv1.9.5
-rw-r--r--Makefile2
-rw-r--r--telegabber.go2
-rw-r--r--xmpp/gateway/gateway.go13
3 files changed, 13 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f8d5b73..4452163 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
COMMIT := $(shell git rev-parse --short HEAD)
TD_COMMIT := "5bbfc1cf5dab94f82e02f3430ded7241d4653551"
-VERSION := "v1.9.4"
+VERSION := "v1.9.5"
MAKEOPTS := "-j4"
all:
diff --git a/telegabber.go b/telegabber.go
index 9e71887..6cfccff 100644
--- a/telegabber.go
+++ b/telegabber.go
@@ -16,7 +16,7 @@ import (
goxmpp "gosrc.io/xmpp"
)
-var version string = "1.9.4"
+var version string = "1.9.5"
var commit string
var sm *goxmpp.StreamManager
diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go
index de0ec8d..1507e31 100644
--- a/xmpp/gateway/gateway.go
+++ b/xmpp/gateway/gateway.go
@@ -10,6 +10,7 @@ import (
"dev.narayana.im/narayana/telegabber/badger"
"dev.narayana.im/narayana/telegabber/xmpp/extensions"
+ "github.com/google/uuid"
log "github.com/sirupsen/logrus"
"github.com/soheilhy/args"
"gosrc.io/xmpp"
@@ -61,12 +62,20 @@ func SendMessage(to string, from string, body string, id string, component *xmpp
// SendServiceMessage creates and sends a simple message stanza from transport
func SendServiceMessage(to string, body string, component *xmpp.Component) {
- sendMessageWrapper(to, "", body, "", component, nil, nil, "", "", false, false)
+ var id string
+ if uuid, err := uuid.NewRandom(); err == nil {
+ id = uuid.String()
+ }
+ sendMessageWrapper(to, "", body, id, component, nil, nil, "", "", false, false)
}
// SendTextMessage creates and sends a simple message stanza
func SendTextMessage(to string, from string, body string, component *xmpp.Component) {
- sendMessageWrapper(to, from, body, "", component, nil, nil, "", "", false, false)
+ var id string
+ if uuid, err := uuid.NewRandom(); err == nil {
+ id = uuid.String()
+ }
+ sendMessageWrapper(to, from, body, id, component, nil, nil, "", "", false, false)
}
// SendMessageWithOOB creates and sends a message stanza with OOB URL