irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

commit 0d03fe1a3eaeeea73185d47f2467d27ddf0646f6
parent 5eb3e5731e358be1437d4bacd382d7beca498c97
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 21 Jul 2012 02:04:13 +0200

add more events

Diffstat:
irctk.c | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/irctk.c b/irctk.c @@ -1326,12 +1326,28 @@ void manage_event (irc_session_t *session, const char *event, const char *origin info("Cannot join %s: you have joined too many channels.", params[1]); } else if (atoi(event) == LIBIRC_RFC_ERR_INVITEONLYCHAN) { info("Cannot join %s: channel is invite-only.", params[1]); + } else if (atoi(event) == LIBIRC_RFC_ERR_NOTONCHANNEL) { + info("Cannot perform action in %s: not on channel.", params[1]); + } else if (atoi(event) == LIBIRC_RFC_ERR_CHANOPRIVSNEEDED) { + info("Cannot perform action in %s: you're not channel operator.", params[1]); + } else if (atoi(event) == LIBIRC_RFC_ERR_CANNOTSENDTOCHAN) { + info("Cannot send to %s.", params[1]); } else if (atoi(event) == ERR_BADCHANNAME) { info("Could not join %s.", params[1]); } else if (atoi(event) == LIBIRC_RFC_ERR_USERONCHANNEL) { info("Cannot invite %s to %s: %s is already on %s.", params[1], params[2], params[1], params[2]); } else if (atoi(event) == LIBIRC_RFC_ERR_NOSUCHNICK) { info("No such nick/channel: %s", params[1]); + } else if (!strcmp(event, "INVITE")) { + if (args.event_to == COMMAND) + mprintf("[%s] <%s> /invite %s %s\n", params[1], output_nick(origin), params[0], params[1]); + if (args.event_to == MESSAGE) + mprintf("[%s] -!- %s has invited you %s\n", params[1], output_nick(origin), params[0], params[1]); + } else if (!strcmp(event, "MODE")) { + if (args.event_to == COMMAND) + mprintf("[%s] <%s> /mode %s %s\n", params[0], output_nick(origin), params[1], params[0]); + if (args.event_to == MESSAGE) + mprintf("[%s] -!- %s mode %s on %s\n", params[0], output_nick(origin), params[1], params[0]); } if (count == 2) {