equal
deleted
inserted
replaced
12 /** The database connection */ |
12 /** The database connection */ |
13 struct evsql *db; |
13 struct evsql *db; |
14 |
14 |
15 } _ctx; |
15 } _ctx; |
16 |
16 |
17 static void on_PRIVMSG (struct irc_conn *conn, const struct irc_line *line, void *arg) |
17 static void on_PRIVMSG (const struct irc_line *line, void *arg) |
18 { |
18 { |
19 struct irc_log_ctx *ctx = arg; |
19 struct irc_log_ctx *ctx = arg; |
20 |
20 |
21 (void) conn; |
|
22 (void) ctx; |
21 (void) ctx; |
23 |
22 |
24 // log it! :P |
23 // log it! :P |
25 log_debug("%s: %s: %s", line->prefix, line->args[0], line->args[1]); |
24 log_debug("%s: %s: %s", line->prefix, line->args[0], line->args[1]); |
26 } |
25 } |
47 log_info("log channel: %s", irc_chan_name(info->channel)); |
46 log_info("log channel: %s", irc_chan_name(info->channel)); |
48 } |
47 } |
49 |
48 |
50 // register for events |
49 // register for events |
51 // XXX: need irc_chan API for this |
50 // XXX: need irc_chan API for this |
52 if ((err = irc_conn_register_handler_chain(info->channel->net->conn, _cmd_handlers, ctx))) |
51 if ((err = irc_conn_add_cmd_handlers(info->channel->net->conn, _cmd_handlers, ctx))) |
53 return err; |
52 return err; |
54 |
53 |
55 // ok |
54 // ok |
56 return SUCCESS; |
55 return SUCCESS; |
57 } |
56 } |