]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Expand 24 chars limitation of bitlbee
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 11 Mar 2019 22:49:12 +0000 (23:49 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 11 Mar 2019 22:49:12 +0000 (23:49 +0100)
nixops/modules/irc/bitlbee_long_nicks.patch [new file with mode: 0644]
nixops/modules/irc/default.nix

diff --git a/nixops/modules/irc/bitlbee_long_nicks.patch b/nixops/modules/irc/bitlbee_long_nicks.patch
new file mode 100644 (file)
index 0000000..70be092
--- /dev/null
@@ -0,0 +1,56 @@
+diff --git a/bitlbee.h b/bitlbee.h
+index 17ab2979..5858277e 100644
+--- a/bitlbee.h
++++ b/bitlbee.h
+@@ -121,7 +121,7 @@ extern "C" {
+ #define CONTROL_TOPIC "Welcome to the control channel. Type \2help\2 for help information."
+ #define IRCD_INFO PACKAGE " <http://www.bitlbee.org/>"
+-#define MAX_NICK_LENGTH 24
++#define MAX_NICK_LENGTH 99
+ #define HELP_FILE VARDIR "help.txt"
+ #define CONF_FILE_DEF ETCDIR "bitlbee.conf"
+diff --git a/tests/check_nick.c b/tests/check_nick.c
+index ca5e5111..909fdcc9 100644
+--- a/tests/check_nick.c
++++ b/tests/check_nick.c
+@@ -11,16 +11,16 @@
+ START_TEST(test_nick_strip){
+       int i;
+       const char *get[] = { "test:", "test", "test\n",
+-                            "thisisaveryveryveryverylongnick",
+-                            "thisisave:ryveryveryverylongnick",
++                            "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick",
++                            "thisis:averyveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick",
+                             "t::::est",
+                             "test123",
+                             "123test",
+                             "123",
+                             NULL };
+       const char *expected[] = { "test", "test", "test",
+-                                 "thisisaveryveryveryveryl",
+-                                 "thisisaveryveryveryveryl",
++                                 "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve",
++                                 "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve",
+                                  "test",
+                                  "test123",
+                                  "_123test",
+@@ -28,7 +28,7 @@ START_TEST(test_nick_strip){
+                                  NULL };
+       for (i = 0; get[i]; i++) {
+-              char copy[60];
++              char copy[260];
+               strcpy(copy, get[i]);
+               nick_strip(NULL, copy);
+               fail_unless(strcmp(copy, expected[i]) == 0,
+@@ -53,7 +53,7 @@ END_TEST
+ START_TEST(test_nick_ok_notok)
+ {
+-      const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnick",
++      const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick",
+                               "\nillegalchar", "", "nick%", "123test", NULL };
+       int i;
index 4cf27e57acdeb3507a0f81f02795e283a2d2b934..a7e45ba48a0f577c9785c913d07bd6aea3f5dfea 100644 (file)
@@ -69,6 +69,12 @@ in
       '';
     };
 
+    nixpkgs.config.packageOverrides = oldpkgs: rec {
+      bitlbee = oldpkgs.bitlbee.overrideAttrs(old: {
+        patches = (old.patches or []) ++ [ ./bitlbee_long_nicks.patch ];
+      });
+    };
+
     networking.firewall.allowedTCPPorts = [ 6697 ];
     services.bitlbee = {
       enable = true;