]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/send.c
Add .gitignore
[irc/rqf/shadowircd.git] / src / send.c
index f31041e8aa2c01899c8dbaced9ed13980f148a38..e82acd963471b9360f2a367f12e8f562d1ef9717 100644 (file)
@@ -21,7 +21,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: send.c 3520 2007-06-30 22:15:35Z jilles $
  */
 
 #include "stdinc.h"
@@ -85,10 +84,7 @@ _send_linebuf(struct Client *to, buf_head_t *linebuf)
                             get_sendq(to));
                }
 
-               if(IsClient(to))
-                       to->flags |= FLAGS_SENDQEX;
-
-               dead_link(to);
+               dead_link(to, 1);
                return -1;
        }
        else
@@ -200,7 +196,7 @@ send_queued(struct Client *to)
 
                if(retlen == 0 || (retlen < 0 && !rb_ignore_errno(errno)))
                {
-                       dead_link(to);
+                       dead_link(to, 0);
                        return;
                }
        }
@@ -587,7 +583,7 @@ sendto_channel_opmod(struct Client *one, struct Client *source_p,
                if(IsIOError(target_p->from) || target_p->from == one)
                        continue;
 
-               if((msptr->flags & CHFL_CHANOP) == 0)
+               if(!is_any_op(msptr))
                        continue;
 
                if(IsDeaf(target_p))
@@ -649,7 +645,12 @@ sendto_channel_local(int type, struct Channel *chptr, const char *pattern, ...)
                if(IsIOError(target_p))
                        continue;
 
-               if(type && ((msptr->flags & type) == 0))
+               if(type == ONLY_OPERS)
+               {
+                       if(!IsOper(target_p))
+                               continue;
+               }
+               else if(type && ((msptr->flags & type) == 0))
                        continue;
 
                _send_linebuf(target_p, &linebuf);
@@ -760,69 +761,6 @@ sendto_common_channels_local(struct Client *user, const char *pattern, ...)
        rb_linebuf_donebuf(&linebuf);
 }
 
-/*
- * sendto_common_channels_local()
- *
- * inputs      - pointer to client
- *              - capability
- *             - pattern to send
- * output      - NONE
- * side effects        - Sends a message to all people on local server who are
- *               in same channel with user. 
- *               used by m_nick.c and exit_one_client.
- */
-void
-sendto_common_channels_local_with_capability(struct Client *user, int capability, const char *pattern, ...)
-{
-       va_list args;
-       rb_dlink_node *ptr;
-       rb_dlink_node *next_ptr;
-       rb_dlink_node *uptr;
-       rb_dlink_node *next_uptr;
-       struct Channel *chptr;
-       struct Client *target_p;
-       struct membership *msptr;
-       struct membership *mscptr;
-       buf_head_t linebuf;
-
-       rb_linebuf_newbuf(&linebuf);
-       va_start(args, pattern);
-       rb_linebuf_putmsg(&linebuf, pattern, &args, NULL);
-       va_end(args);
-
-       ++current_serial;
-
-       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, user->user->channel.head)
-       {
-               mscptr = ptr->data;
-               chptr = mscptr->chptr;
-
-               RB_DLINK_FOREACH_SAFE(uptr, next_uptr, chptr->locmembers.head)
-               {
-                       msptr = uptr->data;
-                       target_p = msptr->client_p;
-
-                       if(!IsCapable(target_p, capability))
-                               continue;
-
-                       if(IsIOError(target_p) ||
-                          target_p->serial == current_serial)
-                               continue;
-
-                       target_p->serial = current_serial;
-                       send_linebuf(target_p, &linebuf);
-               }
-       }
-
-       /* this can happen when the user isnt in any channels, but we still
-        * need to send them the data, ie a nick change
-        */
-       if(MyConnect(user) && (user->serial != current_serial))
-               send_linebuf(user, &linebuf);
-
-       rb_linebuf_donebuf(&linebuf);
-}
-
 /*
  * sendto_common_channels_local_butone()
  *