1
0
Fork 0
mirror of https://codeberg.org/june64/mrvc.git synced 2026-01-09 23:52:54 +01:00

combine localpart and homeserver arguments into one and validate that

Combine the user localpart and homeserver arguments into one user id
argument and validate that.
This commit is contained in:
June 2025-08-16 02:36:49 +02:00
commit d2f9c2d63a
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

10
main.go
View file

@ -281,16 +281,20 @@ func compareVersionStrings(a, b string) int {
}
func main() {
userLocalpart := os.Getenv("MATRIX_USER_LOCALPART")
homeserver := os.Getenv("MATRIX_HOMESERVER")
userIdString := os.Getenv("MATRIX_USER_ID")
token := os.Getenv("MATRIX_TOKEN")
room := os.Getenv("MATRIX_ROOM")
verbose := false
timeoutSeconds := 5
userId := id.UserID(userIdString)
_, homeserver, err := userId.ParseAndValidate()
if err != nil {
log.Fatal(err)
}
client, err := mautrix.NewClient(
homeserver,
id.NewUserID(userLocalpart, homeserver),
userId,
token,
)
if err != nil {