This commit is contained in:
parent
0070a64d5f
commit
6bf6fadaaa
@ -63,13 +63,13 @@ func CreateServerFromMeowUrl(meowurl string) *Server {
|
||||
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 {
|
||||
// remove the invitation code, last token after a /
|
||||
meowurlTable := strings.Split(meowurl, "/")
|
||||
meowurlTable := strings.Split(meowurl, "?")
|
||||
// join all elements with / except the last one
|
||||
uid := strings.Join(meowurlTable[:len(meowurlTable)-1], "/")
|
||||
return CreateServerFromMeowUrl(uid)
|
||||
meowSrvUrl := meowurlTable[0]
|
||||
return CreateServerFromMeowUrl(meowSrvUrl)
|
||||
}
|
||||
|
||||
// GetServerCard returns a server card from a server
|
||||
|
Loading…
Reference in New Issue
Block a user