diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-17 16:28:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-17 16:28:32 +0100 |
commit | 86942a34a2aa086dee76c9e4e0b6942848e1b979 (patch) | |
tree | e004efb1a284e6d158ed9aaab7f3a582df19026f /appservice/matrix.go | |
parent | 584312f30805680711557ff6fbe291d2404367fb (diff) | |
download | easybridge-86942a34a2aa086dee76c9e4e0b6942848e1b979.tar.gz easybridge-86942a34a2aa086dee76c9e4e0b6942848e1b979.zip |
Fix XMPP && transmit nicknames from bridges to matrix
Diffstat (limited to 'appservice/matrix.go')
-rw-r--r-- | appservice/matrix.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/appservice/matrix.go b/appservice/matrix.go index 75bcaa1..2c4562e 100644 --- a/appservice/matrix.go +++ b/appservice/matrix.go @@ -13,6 +13,12 @@ import ( . "git.deuxfleurs.fr/Deuxfleurs/easybridge/mxlib" ) +func ezbrMxId() string { + return fmt.Sprintf("@%s:%s", registration.SenderLocalpart, config.MatrixDomain) +} + +// ---- + var httpClient *http.Client func init() { @@ -234,6 +240,13 @@ func mxPutStateAs(room string, event_type string, key string, content map[string return err } +func mxRoomNameAs(room string, name string, as_user string) error { + content := map[string]interface{} { + "name": name, + } + return mxPutStateAs(room, "m.room.name", "", content, as_user) +} + func mxRoomTopicAs(room string, topic string, as_user string) error { content := map[string]interface{} { "topic": topic, |