42 |
|
#include "s_user.h" |
43 |
|
|
44 |
|
static void m_list(struct Client *, struct Client *, int, char **); |
45 |
– |
static void ms_list(struct Client *, struct Client *, int, char **); |
45 |
|
static void mo_list(struct Client *, struct Client *, int, char **); |
46 |
|
|
47 |
|
struct Message list_msgtab = { |
48 |
|
"LIST", 0, 0, 0, 0, MFLG_SLOW, 0, |
49 |
< |
{m_unregistered, m_list, ms_list, m_ignore, mo_list, m_ignore} |
49 |
> |
{m_unregistered, m_list, m_ignore, m_ignore, mo_list, m_ignore} |
50 |
|
}; |
51 |
|
|
52 |
|
#ifndef STATIC_MODULES |
87 |
|
struct ListTask *lt; |
88 |
|
int no_masked_channels; |
89 |
|
|
90 |
< |
if (MyConnect(source_p)) |
90 |
> |
if (source_p->localClient->list_task != NULL) |
91 |
|
{ |
92 |
< |
if (source_p->localClient->list_task != NULL) |
93 |
< |
{ |
94 |
< |
free_list_task(source_p->localClient->list_task, source_p); |
96 |
< |
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); |
97 |
< |
return; |
98 |
< |
} |
92 |
> |
free_list_task(source_p->localClient->list_task, source_p); |
93 |
> |
sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); |
94 |
> |
return; |
95 |
|
} |
96 |
|
|
97 |
< |
lt = (struct ListTask *) MyMalloc(sizeof(struct ListTask)); |
97 |
> |
lt = MyMalloc(sizeof(struct ListTask)); |
98 |
|
lt->users_max = UINT_MAX; |
99 |
|
lt->created_max = UINT_MAX; |
100 |
|
lt->topicts_max = UINT_MAX; |
101 |
< |
if (MyConnect(source_p)) |
102 |
< |
source_p->localClient->list_task = lt; |
101 |
> |
source_p->localClient->list_task = lt; |
102 |
> |
|
103 |
|
no_masked_channels = 1; |
104 |
|
|
105 |
|
if (parc > 1) |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
< |
if (MyConnect(source_p)) |
195 |
< |
dlinkAdd(source_p, make_dlink_node(), &listing_client_list); |
194 |
> |
dlinkAdd(source_p, make_dlink_node(), &listing_client_list); |
195 |
> |
|
196 |
|
sendto_one(source_p, form_str(RPL_LISTSTART), |
197 |
|
MyConnect(source_p) ? me.name : ID(&me), |
198 |
|
MyConnect(source_p) ? source_p->name : ID(source_p)); |
211 |
|
{ |
212 |
|
static time_t last_used = 0; |
213 |
|
|
218 |
– |
/* If not a LazyLink connection, see if its still paced */ |
219 |
– |
/* If we're forwarding this to uplinks.. it should be paced due to the |
220 |
– |
* traffic involved in /list.. -- fl_ */ |
214 |
|
if (((last_used + ConfigFileEntry.pace_wait) > CurrentTime)) |
215 |
|
{ |
216 |
|
sendto_one(source_p,form_str(RPL_LOAD2HI),me.name,parv[0]); |
217 |
|
return; |
218 |
|
} |
226 |
– |
else |
227 |
– |
last_used = CurrentTime; |
219 |
|
|
220 |
< |
/* If its a LazyLinks connection, let uplink handle the list */ |
230 |
< |
if (uplink && IsCapable(uplink, CAP_LL)) |
231 |
< |
{ |
232 |
< |
if (parc < 2) |
233 |
< |
sendto_one(uplink, ":%s LIST", source_p->name); |
234 |
< |
else |
235 |
< |
sendto_one(uplink, ":%s LIST %s", source_p->name, parv[1]); |
236 |
< |
return; |
237 |
< |
} |
220 |
> |
last_used = CurrentTime; |
221 |
|
|
222 |
|
do_list(source_p, parc, parv); |
223 |
|
} |
231 |
|
mo_list(struct Client *client_p, struct Client *source_p, |
232 |
|
int parc, char *parv[]) |
233 |
|
{ |
251 |
– |
/* If its a LazyLinks connection, let uplink handle the list |
252 |
– |
* even for opers! |
253 |
– |
*/ |
254 |
– |
|
255 |
– |
if (uplink && IsCapable(uplink, CAP_LL)) |
256 |
– |
{ |
257 |
– |
if (parc < 2) |
258 |
– |
sendto_one(uplink, ":%s LIST", source_p->name); |
259 |
– |
else |
260 |
– |
sendto_one(uplink, ":%s LIST %s", source_p->name, parv[1]); |
261 |
– |
return; |
262 |
– |
} |
263 |
– |
|
234 |
|
do_list(source_p, parc, parv); |
235 |
|
} |
266 |
– |
|
267 |
– |
/* |
268 |
– |
** ms_list |
269 |
– |
** parv[0] = sender prefix |
270 |
– |
** parv[1] = channel |
271 |
– |
*/ |
272 |
– |
static void |
273 |
– |
ms_list(struct Client *client_p, struct Client *source_p, |
274 |
– |
int parc, char *parv[]) |
275 |
– |
{ |
276 |
– |
/* Only allow remote list if LazyLink request */ |
277 |
– |
if (ServerInfo.hub) |
278 |
– |
{ |
279 |
– |
if (!IsCapable(client_p->from, CAP_LL) && !MyConnect(source_p)) |
280 |
– |
return; |
281 |
– |
|
282 |
– |
do_list(source_p, parc, parv); |
283 |
– |
} |
284 |
– |
} |