Created
April 2, 2011 17:19
-
-
Save ahf/899676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit d645477bb42655ab85905f786624937c658e9ad5 | |
Author: Alexander Færøy <ahf@0x90.dk> | |
Date: Sat Apr 2 19:19:02 2011 +0200 | |
Add support for CTCP A/S/L | |
Reviewed by Emmy Slinge. | |
diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c | |
index be2edba..f512963 100644 | |
--- a/src/irc/core/ctcp.c | |
+++ b/src/irc/core/ctcp.c | |
@@ -219,6 +219,12 @@ static void ctcp_clientinfo(IRC_SERVER_REC *server, const char *data, | |
g_string_free(str, TRUE); | |
} | |
+/* CTCP A/S/L */ | |
+static void ctcp_aslinfo(IRC_SERVER_REC *server, const char *data, const char *nick) | |
+{ | |
+ ctcp_send_parsed_reply(server, nick, "ASL", settings_get_str("ctcp_asl_reply")); | |
+} | |
+ | |
static void ctcp_msg(IRC_SERVER_REC *server, const char *data, | |
const char *nick, const char *addr, const char *target) | |
{ | |
@@ -331,6 +337,7 @@ void ctcp_init(void) | |
PACKAGE_TARNAME" v$J - running on $sysname $sysarch"); | |
settings_add_str("misc", "ctcp_userinfo_reply", "$Y"); | |
settings_add_int("flood", "max_ctcp_queue", 5); | |
+ settings_add_str("misc", "ctcp_asl_reply", "21/m/cph"); | |
signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected); | |
signal_add_first("event privmsg", (SIGNAL_FUNC) event_privmsg); | |
@@ -342,12 +349,14 @@ void ctcp_init(void) | |
signal_add("ctcp msg time", (SIGNAL_FUNC) ctcp_time); | |
signal_add("ctcp msg userinfo", (SIGNAL_FUNC) ctcp_userinfo); | |
signal_add("ctcp msg clientinfo", (SIGNAL_FUNC) ctcp_clientinfo); | |
+ signal_add("ctcp msg asl", (SIGNAL_FUNC) ctcp_aslinfo); | |
ctcp_register("ping"); | |
ctcp_register("version"); | |
ctcp_register("time"); | |
ctcp_register("userinfo"); | |
ctcp_register("clientinfo"); | |
+ ctcp_register("asl"); | |
} | |
void ctcp_deinit(void) | |
@@ -365,4 +374,5 @@ void ctcp_deinit(void) | |
signal_remove("ctcp msg time", (SIGNAL_FUNC) ctcp_time); | |
signal_remove("ctcp msg userinfo", (SIGNAL_FUNC) ctcp_userinfo); | |
signal_remove("ctcp msg clientinfo", (SIGNAL_FUNC) ctcp_clientinfo); | |
+ signal_remove("ctcp msg asl", (SIGNAL_FUNC) ctcp_aslinfo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment