Permalink
Browse files

chanserv/flags: wrap anope 1.9 FLAGS syntax fully

(except for FLAGS CLEAR... what can I say, i'm lazy.)
  • Loading branch information...
kaniini committed Aug 31, 2011
1 parent 1a2f469 commit 5c734f28068cf47b9b450af4dcf37195734b15be
Showing with 50 additions and 3 deletions.
  1. +50 −3 modules/chanserv/flags.c
View
@@ -148,6 +148,7 @@ static void cs_cmd_flags(sourceinfo_t *si, int parc, char *parv[])
bool operoverride = false;
char *channel = parv[0];
char *target = sstrdup(parv[1]);
char *flagstr = parv[2];
const char *str1, *str2;
unsigned int addflags, removeflags, restrictflags;
mychan_t *mc;
@@ -172,14 +173,60 @@ static void cs_cmd_flags(sourceinfo_t *si, int parc, char *parv[])
return;
}
if (!target || (!strcasecmp(target, "LIST") && myentity_find_ext(target) == NULL))
if (!target)
{
do_list(si, mc);
return;
}
else
/*
* following conditions are for compatibility with Anope just to avoid a whole clusterfuck
* of confused users caused by their 'innovation.' yeah, that's a word for it alright.
*
* anope 1.9's shiny new FLAGS command has:
*
* FLAGS #channel LIST
* FLAGS #channel MODIFY user flagspec
* FLAGS #channel CLEAR
* (XXX: CLEAR is not supported yet. honestly not sure if it's worth it. we'll see.)
*
* obviously they do not support the atheme syntax, because lets face it, they like to
* 'innovate.' this is, of course, hilarious for obvious reasons. never mind that we
* *invented* the FLAGS system for channel ACLs, so you would think they would find it
* worthwhile to be compatible here. i guess that would have been too obvious or something
* about their whole 'stealing our design' thing that they have been doing in 1.9 since the
* beginning... or do i mean 'innovating?'
*
* anyway we rewrite the commands as appropriate in the two if blocks below so that they
* are processed by the flags code as the user would intend. obviously, we're not really
* capable of handling the anope flag model (which makes honestly zero sense to me, and is
* extremely complex which kind of misses the entire point of the flags UI design...) so if
* some user tries passing anope flags, it will probably be hilarious. the good news is
* most of the anope flags tie up to atheme flags in some weird way anyway (probably because,
* i don't know, they copied the entire design and then fucked it up? yeah. probably that.)
*
* --nenolod
*/
else if (!strcasecmp(target, "LIST") && myentity_find_ext(target) == NULL)
{
do_list(si, mc);
free(target);
return;
}
else if (!strcasecmp(target, "MODIFY") && myentity_find_ext(target) == NULL)
{
free(target);
flagstr = strchr(parv[2], ' ');
if (flagstr)
*flagstr++ = '\0';
target = strdup(parv[2]);
}
{
myentity_t *mt;
char *flagstr = parv[2];
if (!si->smu)
{

0 comments on commit 5c734f2

Please sign in to comment.