0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-09 20:18:34 +02:00

m_alias: minor cleanup

This commit is contained in:
Elizabeth Myers 2016-04-06 07:33:36 -05:00
parent a559032938
commit dd598516c8

View file

@ -97,7 +97,7 @@ _moddeinit(void)
} }
static int static int
reload_aliases(hook_data *data __unused) reload_aliases(hook_data *data)
{ {
destroy_aliases(); /* Clear old aliases */ destroy_aliases(); /* Clear old aliases */
create_aliases(); create_aliases();
@ -114,9 +114,10 @@ m_alias(struct MsgBuf *msgbuf, struct Client *client_p, struct Client *source_p,
if(aptr == NULL) if(aptr == NULL)
{ {
if(IsPerson(source_p)) /* This shouldn't happen... */
sendto_one(source_p, form_str(ERR_UNKNOWNCOMMAND), if(IsPerson(client_p))
me.name, source_p->name, msgbuf->cmd); sendto_one(client_p, form_str(ERR_UNKNOWNCOMMAND),
me.name, client_p->name, msgbuf->cmd);
return; return;
} }
@ -129,8 +130,8 @@ m_alias(struct MsgBuf *msgbuf, struct Client *client_p, struct Client *source_p,
return; return;
} }
if(!IsFloodDone(source_p) && source_p->localClient->receiveM > 20) if(!IsFloodDone(client_p) && client_p->localClient->receiveM > 20)
flood_endgrace(source_p); flood_endgrace(client_p);
p = strchr(aptr->target, '@'); p = strchr(aptr->target, '@');
if(p != NULL) if(p != NULL)
@ -150,13 +151,13 @@ m_alias(struct MsgBuf *msgbuf, struct Client *client_p, struct Client *source_p,
if(target_p == NULL) if(target_p == NULL)
{ {
sendto_one_numeric(source_p, ERR_SERVICESDOWN, form_str(ERR_SERVICESDOWN), aptr->target); sendto_one_numeric(client_p, ERR_SERVICESDOWN, form_str(ERR_SERVICESDOWN), aptr->target);
return; return;
} }
if(*parv[1] == '\0') if(EmptyString(parv[1]))
{ {
sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name); sendto_one(client_p, form_str(ERR_NOTEXTTOSEND), me.name, target_p->name);
return; return;
} }
@ -164,7 +165,7 @@ m_alias(struct MsgBuf *msgbuf, struct Client *client_p, struct Client *source_p,
aptr->hits++; aptr->hits++;
sendto_one(target_p, ":%s PRIVMSG %s :%s", sendto_one(target_p, ":%s PRIVMSG %s :%s",
get_id(source_p, target_p), get_id(client_p, target_p),
p != NULL ? aptr->target : get_id(target_p, target_p), p != NULL ? aptr->target : get_id(target_p, target_p),
parv[1]); parv[1]);
} }