Add an s2s cap for ECHO (#141)
This commit is contained in:
parent
e6e26343c3
commit
4cac091255
1 changed files with 11 additions and 1 deletions
|
@ -56,6 +56,8 @@ static void echo_msg(struct Client *, struct Client *, enum message_type, const
|
||||||
static void expire_tgchange(void *unused);
|
static void expire_tgchange(void *unused);
|
||||||
static struct ev_entry *expire_tgchange_event;
|
static struct ev_entry *expire_tgchange_event;
|
||||||
|
|
||||||
|
static unsigned int CAP_ECHO;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
modinit(void)
|
modinit(void)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +87,12 @@ struct Message echo_msgtab = {
|
||||||
|
|
||||||
mapi_clist_av1 message_clist[] = { &privmsg_msgtab, ¬ice_msgtab, &echo_msgtab, NULL };
|
mapi_clist_av1 message_clist[] = { &privmsg_msgtab, ¬ice_msgtab, &echo_msgtab, NULL };
|
||||||
|
|
||||||
DECLARE_MODULE_AV2(message, modinit, moddeinit, message_clist, NULL, NULL, NULL, NULL, message_desc);
|
mapi_cap_list_av2 message_cap_list[] = {
|
||||||
|
{ MAPI_CAP_SERVER, "ECHO", NULL, &CAP_ECHO },
|
||||||
|
{ 0, NULL, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
DECLARE_MODULE_AV2(message, modinit, moddeinit, message_clist, NULL, NULL, message_cap_list, NULL, message_desc);
|
||||||
|
|
||||||
struct entity
|
struct entity
|
||||||
{
|
{
|
||||||
|
@ -742,6 +749,9 @@ echo_msg(struct Client *source_p, struct Client *target_p,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(target_p->from->serv->caps & CAP_ECHO))
|
||||||
|
return;
|
||||||
|
|
||||||
sendto_one(target_p, ":%s ECHO %c %s :%s",
|
sendto_one(target_p, ":%s ECHO %c %s :%s",
|
||||||
use_id(source_p),
|
use_id(source_p),
|
||||||
msgtype == MESSAGE_TYPE_PRIVMSG ? 'P' : 'N',
|
msgtype == MESSAGE_TYPE_PRIVMSG ? 'P' : 'N',
|
||||||
|
|
Loading…
Reference in a new issue