]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/channel.c
Add some ircd-seven love to CREDITS.
[irc/rqf/shadowircd.git] / src / channel.c
index 02d5c3d52d88837fe032a64147f170e2959fb1e0..74767f4d57880f3a08064a2e5c15cb237c7cede8 100644 (file)
@@ -968,9 +968,6 @@ can_send(struct Channel *chptr, struct Client *source_p, struct membership *mspt
        if(is_chanop_voiced(msptr))
                return CAN_SEND_OPV;
 
-       if(IsOverride(source_p))
-               return CAN_SEND_NONOP;
-
        if(chptr->mode.mode & MODE_MODERATED)
                return CAN_SEND_NO;
 
@@ -1535,6 +1532,57 @@ send_cap_mode_changes(struct Client *client_p, struct Client *source_p,
        }
 }
 
+void 
+resv_chan_forcepart(const char *name, const char *reason, int temp_time)
+{
+       rb_dlink_node *ptr;
+       rb_dlink_node *next_ptr;
+       struct Channel *chptr;
+       struct membership *msptr;
+       struct Client *target_p;
+
+       if(!ConfigChannel.resv_forcepart)
+               return;
+
+       /* for each user on our server in the channel list
+        * send them a PART, and notify opers.
+        */
+       chptr = find_channel(name);
+       if(chptr != NULL)
+       {
+               RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
+               {
+                       msptr = ptr->data;
+                       target_p = msptr->client_p;
+
+                       if(IsExemptResv(target_p))
+                               continue;
+
+                       sendto_server(target_p, chptr, CAP_TS6, NOCAPS,
+                                     ":%s PART %s", target_p->id, chptr->chname);
+
+                       sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
+                                            target_p->name, target_p->username,
+                                            target_p->host, chptr->chname, target_p->name);
+
+                       remove_user_from_channel(msptr);
+
+                       /* notify opers & user they were removed from the channel */
+                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                            "Forced PART for %s!%s@%s from %s (%s)",
+                                            target_p->name, target_p->username, 
+                                            target_p->host, name, reason);
+
+                       if(temp_time > 0)
+                               sendto_one_notice(target_p, ":*** Channel %s is temporarily unavailable on this server.",
+                                          name);
+                       else
+                               sendto_one_notice(target_p, ":*** Channel %s is no longer available on this server.",
+                                          name);
+               }
+       }
+}
+
 /* Check what we will forward to, without sending any notices to the user
  * -- jilles
  */
@@ -1818,7 +1866,7 @@ void user_join(struct Client * client_p, struct Client * source_p, const char *
                                        get_oper_name(source_p), chptr->chname);
                                sendto_server(NULL, chptr, NOCAPS, NOCAPS,
                                                ":%s WALLOPS :%s is overriding JOIN to [%s]",
-                                               use_id(source_p), get_oper_name(source_p), chptr->chname);
+                                               me.name, get_oper_name(source_p), chptr->chname);
                        }
                        else if ((i != ERR_NEEDREGGEDNICK && i != ERR_THROTTLE && i != ERR_INVITEONLYCHAN && i != ERR_CHANNELISFULL) ||
                            (!ConfigChannel.use_forward || (chptr = check_forward(source_p, chptr, key)) == NULL))