1
1
/*
2
2
Licence: GPLv3
3
- Copyright Ⓒ 2022 Valerie Pond
3
+ Copyright Ⓒ 2022-2025 Valerie Pond
4
4
Elmer
5
5
6
6
Force a user to speak like Elmer Fudd
@@ -29,9 +29,11 @@ module
29
29
30
30
#include "unrealircd.h"
31
31
32
+ ModDataInfo * elmer_md ;
33
+
32
34
ModuleHeader MOD_HEADER = {
33
35
"third/elmer" ,
34
- "2.2 " ,
36
+ "2.3 " ,
35
37
"Make people talk like Elmer" ,
36
38
"Valware" ,
37
39
"unrealircd-6" ,
@@ -54,8 +56,53 @@ void elmer_unserialize(const char *str, ModData *m);
54
56
55
57
static char * convert_to_elmer (char * line );
56
58
57
- int elmer_chanmsg (Client * client , Channel * channel , Membership * lp , const char * * msg , const char * * errmsg , SendType sendtype );
58
- int elmer_usermsg (Client * client , Client * target , const char * * msg , const char * * errmsg , SendType sendtype );
59
+ #if UNREAL_VERSION >= 0x06020000
60
+ int elmer_chanmsg (Client * client , Channel * channel , Membership * member , const char * * text , const char * * errmsg , SendType sendtype , ClientContext * clictx )
61
+ {
62
+ static char retbuf [512 ];
63
+ if (IsElmer (client ))
64
+ {
65
+ strlcpy (retbuf , * text , sizeof (retbuf ));
66
+ * text = convert_to_elmer (retbuf );
67
+ }
68
+ return 0 ;
69
+ }
70
+
71
+ int elmer_usermsg (Client * client , Client * target , const char * * text , const char * * errmsg , SendType sendtype , ClientContext * clictx )
72
+ {
73
+ static char retbuf [512 ];
74
+ if (IsElmer (client ) && !IsULine (target ))
75
+ {
76
+ strlcpy (retbuf , * text , sizeof (retbuf ));
77
+ * text = convert_to_elmer (retbuf );
78
+ }
79
+ return 0 ;
80
+ }
81
+ #else
82
+ int elmer_chanmsg (Client * client , Channel * channel , Membership * lp , const char * * msg , const char * * errmsg , SendType sendtype )
83
+ {
84
+ static char retbuf [512 ];
85
+ if (IsElmer (client ))
86
+ {
87
+ strlcpy (retbuf , * msg , sizeof (retbuf ));
88
+ * msg = convert_to_elmer (retbuf );
89
+ }
90
+ return 0 ;
91
+ }
92
+
93
+ int elmer_usermsg (Client * client , Client * target , const char * * msg , const char * * errmsg , SendType sendtype )
94
+ {
95
+ static char retbuf [512 ];
96
+ if (IsElmer (client ) && !IsULine (target ))
97
+ {
98
+ strlcpy (retbuf , * msg , sizeof (retbuf ));
99
+ * msg = convert_to_elmer (retbuf );
100
+ }
101
+ return 0 ;
102
+ }
103
+ #endif
104
+
105
+
59
106
60
107
static void dumpit (Client * client , char * * p );
61
108
@@ -85,7 +132,6 @@ static char *help_elmer[] = {
85
132
"-" ,
86
133
NULL
87
134
};
88
- ModDataInfo * elmer_md ;
89
135
90
136
91
137
@@ -268,29 +314,6 @@ CMD_FUNC(DELELMER)
268
314
return ;
269
315
}
270
316
271
- int elmer_chanmsg (Client * client , Channel * channel , Membership * lp , const char * * msg , const char * * errmsg , SendType sendtype )
272
- {
273
- static char retbuf [512 ];
274
- if (IsElmer (client ))
275
- {
276
- strlcpy (retbuf , * msg , sizeof (retbuf ));
277
- * msg = convert_to_elmer (retbuf );
278
- }
279
- return 0 ;
280
- }
281
-
282
- int elmer_usermsg (Client * client , Client * target , const char * * msg , const char * * errmsg , SendType sendtype )
283
- {
284
- static char retbuf [512 ];
285
- if (IsElmer (client ) && !IsULine (target ))
286
- {
287
- strlcpy (retbuf , * msg , sizeof (retbuf ));
288
- * msg = convert_to_elmer (retbuf );
289
- }
290
- return 0 ;
291
- }
292
-
293
-
294
317
static char * convert_to_elmer (char * line )
295
318
{
296
319
char * p ;
0 commit comments