Exemple #1
0
func (q *quarid) joinChan(
	ev *adapter.Event,
	c adapter.Responder,
) {
	chans := q.Config.GetStringSlice("irc.channels")

	joinCmd := &adapter.Event{
		Command:    irc.IRC_JOIN,
		Parameters: chans,
	}
	c.Write(joinCmd)
}
Exemple #2
0
func writeNick(nick string, c adapter.Responder) {
	c.Write(&adapter.Event{
		Command: IRC_NICK,
		Parameters: []string{
			nick,
		},
	})

	timeout := make(chan bool)
	go func() {
		// Wait 400ms for an error
		time.Sleep(400 * time.Millisecond)
		timeout <- true
	}()
	<-timeout
}
Exemple #3
0
func (i *Client) authenticate(c adapter.Responder) {
	logger.Log.Infof("Authenticating for nick %s!%s", i.Nick, i.Ident)

	writeNick(i.Nick, c)

	// RFC 2812 USER command
	c.Write(&adapter.Event{
		Command: IRC_USER,
		Parameters: []string{
			i.Ident,
			"0",
			"*",
			i.Nick,
		},
	})
}