I think I really fixed svsmode this time

This commit is contained in:
fishwaldo 2002-09-25 07:43:28 +00:00
parent e1078aa47e
commit 468a75f9b1
3 changed files with 24 additions and 35 deletions

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: s_user.h,v 1.4 2002/09/13 06:50:06 fishwaldo Exp $ * $Id: s_user.h,v 1.5 2002/09/25 07:43:27 fishwaldo Exp $
*/ */
#ifndef INCLUDED_s_user_h #ifndef INCLUDED_s_user_h
@ -34,7 +34,7 @@ extern time_t LastUsedWallops;
extern int user_mode(struct Client* , struct Client* , int, char** ); extern int user_mode(struct Client* , struct Client* , int, char** );
extern void send_umode (struct Client* , struct Client* , extern void send_umode (struct Client* , struct Client* ,
int, int, char* ); int, int, char* );
extern void send_umode_out(struct Client* , struct Client* , int); extern void send_umode_out(struct Client*, struct Client* , struct Client* , int);
extern int show_lusers(struct Client* source_p); extern int show_lusers(struct Client* source_p);
extern int register_local_user(struct Client* ,struct Client* , extern int register_local_user(struct Client* ,struct Client* ,
char* ,char* ); char* ,char* );

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: m_svscmds.c,v 1.7 2002/09/23 10:47:30 fishwaldo Exp $ * $Id: m_svscmds.c,v 1.8 2002/09/25 07:43:28 fishwaldo Exp $
*/ */
/* List of ircd includes from ../include/ */ /* List of ircd includes from ../include/ */
@ -34,6 +34,7 @@
#include "s_conf.h" #include "s_conf.h"
#include "s_log.h" #include "s_log.h"
#include "s_serv.h" #include "s_serv.h"
#include "s_user.h"
#include "send.h" #include "send.h"
#include "msg.h" #include "msg.h"
#include "parse.h" #include "parse.h"
@ -133,7 +134,7 @@ _moddeinit(void)
/* When we last modified the file (shown in /modlist), this is usually: /* When we last modified the file (shown in /modlist), this is usually:
*/ */
const char *_version = "$Revision: 1.7 $"; const char *_version = "$Revision: 1.8 $";
#endif #endif
/* /*
@ -311,17 +312,11 @@ static void ms_svsjoin(struct Client *client_p, struct Client *source_p,
char sjmode; char sjmode;
char *newch; char *newch;
/* if its from a client, and its not services, ignore it */
if(!IsServices(source_p) && IsClient(source_p))
{
sendto_one(source_p, ":%s NOTICE %s :Restricted to Services", me.name, parv[0]);
return;
}
/* if its from a server, and its not ulined, ignore it */ /* if its from a server, and its not ulined, ignore it */
if (!IsUlined(source_p) && IsServer(source_p)) if (!IsUlined(source_p) && IsServer(source_p))
return; return;
if((hunt_server(client_p, source_p, ":%s FORCEJOIN %s %s", 1, parc, parv)) != HUNTED_ISME) if((hunt_server(client_p, source_p, ":%s SVSJOIN %s %s", 1, parc, parv)) != HUNTED_ISME)
return; return;
/* if target_p is not existant, print message /* if target_p is not existant, print message
@ -481,17 +476,11 @@ static void ms_svspart(struct Client *client_p, struct Client *source_p,
struct Client *target_p; struct Client *target_p;
struct Channel *chptr; struct Channel *chptr;
/* if its from a client, and its not services, ignore it */
if(!IsServices(source_p) && IsClient(source_p))
{
sendto_one(source_p, ":%s NOTICE %s :Restricted to Services", me.name, parv[0]);
return;
}
/* if its from a server, and its not ulined, ignore it */ /* if its from a server, and its not ulined, ignore it */
if (!IsUlined(source_p) && IsServer(source_p)) if (!IsUlined(source_p) && IsServer(source_p))
return; return;
if((hunt_server(client_p, source_p, ":%s FORCEPART %s %s", 1, parc, parv)) != HUNTED_ISME) if((hunt_server(client_p, source_p, ":%s SVSPART %s %s", 1, parc, parv)) != HUNTED_ISME)
return; return;
/* if target_p == NULL then let the oper know */ /* if target_p == NULL then let the oper know */

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: s_user.c,v 1.22 2002/09/24 13:49:45 fishwaldo Exp $ * $Id: s_user.c,v 1.23 2002/09/25 07:43:28 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -1100,7 +1100,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, char *parv
me.name, parv[0]); me.name, parv[0]);
target_p->umodes &= ~FLAGS_ADMIN; target_p->umodes &= ~FLAGS_ADMIN;
} }
if (!IsUlined(target_p->from) && (target_p->umodes & FLAGS_SERVICES)) if (!IsUlined(target_p->from) && (setflags & FLAGS_SERVICES))
{ {
sendto_one(source_p, ":%s NOTICE %s :*** Only Services can set +S", sendto_one(source_p, ":%s NOTICE %s :*** Only Services can set +S",
me.name, parv[0]); me.name, parv[0]);
@ -1124,7 +1124,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, char *parv
* compare new flags with old flags and send string which * compare new flags with old flags and send string which
* will cause servers to update correctly. * will cause servers to update correctly.
*/ */
send_umode_out(client_p, target_p, setflags); send_umode_out(source_p, client_p, target_p, setflags);
return 0; return 0;
} }
@ -1192,32 +1192,32 @@ send_umode(struct Client *client_p, struct Client *source_p, int old,
* side effects - Only send ubuf out to servers that know about this client * side effects - Only send ubuf out to servers that know about this client
*/ */
void void
send_umode_out(struct Client *client_p, send_umode_out(struct Client *source_p, struct Client *client_p,
struct Client *source_p, struct Client *target_p,
int old) int old)
{ {
struct Client *target_p; struct Client *starget_p;
char buf[BUFSIZE]; char buf[BUFSIZE];
dlink_node *ptr; dlink_node *ptr;
send_umode(source_p, source_p, old, ALL_UMODES, buf); send_umode(target_p, target_p, old, ALL_UMODES, buf);
for(ptr = serv_list.head; ptr; ptr = ptr->next) for(ptr = serv_list.head; ptr; ptr = ptr->next)
{ {
target_p = ptr->data; starget_p = ptr->data;
if((target_p != client_p) && (target_p != source_p) && (*buf)) if((starget_p != client_p) && (starget_p != client_p) && (*buf))
{ {
if((!(ServerInfo.hub && IsCapable(target_p, CAP_LL))) if((!(ServerInfo.hub && IsCapable(starget_p, CAP_LL)))
|| (target_p->localClient->serverMask & || (starget_p->localClient->serverMask &
source_p->lazyLinkClientExists)) target_p->lazyLinkClientExists))
sendto_one(target_p, ":%s MODE %s :%s", sendto_one(starget_p, ":%s MODE %s :%s",
client_p->name, source_p->name, buf); source_p->name, target_p->name, buf);
} }
} }
if (client_p && MyClient(client_p)) if (client_p && MyClient(target_p))
send_umode(client_p, source_p, old, ALL_UMODES, buf); send_umode(client_p, target_p, old, ALL_UMODES, buf);
} }
/* /*
@ -1403,7 +1403,7 @@ oper_up( struct Client *source_p, struct ConfItem *aconf )
sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_ALL, sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_ALL,
"%s (%s@%s) is now an %s", source_p->name, "%s (%s@%s) is now an %s", source_p->name,
source_p->username, source_p->host, (IsOperAdmin(source_p) ? "Administrator" : "Operator")); source_p->username, source_p->host, (IsOperAdmin(source_p) ? "Administrator" : "Operator"));
send_umode_out(source_p, source_p, old); send_umode_out(source_p, source_p, source_p, old);
sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name, sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name,
source_p->name, operprivs); source_p->name, operprivs);