aboutsummaryrefslogtreecommitdiff
path: root/appservice/matrix.go
diff options
context:
space:
mode:
Diffstat (limited to 'appservice/matrix.go')
-rw-r--r--appservice/matrix.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/appservice/matrix.go b/appservice/matrix.go
index a212d85..a1cc759 100644
--- a/appservice/matrix.go
+++ b/appservice/matrix.go
@@ -14,12 +14,14 @@ import (
"git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
)
+const EASYBRIDGE_SYSTEM_PROTOCOL string = "✯◡✯"
+
func ezbrMxId() string {
return fmt.Sprintf("@%s:%s", registration.SenderLocalpart, config.MatrixDomain)
}
func ezbrSystemRoom(user_mx_id string) (string, error) {
- return dbGetMxPmRoom("system", connector.UserID("Easybridge"), ezbrMxId(), user_mx_id, "easybridge")
+ return dbGetMxPmRoom(EASYBRIDGE_SYSTEM_PROTOCOL, connector.UserID("Easybridge"), ezbrMxId(), user_mx_id, "easybridge")
}
func ezbrSystemSend(user_mx_id string, msg string) {
@@ -32,6 +34,10 @@ func ezbrSystemSend(user_mx_id string, msg string) {
}
}
+func ezbrSystemSendf(user_mx_id string, format string, args ...interface{}) {
+ ezbrSystemSend(user_mx_id, fmt.Sprintf(format, args...))
+}
+
// ----
var httpClient *http.Client