ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_whois.c
(Generate patch)

Comparing:
ircd-hybrid/modules/m_whois.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_whois.c (file contents), Revision 280 by db, Wed Nov 23 23:09:48 2005 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: m_whois.c,v 1.145 2005/09/27 12:43:33 adx Exp $
22 > *  $Id$
23   */
24  
25   #include "stdinc.h"
# Line 59 | Line 59 | struct Message whois_msgtab = {
59   };
60  
61   #ifndef STATIC_MODULES
62 < const char *_version = "$Revision: 1.145 $";
62 > const char *_version = "$Revision$";
63   static struct Callback *whois_cb;
64  
65   static void *
# Line 106 | Line 106 | m_whois(struct Client *client_p, struct
106      return;
107    }
108  
109 <  if (parc > 2)
109 >  if (parc > 2 && !EmptyString(parv[2]))
110    {
111      /* seeing as this is going across servers, we should limit it */
112      if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
# Line 155 | Line 155 | mo_whois(struct Client *client_p, struct
155      return;
156    }
157  
158 <  if (parc > 2)
158 >  if (parc > 2 && !EmptyString(parv[2]))
159    {
160      if (hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1,
161                      parc, parv) != HUNTED_ISME)
# Line 182 | Line 182 | mo_whois(struct Client *client_p, struct
182   static void
183   do_whois(struct Client *source_p, int parc, char **parv)
184   {
185 +  static time_t last_used = 0;
186    struct Client *target_p;
187    char *nick;
188    char *p = NULL;
# Line 203 | Line 204 | do_whois(struct Client *source_p, int pa
204      if ((target_p = find_client(nick)) != NULL)
205      {
206        if (IsServer(source_p->from))
207 <        client_burst_if_needed(source_p->from, target_p);
207 >        client_burst_if_needed(source_p->from, target_p);
208  
209        if (IsClient(target_p))
210        {
211 <        whois_person(source_p, target_p);
212 <        found = 1;
211 >        whois_person(source_p, target_p);
212 >        found = 1;
213        }
214      }
215      else if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
# Line 228 | Line 229 | do_whois(struct Client *source_p, int pa
229      if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
230        return;
231  
232 +    if (!IsOper(source_p))
233 +    {
234 +      if ((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
235 +      {
236 +        sendto_one(source_p, form_str(RPL_LOAD2HI),
237 +                   me.name, source_p->name);
238 +        return;
239 +      }
240 +      else
241 +        last_used = CurrentTime;
242 +  }
243 +
244      /* Oh-oh wilds is true so have to do it the hard expensive way */
245      if (MyClient(source_p))
246        found = global_whois(source_p, nick);
# Line 411 | Line 424 | whois_person(struct Client *source_p, st
424      sendto_one(source_p, form_str(RPL_ISCAPTURED),
425                 me.name, source_p->name, target_p->name);
426  
427 <  if (ConfigFileEntry.use_whois_actually && (target_p->sockhost[0] != '\0') &&
428 <      !(ConfigFileEntry.hide_spoof_ips && IsIPSpoof(target_p)) &&
429 <      !(target_p->sockhost[0] == '0' && target_p->sockhost[1] == '\0'))
430 <  {
431 <    if (IsAdmin(source_p) || source_p == target_p)
432 <      sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
433 <                 me.name, source_p->name, target_p->name, target_p->sockhost);
434 <    else
435 <      sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
436 <                 me.name, source_p->name, target_p->name,
437 <                 IsIPSpoof(target_p) || IsOper(target_p) ?
438 <                 "255.255.255.255" : target_p->sockhost);
427 >  if (ConfigFileEntry.use_whois_actually)
428 >  {
429 >    int show_ip = 0;
430 >
431 >    if ((target_p->sockhost[0] != '\0') && (target_p->sockhost[0] == '0' &&
432 >                                            target_p->sockhost[1] == '\0'))
433 >    {
434 >      if ((IsAdmin(source_p) || source_p == target_p))
435 >        show_ip = 1;
436 >      else if (IsIPSpoof(target_p))
437 >        show_ip = (IsOper(source_p) && !ConfigFileEntry.hide_spoof_ips);
438 >      else
439 >        show_ip = 1;
440 >
441 >        sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
442 >                   me.name, source_p->name, target_p->name,
443 >                   show_ip ? target_p->sockhost : "255.255.255.255");
444 >    }
445    }
446  
447    if (MyConnect(target_p)) /* Can't do any of this if not local! db */

Comparing:
ircd-hybrid/modules/m_whois.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_whois.c (property svn:keywords), Revision 280 by db, Wed Nov 23 23:09:48 2005 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)