diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-16 22:07:41 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-16 22:07:41 +0100 |
commit | d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e (patch) | |
tree | 8d17148b9424019c38d0d19f1b0e2ccef96b87e0 /appservice/names.go | |
parent | 046ec6380b7bb363e537ade7fd254b5505dde32d (diff) | |
download | easybridge-d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e.tar.gz easybridge-d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e.zip |
Begin some bridging
Diffstat (limited to 'appservice/names.go')
-rw-r--r-- | appservice/names.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/appservice/names.go b/appservice/names.go new file mode 100644 index 0000000..4a5d186 --- /dev/null +++ b/appservice/names.go @@ -0,0 +1,21 @@ +package appservice + +import ( + "fmt" + "strings" + + . "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector" +) + +func roomAlias(protocol string, id RoomID) string { + id2 := strings.ReplaceAll(string(id), "#", "") + id2 = strings.ReplaceAll(id2, "@", "__") + + return fmt.Sprintf("_ezbr__%s__%s", id2, protocol) +} + +func userMxId(protocol string, id UserID) string { + id2 := strings.ReplaceAll(string(id), "@", "__") + + return fmt.Sprintf("_ezbr__%s__%s", id2, protocol) +} |