Beispiel #1
0
func requestAndRenderRegistrationForm(server string, formHandler data.FormCallback, saveFn func(), errorFn func(error), df interfaces.DialerFactory, verifier tls.Verifier) {
	policy := config.ConnectionPolicy{DialerFactory: df}

	//TODO: this would not be necessary if RegisterAccount did not use it
	conf := &config.Account{
		Account: "@" + server,
		Proxies: []string{"tor-auto://"},
	}

	//TODO: this should receive only a JID domainpart
	_, err := policy.RegisterAccount(formHandler, conf, verifier)

	if err != nil {
		errorFn(err)
		return
	}

	go saveFn()
}
Beispiel #2
0
func requestAndRenderRegistrationForm(server string, formHandler data.FormCallback, saveFn func(), df func() interfaces.Dialer) error {
	policy := config.ConnectionPolicy{DialerFactory: df}

	//TODO: this would not be necessary if RegisterAccount did not use it
	conf := &config.Account{
		Account: "@" + server,
		Proxies: []string{"tor-auto://"},
	}

	//TODO: this should receive only a JID domainpart
	_, err := policy.RegisterAccount(formHandler, conf)

	if err != nil {
		//TODO: show something in the UI
		log.Println("Registration failed:", err)
		return err
	}

	go saveFn()

	return nil
}
Beispiel #3
0
func requestAndRenderRegistrationForm(server string, formHandler xmpp.FormCallback, saveFn func()) error {
	policy := config.ConnectionPolicy{}

	//TODO: this would not be necessary if RegisterAccount did not use it
	conf := &config.Account{
		Account:    "@" + server,
		RequireTor: true,
	}

	//TODO: this should receive only a JID domainpart
	_, err := policy.RegisterAccount(formHandler, conf)

	if err != nil {
		//TODO: show something in the UI
		log.Println("Registration failed:", err)
		return err
	}

	go saveFn()

	return nil
}