func cmdUserhost(source interface{}, params [][]byte) { c := source.(*Client) nicks := strings.Fields(string(params[0])) var replyline string for _, nick := range nicks { var user *core.User if user = core.GetUserByNick(nick); user == nil { continue } if replyline != "" { replyline += " " } replyline += nick if user.Data("op") != "" { replyline += "*" } replyline += "=" if user.Data("away") != "" { replyline += "-" } else { replyline += "+" } replyline += user.GetHostname() } c.SendLineTo(nil, "302", ":%s", replyline) }
// Introduce a user to a given local server. func send_uid(l *local, u *core.User) { irc.SendFrom(l, from(nil), "UID %s 1 %d +i %s %s %s %s :%s", u.Nick(), u.NickTS(), u.GetIdent(), u.GetHostname(), u.GetIP(), u.ID(), u.Data("realname")) }