57 |
|
|
58 |
if ((conf = create_resv(name, reason, NULL)) == NULL) |
if ((conf = create_resv(name, reason, NULL)) == NULL) |
59 |
{ |
{ |
60 |
sendto_one_notice(source_p, &me, ":A RESV has already been placed on channel: %s", |
if (IsClient(source_p)) |
61 |
name); |
sendto_one_notice(source_p, &me, ":A RESV has already been placed on channel: %s", name); |
62 |
return; |
return; |
63 |
} |
} |
64 |
|
|
67 |
|
|
68 |
if (tkline_time) |
if (tkline_time) |
69 |
{ |
{ |
70 |
sendto_one_notice(source_p, &me, ":A %d minute %s RESV has been placed on channel: %s", |
if (IsClient(source_p)) |
71 |
tkline_time/60, (MyClient(source_p) ? "local" : "remote"), name); |
sendto_one_notice(source_p, &me, ":A %d minute %s RESV has been placed on channel: %s", |
72 |
|
tkline_time/60, (MyClient(source_p) ? "local" : "remote"), name); |
73 |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
74 |
"%s has placed a %d minute %s RESV on channel: %s [%s]", |
"%s has placed a %d minute %s RESV on channel: %s [%s]", |
75 |
get_oper_name(source_p), |
get_oper_name(source_p), |
83 |
} |
} |
84 |
else |
else |
85 |
{ |
{ |
86 |
sendto_one_notice(source_p, &me, ":A %s RESV has been placed on channel %s", |
if (IsClient(source_p)) |
87 |
(MyClient(source_p) ? "local" : "remote"), name); |
sendto_one_notice(source_p, &me, ":A %s RESV has been placed on channel %s", |
88 |
|
(MyClient(source_p) ? "local" : "remote"), name); |
89 |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
90 |
"%s has placed a %s RESV on channel %s : [%s]", |
"%s has placed a %s RESV on channel %s : [%s]", |
91 |
get_oper_name(source_p), |
get_oper_name(source_p), |
101 |
|
|
102 |
if (!valid_wild_card_simple(name)) |
if (!valid_wild_card_simple(name)) |
103 |
{ |
{ |
104 |
sendto_one_notice(source_p, &me, ":Please include at least %u non-wildcard characters with the resv", |
if (IsClient(source_p)) |
105 |
ConfigGeneral.min_nonwildcard_simple); |
sendto_one_notice(source_p, &me, ":Please include at least %u non-wildcard characters with the resv", |
106 |
|
ConfigGeneral.min_nonwildcard_simple); |
107 |
return; |
return; |
108 |
} |
} |
109 |
|
|
110 |
if (!HasUMode(source_p, UMODE_ADMIN) && has_wildcards(name)) |
if (!HasUMode(source_p, UMODE_ADMIN) && has_wildcards(name)) |
111 |
{ |
{ |
112 |
sendto_one_notice(source_p, &me, ":You must be an admin to perform a wildcard RESV"); |
if (IsClient(source_p)) |
113 |
|
sendto_one_notice(source_p, &me, ":You must be an admin to perform a wildcard RESV"); |
114 |
return; |
return; |
115 |
} |
} |
116 |
|
|
117 |
if ((conf = create_resv(name, reason, NULL)) == NULL) |
if ((conf = create_resv(name, reason, NULL)) == NULL) |
118 |
{ |
{ |
119 |
sendto_one_notice(source_p, &me, ":A RESV has already been placed on nick %s", |
if (IsClient(source_p)) |
120 |
name); |
sendto_one_notice(source_p, &me, ":A RESV has already been placed on nick %s", name); |
121 |
return; |
return; |
122 |
} |
} |
123 |
|
|
126 |
|
|
127 |
if (tkline_time) |
if (tkline_time) |
128 |
{ |
{ |
129 |
sendto_one_notice(source_p, &me, ":A %d minute %s RESV has been placed on nick %s : [%s]", |
if (IsClient(source_p)) |
130 |
tkline_time/60, (MyClient(source_p) ? "local" : "remote"), |
sendto_one_notice(source_p, &me, ":A %d minute %s RESV has been placed on nick %s : [%s]", |
131 |
conf->name, conf->reason); |
tkline_time/60, (MyClient(source_p) ? "local" : "remote"), |
132 |
|
conf->name, conf->reason); |
133 |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
134 |
"%s has placed a %d minute %s RESV on nick %s : [%s]", |
"%s has placed a %d minute %s RESV on nick %s : [%s]", |
135 |
get_oper_name(source_p), tkline_time/60, |
get_oper_name(source_p), tkline_time/60, |
141 |
} |
} |
142 |
else |
else |
143 |
{ |
{ |
144 |
sendto_one_notice(source_p, &me, ":A %s RESV has been placed on nick %s : [%s]", |
if (IsClient(source_p)) |
145 |
(MyClient(source_p) ? "local" : "remote"), conf->name, conf->reason); |
sendto_one_notice(source_p, &me, ":A %s RESV has been placed on nick %s : [%s]", |
146 |
|
(MyClient(source_p) ? "local" : "remote"), conf->name, conf->reason); |
147 |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
148 |
"%s has placed a %s RESV on nick %s : [%s]", |
"%s has placed a %s RESV on nick %s : [%s]", |
149 |
get_oper_name(source_p), |
get_oper_name(source_p), |
226 |
static int |
static int |
227 |
me_resv(struct Client *source_p, int parc, char *parv[]) |
me_resv(struct Client *source_p, int parc, char *parv[]) |
228 |
{ |
{ |
229 |
if (parc != 5 || !IsClient(source_p)) |
if (parc != 5 || EmptyString(parv[4])) |
230 |
return 0; |
return 0; |
231 |
|
|
232 |
parse_resv(source_p, parv[2], atoi(parv[1]), parv[4]); |
parse_resv(source_p, parv[2], atoi(parv[1]), parv[4]); |
245 |
if (parc != 4 || EmptyString(parv[3])) |
if (parc != 4 || EmptyString(parv[3])) |
246 |
return 0; |
return 0; |
247 |
|
|
248 |
sendto_match_servs(source_p, parv[1], CAP_CLUSTER, |
sendto_match_servs(source_p, parv[1], CAP_CLUSTER, "RESV %s %s :%s", |
|
"RESV %s %s :%s", |
|
249 |
parv[1], parv[2], parv[3]); |
parv[1], parv[2], parv[3]); |
250 |
|
|
251 |
if (!IsClient(source_p) || match(parv[1], me.name)) |
if (match(parv[1], me.name)) |
252 |
return 0; |
return 0; |
253 |
|
|
254 |
if (HasFlag(source_p, FLAGS_SERVICE) || find_matching_name_conf(CONF_ULINE, source_p->servptr->name, |
if (HasFlag(source_p, FLAGS_SERVICE) || |
255 |
|
find_matching_name_conf(CONF_ULINE, source_p->servptr->name, |
256 |
source_p->username, source_p->host, |
source_p->username, source_p->host, |
257 |
SHARED_RESV)) |
SHARED_RESV)) |
258 |
parse_resv(source_p, parv[2], 0, parv[3]); |
parse_resv(source_p, parv[2], 0, parv[3]); |