aboutsummaryrefslogtreecommitdiff
path: root/appservice/names.go
blob: 4a5d1867a27e3ee0ee0f9c6f9cfdc94ca72748de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
}