aboutsummaryrefslogtreecommitdiff
path: root/appservice/matrix.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-17 21:04:21 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-17 21:04:21 +0100
commit31bba8d946940df4858818f5efcc31cfd5a0a035 (patch)
treee9d2b7a6d6152fc45413648316a8ff7a514580b9 /appservice/matrix.go
parent5ab2608ee8bd36b7c7b0d670d24b5851250e3887 (diff)
downloadeasybridge-31bba8d946940df4858818f5efcc31cfd5a0a035.tar.gz
easybridge-31bba8d946940df4858818f5efcc31cfd5a0a035.zip
Talking to Easybridge is now possible for some things
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