easybridge/appservice/names.go

22 lines
460 B
Go
Raw Normal View History

2020-02-16 21:07:41 +00:00
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)
}