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

Comparing:
ircd-hybrid-7.3/src/send.c (file contents), Revision 1078 by michael, Sun Mar 7 22:55:05 2010 UTC vs.
ircd-hybrid-8/src/send.c (file contents), Revision 1243 by michael, Fri Sep 30 10:47:53 2011 UTC

# Line 27 | Line 27
27   #include "send.h"
28   #include "channel.h"
29   #include "client.h"
30 #include "common.h"
30   #include "dbuf.h"
31   #include "irc_string.h"
32   #include "ircd.h"
34 #include "handlers.h"
33   #include "numeric.h"
34   #include "fdlist.h"
35   #include "s_bsd.h"
# Line 41 | Line 39
39   #include "s_log.h"
40   #include "memory.h"
41   #include "hook.h"
44 #include "irc_getnameinfo.h"
42   #include "packet.h"
43  
44  
# Line 190 | Line 187 | send_message_remote(struct Client *to, s
187                    me.name, to->name, me.name, to->name,
188                    to->username, to->host, to->from->name);
189  
190 <    SetKilled(to);
190 >    AddFlag(to, FLAGS_KILLED);
191  
192      if (IsClient(from))
193        sendto_one(from, form_str(ERR_GHOSTEDCLIENT),
# Line 492 | Line 489 | sendto_channel_butone(struct Client *one
489  
490      assert(IsClient(target_p));
491  
492 <    if (IsDefunct(target_p) || IsDeaf(target_p) || target_p->from == one)
492 >    if (IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF) || target_p->from == one)
493        continue;
494  
495      if (MyConnect(target_p))
# Line 664 | Line 661 | sendto_channel_local(int type, int nodea
661        continue;
662  
663      if (!MyConnect(target_p) || IsDefunct(target_p) ||
664 <        (nodeaf && IsDeaf(target_p)))
664 >        (nodeaf && HasUMode(target_p, UMODE_DEAF)))
665        continue;
666  
667      send_message(target_p, buffer, len);
# Line 707 | Line 704 | sendto_channel_local_butone(struct Clien
704        continue;
705  
706      if (!MyConnect(target_p) || target_p == one ||
707 <        IsDefunct(target_p) || IsDeaf(target_p))
707 >        IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF))
708        continue;
709      send_message(target_p, buffer, len);
710    }
# Line 986 | Line 983 | sendto_realops_flags(unsigned int flags,
983    DLINK_FOREACH(ptr, oper_list.head)
984    {
985      struct Client *client_p = ptr->data;
986 <    assert(client_p->umodes & UMODE_OPER);
986 >    assert(HasUMode(client_p, UMODE_OPER));
987  
988      /* If we're sending it to opers and theyre an admin, skip.
989       * If we're sending it to admins, and theyre not, skip.
990       */
991 <    if (((level == L_ADMIN) && !IsAdmin(client_p)) ||
992 <        ((level == L_OPER) && IsAdmin(client_p)))
991 >    if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
992 >        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
993        continue;
994  
995 <    if (client_p->umodes & flags)
995 >    if (HasUMode(client_p, flags))
996        sendto_one(client_p, ":%s NOTICE %s :*** Notice -- %s",
997                   me.name, client_p->name, nbuf);
998    }
999   }
1000  
1001 + void
1002 + sendto_globops_flags(unsigned int flags, int level, const char *pattern, ...)
1003 + {
1004 +  dlink_node *ptr = NULL;
1005 +  char nbuf[IRCD_BUFSIZE];
1006 +  va_list args;
1007 +
1008 +  va_start(args, pattern);
1009 +  vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
1010 +  va_end(args);
1011 +
1012 +  DLINK_FOREACH(ptr, oper_list.head)
1013 +  {
1014 +    struct Client *client_p = ptr->data;
1015 +    assert(client_p->umodes & UMODE_OPER);
1016 +
1017 +    /* If we're sending it to opers and theyre an admin, skip.
1018 +     * If we're sending it to admins, and theyre not, skip.
1019 +     */
1020 +    if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
1021 +        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
1022 +      continue;
1023 +
1024 +    if (HasUMode(client_p, flags))
1025 +      sendto_one(client_p, ":%s NOTICE %s :*** Global -- %s",
1026 +                 me.name, client_p->name, nbuf);
1027 +  }
1028 + }
1029 +
1030   /* sendto_wallops_flags()
1031   *
1032   * inputs       - flag types of messages to show to real opers
# Line 1033 | Line 1059 | sendto_wallops_flags(unsigned int flags,
1059      struct Client *client_p = ptr->data;
1060      assert(client_p->umodes & UMODE_OPER);
1061  
1062 <    if ((client_p->umodes & flags) && !IsDefunct(client_p))
1062 >    if (HasUMode(client_p, flags) && !IsDefunct(client_p))
1063        send_message(client_p, buffer, len);
1064    }
1065   }
# Line 1072 | Line 1098 | ts_warn(const char *pattern, ...)
1098    }
1099  
1100    va_start(args, pattern);
1101 <  vsprintf_irc(buffer, pattern, args);
1101 >  vsnprintf(buffer, sizeof(buffer), pattern, args);
1102    va_end(args);
1103  
1104    sendto_realops_flags(UMODE_ALL, L_ALL, "%s", buffer);
# Line 1130 | Line 1156 | kill_client_ll_serv_butone(struct Client
1156    char buf_uid[IRCD_BUFSIZE], buf_nick[IRCD_BUFSIZE];
1157    int len_uid = 0, len_nick = 0;
1158  
1159 <  if (HasID(source_p) && (me.id[0] != '\0'))
1159 >  if (HasID(source_p))
1160    {
1161      have_uid = 1;
1162      va_start(args, pattern);

Diff Legend

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