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/trunk/src/send.c (file contents):
Revision 1617 by michael, Sat Oct 27 21:02:32 2012 UTC vs.
Revision 1618 by michael, Tue Oct 30 21:04:38 2012 UTC

# Line 109 | Line 109 | send_message(struct Client *to, char *bu
109    if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to))
110    {
111      if (IsServer(to))
112 <      sendto_realops_flags(UMODE_ALL, L_ALL,
112 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
113                             "Max SendQ limit exceeded for %s: %lu > %lu",
114                             get_client_name(to, HIDE_IP),
115                             (unsigned long)(dbuf_length(&to->localClient->buf_sendq) + len),
# Line 152 | Line 152 | send_message_remote(struct Client *to, s
152   {
153    if (!MyConnect(to))
154    {
155 <    sendto_realops_flags(UMODE_ALL, L_ALL,
155 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
156                           "server send message to %s [%s] dropped from %s(Not local server)",
157                           to->name, to->from->name, from->name);
158      return;
# Line 165 | Line 165 | send_message_remote(struct Client *to, s
165    {
166      if (IsServer(from))
167      {
168 <      sendto_realops_flags(UMODE_ALL, L_ALL,
168 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
169                             "Send message to %s [%s] dropped from %s(Fake Dir)",
170                             to->name, to->from->name, from->name);
171        return;
172      }
173  
174 <    sendto_realops_flags(UMODE_ALL, L_ALL,
174 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
175                           "Ghosted: %s[%s@%s] from %s[%s@%s] (%s)",
176                           to->name, to->username, to->host,
177                           from->name, from->username, from->host,
# Line 892 | Line 892 | sendto_anywhere(struct Client *to, struc
892   * side effects - Send to *local* ops only but NOT +s nonopers.
893   */
894   void
895 < sendto_realops_flags(unsigned int flags, int level, const char *pattern, ...)
895 > sendto_realops_flags(unsigned int flags, int level, int type, const char *pattern, ...)
896   {
897 +  const char *ntype = NULL;
898    dlink_node *ptr = NULL;
899    char nbuf[IRCD_BUFSIZE];
900    va_list args;
901  
902    va_start(args, pattern);
903 <  vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
903 >  vsnprintf(nbuf, sizeof(nbuf), pattern, args);
904    va_end(args);
905  
906 <  DLINK_FOREACH(ptr, oper_list.head)
906 >  switch (type)
907    {
908 <    struct Client *client_p = ptr->data;
909 <    assert(HasUMode(client_p, UMODE_OPER));
910 <
911 <    /* If we're sending it to opers and theyre an admin, skip.
912 <     * If we're sending it to admins, and theyre not, skip.
913 <     */
914 <    if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
915 <        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
916 <      continue;
917 <
918 <    if (HasUMode(client_p, flags))
918 <      sendto_one(client_p, ":%s NOTICE %s :*** Notice -- %s",
919 <                 me.name, client_p->name, nbuf);
908 >    case SEND_NOTICE:
909 >      ntype = "Notice";
910 >      break;
911 >    case SEND_GLOBAL:
912 >      ntype = "Global";
913 >      break;
914 >    case SEND_LOCOPS:
915 >      ntype = "LocOps";
916 >      break;
917 >    default:
918 >      assert(0);
919    }
921 }
922
923 void
924 sendto_globops_flags(unsigned int flags, int level, const char *pattern, ...)
925 {
926  dlink_node *ptr = NULL;
927  char nbuf[IRCD_BUFSIZE];
928  va_list args;
929
930  va_start(args, pattern);
931  vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
932  va_end(args);
920  
921    DLINK_FOREACH(ptr, oper_list.head)
922    {
923      struct Client *client_p = ptr->data;
924 <    assert(client_p->umodes & UMODE_OPER);
924 >    assert(HasUMode(client_p, UMODE_OPER));
925  
926 <    /* If we're sending it to opers and theyre an admin, skip.
927 <     * If we're sending it to admins, and theyre not, skip.
926 >    /*
927 >     * If we're sending it to opers and they're an admin, skip.
928 >     * If we're sending it to admins, and they're not, skip.
929       */
930      if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
931 <        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
931 >        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
932        continue;
933  
934      if (HasUMode(client_p, flags))
935 <      sendto_one(client_p, ":%s NOTICE %s :*** Global -- %s",
936 <                 me.name, client_p->name, nbuf);
935 >      sendto_one(client_p, ":%s NOTICE %s :*** %s -- %s",
936 >                 me.name, client_p->name, ntype, nbuf);
937    }
938   }
939  
# Line 1023 | Line 1011 | ts_warn(const char *pattern, ...)
1011    vsnprintf(buffer, sizeof(buffer), pattern, args);
1012    va_end(args);
1013  
1014 <  sendto_realops_flags(UMODE_ALL, L_ALL, "%s", buffer);
1014 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s", buffer);
1015    ilog(LOG_TYPE_IRCD, "%s", buffer);
1016   }
1017  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines