@@ -34,7 +34,7 @@ struct {
34
34
int have_action ;
35
35
int have_kick_text ;
36
36
int have_notice_text ;
37
- } settings ;
37
+ } ice_settings ;
38
38
39
39
int ice_local_join (Client * client , Channel * joined_channel , MessageTag * mtags );
40
40
@@ -64,7 +64,7 @@ int ice_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) {
64
64
if (strcmp (ce -> name , MYCONF ))
65
65
return 0 ;
66
66
67
- settings .have_config = 1 ;
67
+ ice_settings .have_config = 1 ;
68
68
69
69
for (cep = ce -> items ; cep ; cep = cep -> next ) {
70
70
if (!cep -> name ) {
@@ -80,12 +80,12 @@ int ice_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) {
80
80
}
81
81
82
82
if (!strcmp (cep -> name , "action" )) {
83
- settings .have_action = ACTION_NONE ;
83
+ ice_settings .have_action = ACTION_NONE ;
84
84
if (!strcmp (cep -> value , "kick" ))
85
- settings .have_action = ACTION_KICK ;
85
+ ice_settings .have_action = ACTION_KICK ;
86
86
if (!strcmp (cep -> value , "part" ))
87
- settings .have_action = ACTION_PART ;
88
- if (settings .have_action == ACTION_NONE ){
87
+ ice_settings .have_action = ACTION_PART ;
88
+ if (ice_settings .have_action == ACTION_NONE ){
89
89
config_error ("%s:%i: %s::%s must be either \"kick\" or \"part\"" , cep -> file -> filename , cep -> line_number , MYCONF , cep -> name );
90
90
errors ++ ;
91
91
break ;
@@ -94,12 +94,12 @@ int ice_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) {
94
94
}
95
95
96
96
if (!strcmp (cep -> name , "notice-text" )) {
97
- settings .have_notice_text = 1 ;
97
+ ice_settings .have_notice_text = 1 ;
98
98
continue ;
99
99
}
100
100
101
101
if (!strcmp (cep -> name , "kick-text" )) {
102
- settings .have_kick_text = 1 ;
102
+ ice_settings .have_kick_text = 1 ;
103
103
continue ;
104
104
}
105
105
@@ -112,11 +112,11 @@ int ice_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) {
112
112
113
113
int ice_configposttest (int * errs ) {
114
114
int errors = 0 ;
115
- if (settings .have_config && !settings .have_action ){
115
+ if (ice_settings .have_config && !ice_settings .have_action ){
116
116
config_error ("No %s::action specfied!" , MYCONF );
117
117
errors ++ ;
118
118
}
119
- if (settings .have_action == ACTION_KICK && !settings .have_kick_text ){
119
+ if (ice_settings .have_action == ACTION_KICK && !ice_settings .have_kick_text ){
120
120
config_error ("%s::kick-text is required if %s::method is set to \"kick\"!" , MYCONF , MYCONF );
121
121
errors ++ ;
122
122
}
@@ -125,12 +125,12 @@ int ice_configposttest(int *errs) {
125
125
return -1 ;
126
126
}
127
127
/* config ok, proceed to apply defaults */
128
- settings .kick_text = NULL ;
129
- settings .notice_text = NULL ;
130
- if (!settings .have_config ){
131
- safe_strdup (settings .kick_text , "Enforcing channel ban for $joined" );
132
- safe_strdup (settings .notice_text , "*** Restrictions set on $ban prevent you from being on $joined at the same time. Leaving $ban" );
133
- settings .action = ACTION_KICK ;
128
+ ice_settings .kick_text = NULL ;
129
+ ice_settings .notice_text = NULL ;
130
+ if (!ice_settings .have_config ){
131
+ safe_strdup (ice_settings .kick_text , "Enforcing channel ban for $joined" );
132
+ safe_strdup (ice_settings .notice_text , "*** Restrictions set on $ban prevent you from being on $joined at the same time. Leaving $ban" );
133
+ ice_settings .action = ACTION_KICK ;
134
134
}
135
135
return 1 ;
136
136
}
@@ -153,19 +153,19 @@ int ice_configrun(ConfigFile *cf, ConfigEntry *ce, int type) {
153
153
154
154
if (!strcmp (cep -> name , "action" )) {
155
155
if (!strcmp (cep -> value , "kick" ))
156
- settings .action = ACTION_KICK ;
156
+ ice_settings .action = ACTION_KICK ;
157
157
if (!strcmp (cep -> value , "part" ))
158
- settings .action = ACTION_PART ;
158
+ ice_settings .action = ACTION_PART ;
159
159
continue ;
160
160
}
161
161
162
162
if (!strcmp (cep -> name , "notice-text" )) {
163
- safe_strdup (settings .notice_text , cep -> value );
163
+ safe_strdup (ice_settings .notice_text , cep -> value );
164
164
continue ;
165
165
}
166
166
167
167
if (!strcmp (cep -> name , "kick-text" )) {
168
- safe_strdup (settings .kick_text , cep -> value );
168
+ safe_strdup (ice_settings .kick_text , cep -> value );
169
169
continue ;
170
170
}
171
171
}
@@ -174,7 +174,7 @@ int ice_configrun(ConfigFile *cf, ConfigEntry *ce, int type) {
174
174
175
175
ModuleHeader MOD_HEADER = {
176
176
"third/inchannelban-enforce" ,
177
- "6.0 " ,
177
+ "6.1 " ,
178
178
"Enforce ~c bans so they can't be circumvented" ,
179
179
"k4be" ,
180
180
"unrealircd-6" ,
@@ -186,10 +186,10 @@ MOD_INIT(){
186
186
}
187
187
188
188
MOD_TEST (){
189
- settings .have_config = 0 ;
190
- settings .have_action = ACTION_NONE ;
191
- settings .have_kick_text = 0 ;
192
- settings .have_notice_text = 0 ;
189
+ ice_settings .have_config = 0 ;
190
+ ice_settings .have_action = ACTION_NONE ;
191
+ ice_settings .have_kick_text = 0 ;
192
+ ice_settings .have_notice_text = 0 ;
193
193
HookAdd (modinfo -> handle , HOOKTYPE_CONFIGTEST , 0 , ice_configtest );
194
194
HookAdd (modinfo -> handle , HOOKTYPE_CONFIGPOSTTEST , 0 , ice_configposttest );
195
195
return MOD_SUCCESS ;
@@ -241,12 +241,12 @@ int ice_local_join(Client *client, Channel *joined_channel, MessageTag *mtags){
241
241
value [1 ] = joined_channel -> name ;
242
242
name [2 ] = NULL ;
243
243
value [2 ] = NULL ;
244
- if (settings .notice_text ){
245
- buildvarstring (settings .notice_text , buf , sizeof (buf ), name , value );
244
+ if (ice_settings .notice_text ){
245
+ buildvarstring (ice_settings .notice_text , buf , sizeof (buf ), name , value );
246
246
sendnotice (client , "%s" , buf );
247
247
}
248
- if (settings .action == ACTION_KICK ){
249
- buildvarstring (settings .kick_text , buf , sizeof (buf ), name , value );
248
+ if (ice_settings .action == ACTION_KICK ){
249
+ buildvarstring (ice_settings .kick_text , buf , sizeof (buf ), name , value );
250
250
kick_user (NULL , channel , & me , client , buf );
251
251
} else {
252
252
parv [1 ] = channel -> name ;
0 commit comments