* changes to !uset autoinvite behavior: the autoinvite flag now works whether or not the channel it is set in is +i/+k.
* introduction of allchanmsg_func hooks: there is now a set of hooks (available via reg_allchanmsg_func()) in place to catch all public channel messages the services server sees.
git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-46
# arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
#
+2004-04-09 01:57:12 GMT adam <akl@gamesurge.net> patch-46
+
+ Summary:
+ changes to !uset autoinvite behavior, introduction of allchanmsg_func hooks
+ Revision:
+ srvx--devo--1.3--patch-46
+
+ * changes to !uset autoinvite behavior: the autoinvite flag now works whether or not the channel it is set in is +i/+k.
+
+ * introduction of allchanmsg_func hooks: there is now a set of hooks (available via reg_allchanmsg_func()) in place to catch all public channel messages the services server sees.
+
+
+ modified files:
+ ChangeLog src/chanserv.c src/chanserv.help src/proto-common.c
+ src/proto.h
+
+
2004-04-08 03:42:49 GMT Michael Poole <mdpoole@troilus.org> patch-45
Summary:
if(!IsUserSuspended(channel)
&& IsUserAutoInvite(channel)
&& (channel->access >= channel->channel->lvlOpts[lvlInviteMe])
- && (cn->modes & (MODE_KEY | MODE_INVITEONLY))
&& !self->burst)
irc_invite(chanserv, user, cn);
continue;
"$bOptions:$b",
"INFO: Sets the infoline that $C sends when you join the channel.",
"NOAUTOOP: Enable or disable $C automatically opping you upon joining or authenticating.",
- "AUTOINVITE: $C will invite you to +i/+k channels which you have access to and are not in when you authenticate if this setting is on.",
+ "AUTOINVITE: $C will invite you to this channel if you have access to and are not in when you authenticate if this setting is on.",
"NOTE: The NoAutoOp setting is equivalent to the !togop command in previous versions of srvx.",
"$uSee Also:$u set");
"USET INFO" ("/msg $C USET <#channel> INFO <info>",
struct userNode *service;
} chanmsg_funcs[256]; /* indexed by trigger character */
+static struct allchanmsg_func {
+ chanmsg_func_t func;
+ struct userNode *service;
+} allchanmsg_funcs[ALLCHANMSG_FUNCS_MAX];
+
struct privmsg_desc {
struct userNode *user;
char *text;
struct privmsg_desc *pd = data;
struct modeNode *mn;
struct chanmsg_func *cf = &chanmsg_funcs[(unsigned char)pd->text[0]];
+ int x;
/* Don't complain if it can't find the modeNode because the channel might
* be -n */
/* Never send a NOTICE to a channel to one of the services */
if (!pd->is_notice && cf->func && GetUserMode(cn, cf->service))
cf->func(pd->user, cn, pd->text+1, cf->service);
+
+ /* This catches *all* text sent to the channel that the services server sees */
+ for (x = 0; x < ALLCHANMSG_FUNCS_MAX; x++) {
+ cf = (struct chanmsg_func *)&allchanmsg_funcs[x];
+ if (!cf->func)
+ break; /* end of list */
+ else
+ cf->func(pd->user, cn, pd->text, cf->service);
+ }
}
static void
chanmsg_funcs[prefix].service = service;
}
+void
+reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler)
+{
+ int x;
+ for (x = 0; x < ALLCHANMSG_FUNCS_MAX; x++) {
+ if (allchanmsg_funcs[x].func)
+ continue;
+ allchanmsg_funcs[x].func = handler;
+ allchanmsg_funcs[x].service = service;
+ break;
+ }
+}
+
struct userNode *
get_chanmsg_bot(unsigned char prefix)
{
#define COMBO_NUMERIC_LEN 5 /* 1/2, 1/3 or 2/3 digits for server/client parts */
#define MAXLEN 512 /* Maximum IRC line length */
#define MAXNUMPARAMS 200
+#define ALLCHANMSG_FUNCS_MAX 4 /* +1 == 5 potential 'allchanmsg' funcs */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
/* Callback notifications for protocol support. */
typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, char *text, struct userNode *bot);
void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler);
+void reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler);
struct userNode *get_chanmsg_bot(unsigned char prefix);
typedef void (*privmsg_func_t) (struct userNode *user, struct userNode *target, char *text, int server_qualified);