-static void do_alias(struct alias_entry *aptr, struct Client *source_p, char *text)
-{
- char *p;
- struct Client *target_p;
-
- if (!IsFloodDone(source_p) && source_p->localClient->receiveM > 20)
- flood_endgrace(source_p);
-
- p = strchr(aptr->target, '@');
- if (p != NULL)
- {
- /* user@server */
- target_p = find_server(NULL, p + 1);
- if (target_p != NULL && IsMe(target_p))
- target_p = NULL;
- }
- else
- {
- /* nick, must be +S */
- target_p = find_named_person(aptr->target);
- if (target_p != NULL && !IsService(target_p))
- target_p = NULL;
- }
-
- if (target_p == NULL)
- {
- sendto_one_numeric(source_p, ERR_SERVICESDOWN, form_str(ERR_SERVICESDOWN), aptr->target);
- return;
- }
-
- if (text != NULL && *text == ':')
- text++;
- if (text == NULL || *text == '\0')
- {
- sendto_one(source_p, form_str(ERR_NOTEXTTOSEND), me.name, source_p->name);
- return;
- }
-
- /* increment the hitcounter on this alias */
- aptr->hits++;
-
- sendto_one(target_p, ":%s PRIVMSG %s :%s",
- get_id(source_p, target_p),
- p != NULL ? aptr->target : get_id(target_p, target_p),
- text);
-}
-