blob: 9ed00f87de31660884c2b4766f30510acd8c5e2a (
plain) (
tree)
|
|
package appservice
import (
"fmt"
"strings"
. "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
)
func roomAlias(protocol string, id RoomID) string {
return fmt.Sprintf("_ezbr__%s__%s", safeStringForId(string(id)), protocol)
}
func userMxId(protocol string, id UserID) string {
return fmt.Sprintf("_ezbr__%s__%s", safeStringForId(string(id)), protocol)
}
func safeStringForId(in string) string {
id2 := strings.ReplaceAll(in, "#", "")
id2 = strings.ReplaceAll(id2, "@", "__")
id2 = strings.ReplaceAll(id2, ":", "_")
return id2
}
|