From d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 16 Feb 2020 22:07:41 +0100 Subject: Begin some bridging --- appservice/names.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 appservice/names.go (limited to 'appservice/names.go') 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) +} -- cgit v1.2.3