easybridge/appservice/names.go
2020-02-16 22:07:41 +01:00

21 lines
460 B
Go

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)
}