diff options
Diffstat (limited to 'nixops/modules/irc')
-rw-r--r-- | nixops/modules/irc/bitlbee_long_nicks.patch | 56 | ||||
-rw-r--r-- | nixops/modules/irc/default.nix | 6 |
2 files changed, 62 insertions, 0 deletions
diff --git a/nixops/modules/irc/bitlbee_long_nicks.patch b/nixops/modules/irc/bitlbee_long_nicks.patch new file mode 100644 index 0000000..70be092 --- /dev/null +++ b/nixops/modules/irc/bitlbee_long_nicks.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | diff --git a/bitlbee.h b/bitlbee.h | ||
2 | index 17ab2979..5858277e 100644 | ||
3 | --- a/bitlbee.h | ||
4 | +++ b/bitlbee.h | ||
5 | @@ -121,7 +121,7 @@ extern "C" { | ||
6 | #define CONTROL_TOPIC "Welcome to the control channel. Type \2help\2 for help information." | ||
7 | #define IRCD_INFO PACKAGE " <http://www.bitlbee.org/>" | ||
8 | |||
9 | -#define MAX_NICK_LENGTH 24 | ||
10 | +#define MAX_NICK_LENGTH 99 | ||
11 | |||
12 | #define HELP_FILE VARDIR "help.txt" | ||
13 | #define CONF_FILE_DEF ETCDIR "bitlbee.conf" | ||
14 | diff --git a/tests/check_nick.c b/tests/check_nick.c | ||
15 | index ca5e5111..909fdcc9 100644 | ||
16 | --- a/tests/check_nick.c | ||
17 | +++ b/tests/check_nick.c | ||
18 | @@ -11,16 +11,16 @@ | ||
19 | START_TEST(test_nick_strip){ | ||
20 | int i; | ||
21 | const char *get[] = { "test:", "test", "test\n", | ||
22 | - "thisisaveryveryveryverylongnick", | ||
23 | - "thisisave:ryveryveryverylongnick", | ||
24 | + "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", | ||
25 | + "thisis:averyveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", | ||
26 | "t::::est", | ||
27 | "test123", | ||
28 | "123test", | ||
29 | "123", | ||
30 | NULL }; | ||
31 | const char *expected[] = { "test", "test", "test", | ||
32 | - "thisisaveryveryveryveryl", | ||
33 | - "thisisaveryveryveryveryl", | ||
34 | + "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", | ||
35 | + "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", | ||
36 | "test", | ||
37 | "test123", | ||
38 | "_123test", | ||
39 | @@ -28,7 +28,7 @@ START_TEST(test_nick_strip){ | ||
40 | NULL }; | ||
41 | |||
42 | for (i = 0; get[i]; i++) { | ||
43 | - char copy[60]; | ||
44 | + char copy[260]; | ||
45 | strcpy(copy, get[i]); | ||
46 | nick_strip(NULL, copy); | ||
47 | fail_unless(strcmp(copy, expected[i]) == 0, | ||
48 | @@ -53,7 +53,7 @@ END_TEST | ||
49 | |||
50 | START_TEST(test_nick_ok_notok) | ||
51 | { | ||
52 | - const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnick", | ||
53 | + const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", | ||
54 | "\nillegalchar", "", "nick%", "123test", NULL }; | ||
55 | int i; | ||
56 | |||
diff --git a/nixops/modules/irc/default.nix b/nixops/modules/irc/default.nix index 4cf27e5..a7e45ba 100644 --- a/nixops/modules/irc/default.nix +++ b/nixops/modules/irc/default.nix | |||
@@ -69,6 +69,12 @@ in | |||
69 | ''; | 69 | ''; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | nixpkgs.config.packageOverrides = oldpkgs: rec { | ||
73 | bitlbee = oldpkgs.bitlbee.overrideAttrs(old: { | ||
74 | patches = (old.patches or []) ++ [ ./bitlbee_long_nicks.patch ]; | ||
75 | }); | ||
76 | }; | ||
77 | |||
72 | networking.firewall.allowedTCPPorts = [ 6697 ]; | 78 | networking.firewall.allowedTCPPorts = [ 6697 ]; |
73 | services.bitlbee = { | 79 | services.bitlbee = { |
74 | enable = true; | 80 | enable = true; |