This commit is contained in:
parent
0070a64d5f
commit
6bf6fadaaa
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user