polemon.org
 

I didn't like the idea that people are able to get information about my client using CTCPs.
Though the info that you get when doing a CTCP request on someone isn't really vital, I'd like to decide myself, if and which info is sent to someone.

noctcp.diff

This patch makes Irssi not respond to CTCP requests.

Please note, that it may render your client unwelcome on some networks or channels, where services or bots are querying users to check for spambots, etc.

noctcp.diff

--- src/irc/core/ctcp.c    2009-04-15 05:11:51.000000000 +0200
+++ ctcp.c    2009-04-18 08:17:18.000000000 +0200
@@ -119,6 +119,9 @@
 static void ctcp_ping(IRC_SERVER_REC *server, const char *data,
               const char *nick)
 {
+    /* no PING */
+    return;
+
     char *str;

     g_return_if_fail(data != NULL);
@@ -167,6 +170,9 @@
 static void ctcp_version(IRC_SERVER_REC *server, const char *data,
              const char *nick)
 {
+    /* no VERSION */
+    return;
+
     ctcp_send_parsed_reply(server, nick, "VERSION",
                    settings_get_str("ctcp_version_reply"));
 }
@@ -175,6 +181,9 @@
 static void ctcp_time(IRC_SERVER_REC *server, const char *data,
               const char *nick)
 {
+    /* no TIME */
+    return;
+
     char *str, *reply;

     g_return_if_fail(server != NULL);
@@ -191,6 +200,9 @@
 static void ctcp_userinfo(IRC_SERVER_REC *server, const char *data,
               const char *nick)
 {
+    /* no USERINFO */
+    return;
+
     ctcp_send_parsed_reply(server, nick, "USERINFO",
                    settings_get_str("ctcp_userinfo_reply"));
 }
@@ -199,6 +211,9 @@
 static void ctcp_clientinfo(IRC_SERVER_REC *server, const char *data,
                 const char *nick)
 {
+    /* no CLIENTINFO */
+    return;
+
     GString *str;
         GSList *tmp;

You can download that diff directly here.

How to apply the patch

Technically, that isn't a patch really, but just a diff that contains the minuscule changes I did to the source.

I suggest to put that file into the directory where you unpacked your Irssi tarball.
Then, go into that directory and enter the following line:

patch -p0 < noctcp.diff

You can always revert with:

patch -R < noctcp.diff


The Patch will only affect automatic responses of Irssi to CTCP requests. You'll still see those requests and you'll still be able to make CTCP requests yourself on other users.

Compatability

I tested (and used) those modifications with Irssi version 0.8.13, 0.8.14 and 0.8.15.
The patch should work with 0.8.12, I remember changing the source back then a bit, but since it's in unified format, that shouldn't be much of a problem.

Manual response

As I said above, sometimes you do need to respond to a CTCP request.

In order to make CTCP reponses possible, or in that sense easier to send, I suggest adding the following line to the aliases section of your .irssi/config:

CTCPR = "eval /quote NOTICE $0 :\001$1-\001";

This provides the command /ctcpr which lets you easily fake CTCP responses.

An Example:
If “Joe” makes a CTCP VERSION request on you, you can fake a response like this:

/ctcpr Joe VERSION not-your-business-IRC-client
 
noctcp.diff.txt · Last modified: 2010/04/07 05:47 by polemon
 
RSS • 2012 © --polemon Powered by: