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):
@add_commands(("join", @add_commands(("join",
"mode", "mode",
"nick", "nick",
"who")) "who",
"cap"))
class IRCClient(object): class IRCClient(object):
""" IRC Client class. This handles one connection to a server. """ IRC Client class. This handles one connection to a server.
This can be used either with or without IRCApp ( see connect() docs ) This can be used either with or without IRCApp ( see connect() docs )

1
oyoyo/ircevents.py

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

11
wolfgame.py

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

Loading…
Cancel
Save