Ejemplo n.º 1
0
def on_join_chan(nick, uhost, chan):
    whois(nick)
    hostmask = nick + "!" + uhost

    auth = getauth(nick)
    flag = getflag(chan, auth)
    hostflag = gethostflag(chan, hostmask)

    if flag == "n" or flag == "o" or hostflag == "o":
        putf("MODE %s +o %s" % (chan, nick))
    elif flag == "v" or hostflag == "v":
        putf("MODE %s +v %s" % (chan, nick))
Ejemplo n.º 2
0
Archivo: user.py Proyecto: Pythonz/PIRB
def on_nickchange(nick,uhost,newnick):
	for data in _cache.execute("select name from botnick"):
		if nick == str(data[0]):
			_cache.execute("update botnick set name='%s'" % newnick)

	if nick.lower() == _botnick.lower():
		_cache.execute("update botnick set name='%s'" % _botnick)
		put("NICK %s" % _botnick)

	_userdb.execute("delete from auth where nick='%s'" % nick)

	whois(newnick)
Ejemplo n.º 3
0
def on_nickchange(nick, uhost, newnick):
    for data in _cache.execute("select name from botnick"):
        if nick == str(data[0]):
            _cache.execute("update botnick set name='%s'" % newnick)

    if nick.lower() == _botnick.lower():
        _cache.execute("update botnick set name='%s'" % _botnick)
        put("NICK %s" % _botnick)

    _userdb.execute("delete from auth where nick='%s'" % nick)

    whois(newnick)
Ejemplo n.º 4
0
def on_join_chan(nick,uhost,chan):
	whois(nick)
	hostmask = nick + "!" + uhost

	auth = getauth(nick)
	flag = getflag(chan,auth)
	hostflag = gethostflag(chan,hostmask)

	if flag == "n" or flag == "o" or hostflag == "o":
		putf("MODE %s +o %s" % (chan,nick))
	elif flag == "v" or hostflag == "v":
		putf("MODE %s +v %s" % (chan,nick))
Ejemplo n.º 5
0
def channel_auth(nick,host,chan,arg):
	whois(nick)
	put("NOTICE %s :[%s] Trying to auth ..." % (nick,chan))
	auth = getauth(nick)
	hostmask = nick+"!"+host
	put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick,chan,auth,hostmask))
	flag = getflag(chan,auth)
	hostflag = gethostflag(chan,hostmask)
	put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick,chan,flag,hostflag))

	if flag == "n" or flag == "o" or hostflag == "o":
		putf("MODE %s +o %s" % (chan,nick))
	elif flag == "v" or hostflag == "v":
		putf("MODE %s +v %s" % (chan,nick))
Ejemplo n.º 6
0
def channel_auth(nick, host, chan, arg):
    whois(nick)
    put("NOTICE %s :[%s] Trying to auth ..." % (nick, chan))
    auth = getauth(nick)
    hostmask = nick + "!" + host
    put("NOTICE %s :[%s] Getting flag for %s (%s)..." %
        (nick, chan, auth, hostmask))
    flag = getflag(chan, auth)
    hostflag = gethostflag(chan, hostmask)
    put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" %
        (nick, chan, flag, hostflag))

    if flag == "n" or flag == "o" or hostflag == "o":
        putf("MODE %s +o %s" % (chan, nick))
    elif flag == "v" or hostflag == "v":
        putf("MODE %s +v %s" % (chan, nick))
Ejemplo n.º 7
0
def channel_msg_auth(nick,host,arg):
	if len(arg) == 0:
		irc_send(nick, "no channel specified")
	elif arg.startswith("#"):
		whois(nick)
		chan = arg.split()[0]
		put("NOTICE %s :[%s] Trying to auth ..." % (nick,chan))
		auth = getauth(nick)
		hostmask = nick+"!"+host
		put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick,chan,auth,hostmask))
		flag = getflag(chan,auth)
		hostflag = gethostflag(chan,hostmask)
		put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick,chan,flag,hostflag))

		if flag == "n" or flag == "o" or hostflag == "o":
			putf("MODE %s +o %s" % (chan,nick))
		elif flag == "v" or hostflag == "v":
			putf("MODE %s +v %s" % (chan,nick))
	else:
		irc_send(nick, "invalid channel")
Ejemplo n.º 8
0
def channel_msg_auth(nick, host, arg):
    if len(arg) == 0:
        irc_send(nick, "no channel specified")
    elif arg.startswith("#"):
        whois(nick)
        chan = arg.split()[0]
        put("NOTICE %s :[%s] Trying to auth ..." % (nick, chan))
        auth = getauth(nick)
        hostmask = nick + "!" + host
        put("NOTICE %s :[%s] Getting flag for %s (%s)..." %
            (nick, chan, auth, hostmask))
        flag = getflag(chan, auth)
        hostflag = gethostflag(chan, hostmask)
        put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" %
            (nick, chan, flag, hostflag))

        if flag == "n" or flag == "o" or hostflag == "o":
            putf("MODE %s +o %s" % (chan, nick))
        elif flag == "v" or hostflag == "v":
            putf("MODE %s +v %s" % (chan, nick))
    else:
        irc_send(nick, "invalid channel")
Ejemplo n.º 9
0
def check_user(text):
    if not c.get("SERVER", "address").lower().endswith(".quakenet.org"):
        whois(text.split()[7])
Ejemplo n.º 10
0
Archivo: user.py Proyecto: Pythonz/PIRB
def check_user(text):
	if not c.get("SERVER", "address").lower().endswith(".quakenet.org"):
		whois(text.split()[7])