Browse Source

added support for extended join

master
Jimmy Cao 13 years ago
parent
commit
36aa826df9
  1. 3
      oyoyo/client.py
  2. 1
      oyoyo/ircevents.py
  3. 11
      wolfgame.py

3
oyoyo/client.py

@ -70,7 +70,8 @@ def add_commands(d): @@ -70,7 +70,8 @@ def add_commands(d):
@add_commands(("join",
"mode",
"nick",
"who"))
"who",
"cap"))
class IRCClient(object):
""" IRC Client class. This handles one connection to a server.
This can be used either with or without IRCApp ( see connect() docs )

1
oyoyo/ircevents.py

@ -98,6 +98,7 @@ numeric_events = { @@ -98,6 +98,7 @@ numeric_events = {
b"351": "version",
b"352": "whoreply",
b"353": "namreply",
b"354": "whospcrpl",
b"361": "killdone",
b"362": "closing",
b"363": "closeend",

11
wolfgame.py

@ -41,9 +41,8 @@ def connect_callback(cli): @@ -41,9 +41,8 @@ def connect_callback(cli):
cli.join(botconfig.CHANNEL)
cli.msg("ChanServ", "op "+botconfig.CHANNEL)
@hook("whoreply", id=294)
def on_whoreply(cli, server, dunno, chan, ident,
cloak, dunno3, user, status, dunno4):
@hook("whospcrpl", id=294)
def on_whoreply(cli, server, nick, ident, cloak, user, acc):
if user in var.USERS: return # Don't add someone who is already there
if user == botconfig.NICK:
cli.nickname = user
@ -55,8 +54,10 @@ def connect_callback(cli): @@ -55,8 +54,10 @@ def connect_callback(cli):
def afterwho(*args):
decorators.unhook(HOOKS, 294)
cli.cap("REQ", "extended-join")
cli.cap("REQ", "account-notify")
cli.who(botconfig.CHANNEL)
cli.who(botconfig.CHANNEL, "%nuha")
if botconfig.JOIN_AFTER_CLOAKED:
prepare_stuff = hook("event_hosthidden", id=294)(prepare_stuff)
@ -944,7 +945,7 @@ def update_last_said(cli, nick, chan, rest): @@ -944,7 +945,7 @@ def update_last_said(cli, nick, chan, rest):
@hook("join")
def on_join(cli, raw_nick, chan):
def on_join(cli, raw_nick, chan, acc="", rname=""):
nick,m,u,cloak = parse_nick(raw_nick)
if nick not in var.USERS.keys() and nick != botconfig.NICK:
var.USERS[nick] = cloak

Loading…
Cancel
Save