aboutsummaryrefslogblamecommitdiff
path: root/appservice/names.go
blob: 4a5d1867a27e3ee0ee0f9c6f9cfdc94ca72748de (plain) (tree)




















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