aboutsummaryrefslogtreecommitdiff
path: root/appservice
diff options
context:
space:
mode:
Diffstat (limited to 'appservice')
-rw-r--r--appservice/server.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/appservice/server.go b/appservice/server.go
index 1dc7222..79a8f1a 100644
--- a/appservice/server.go
+++ b/appservice/server.go
@@ -34,6 +34,16 @@ func Start(r *mxlib.Registration, c *Config) (chan error, error) {
return nil, err
}
+ svc_mxid := fmt.Sprintf("@%s:%s", registration.SenderLocalpart, config.MatrixDomain)
+ err = mxRegisterUser(registration.SenderLocalpart)
+ if mxe, ok := err.(*mxlib.MxError); !ok || mxe.ErrCode != "M_USER_IN_USE" {
+ return nil, err
+ }
+ err = mxProfileDisplayname(svc_mxid, "Easybridge")
+ if err != nil {
+ return nil, err
+ }
+
router := mux.NewRouter()
router.HandleFunc("/_matrix/app/v1/transactions/{txnId}", handleTxn)
router.HandleFunc("/transactions/{txnId}", handleTxn)