1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 12:43:13 +02:00

- Implement proposed invite-notify CAP.

This commit is contained in:
William Pitcock
2013-05-20 18:22:35 +00:00
parent 1698007836
commit 93737c2f28
5 changed files with 48 additions and 2 deletions
+2
View File
@@ -269,6 +269,8 @@ extern void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *c
int prefix, char *pattern, ...) __attribute__((format(printf,5,6)));
extern void sendto_channel_butone(aClient *, aClient *, aChannel *,
char *, ...) __attribute__((format(printf,4,5)));
void sendto_channel_butone_with_capability(aClient *one, unsigned int cap,
aClient *from, aChannel *chptr, char *pattern, ...) __attribute__((format(printf,5,6)));
extern void sendto_channel_butserv_butone(aChannel *chptr, aClient *from, aClient *one,
char *pattern, ...) __attribute__((format(printf,4,5)));
extern void sendto_common_channels(aClient *, char *, ...) __attribute__((format(printf,2,3)));
+1 -1
View File
@@ -326,7 +326,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define PROTO_NICKv2 0x0008 /* Negotiated NICKv2 protocol */
#define PROTO_SJOIN2 0x0010 /* Negotiated SJOIN2 protocol */
#define PROTO_UMODE2 0x0020 /* Negotiated UMODE2 protocol */
//0x0080 unused (was ziplinks)
#define PROTO_INVITENOTIFY 0x0080 /* client supports invite-notify */
#define PROTO_VL 0x0100 /* Negotiated VL protocol */
#define PROTO_SJ3 0x0200 /* Negotiated SJ3 protocol */
#define PROTO_VHP 0x0400 /* Send hostnames in NICKv2 even if not sethosted */
+8
View File
@@ -107,3 +107,11 @@ loadmodule "modules/m_nopost";
loadmodule "modules/m_issecure";
loadmodule "modules/m_cap";
loadmodule "modules/m_sasl";
/*
* invite-notify capability (draft).
*
* This module implements support for clients which support the invite-notify
* capability draft.
*/
loadmodule "modules/cap_invitenotify";
+5 -1
View File
@@ -55,7 +55,7 @@ R_MODULES= \
m_mode.so m_watch.so m_part.so m_join.so m_motd.so m_opermotd.so \
m_botmotd.so m_lusers.so m_names.so m_svsnolag.so m_addmotd.so \
m_svslusers.so m_starttls.so m_nopost.so m_issecure.so m_cap.so \
m_sasl.so
m_sasl.so cap_invitenotify.so
#note change of .c to .o
COMMANDS=m_sethost.o m_chghost.o m_chgident.o m_setname.o m_setident.o \
@@ -514,6 +514,10 @@ m_sasl.so: m_sasl.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o m_sasl.so m_sasl.c
cap_invitenotify.so: cap_invitenotify.c $(INCLUDES)
$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
-o cap_invitenotify.so cap_invitenotify.c
#############################################################################
# and now the remaining modules...
#############################################################################
+32
View File
@@ -296,6 +296,38 @@ void sendto_channel_butone(aClient *one, aClient *from, aChannel *chptr,
}
}
void sendto_channel_butone_with_capability(aClient *one, unsigned int cap,
aClient *from, aChannel *chptr, char *pattern, ...)
{
va_list vl;
Member *lp;
aClient *acptr;
int i;
++current_serial;
for (lp = chptr->members; lp; lp = lp->next)
{
acptr = lp->cptr;
/* skip the one and deaf clients (unless sendanyways is set) */
if (acptr->from == one || (IsDeaf(acptr) && !(sendanyways == 1)))
continue;
if (!CHECKPROTO(acptr, cap))
continue;
if (MyConnect(acptr)) /* (It is always a client) */
vsendto_prefix_one(acptr, from, pattern, vl);
else if (acptr->from->serial != current_serial)
{
acptr->from->serial = current_serial;
/*
* Burst messages comes here..
*/
va_start(vl, pattern);
vsendto_prefix_one(acptr, from, pattern, vl);
va_end(vl);
}
}
}
void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
int prefix,
char *pattern, ...)