fix invitation code separator
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc 2024-03-26 15:29:52 +01:00
parent 0070a64d5f
commit 6bf6fadaaa

View File

@ -63,13 +63,13 @@ func CreateServerFromMeowUrl(meowurl string) *Server {
return CreateServerFromUid(uid) return CreateServerFromUid(uid)
} }
// CreateServerFromInvitationLink creates a server from a meow url, ex : meow://mylogin:mypassword@https://my.meowserver.example:8443/meow/invitationCode // CreateServerFromInvitationLink creates a server from a meow url, ex : meow://mylogin:mypassword@https://my.meowserver.example:8443/meow?invitationCode
func CreateServerFromInvitationLink(meowurl string) *Server { func CreateServerFromInvitationLink(meowurl string) *Server {
// remove the invitation code, last token after a / // remove the invitation code, last token after a /
meowurlTable := strings.Split(meowurl, "/") meowurlTable := strings.Split(meowurl, "?")
// join all elements with / except the last one // join all elements with / except the last one
uid := strings.Join(meowurlTable[:len(meowurlTable)-1], "/") meowSrvUrl := meowurlTable[0]
return CreateServerFromMeowUrl(uid) return CreateServerFromMeowUrl(meowSrvUrl)
} }
// GetServerCard returns a server card from a server // GetServerCard returns a server card from a server