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:
parent
1d7ed285bf
commit
d2f9c2d63a
1 changed files with 7 additions and 3 deletions
10
main.go
10
main.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue