Add $ishalfop(<nick> <channel>) scripting function, as per EPIC.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@34 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2008-05-07 08:48:49 +00:00
parent 998453de9f
commit 285b02c36a
6 changed files with 54 additions and 6 deletions

View File

@@ -169,6 +169,7 @@ static char *function_encode (char *, unsigned char *);
static char *function_index (char *, char *);
static char *function_ischannel (char *, char *);
static char *function_ischanop (char *, char *);
static char *function_ishalfop (char *, char *);
static char *function_left (char *, char *);
static char *function_listen (char *, char *);
static char *function_match (char *, char *);
@@ -580,6 +581,7 @@ static BuiltInFunctions built_in_functions[] =
{ "ISCURCHAN", function_iscurchan },
{ "ISDIGIT", function_isdigit },
{ "ISDISPLAYING", function_isdisplaying },
{ "ISHALFOP", function_ishalfop },
{ "ISIGNORED", function_isignored },
{ "ISNUMBER", function_isnumber },
{ "ISOP", function_isop },
@@ -1747,6 +1749,22 @@ BUILT_IN_FUNCTION(function_ischanop, input)
RETURN_INT(is_chanop(input, nick));
}
/*
* Usage: $ishalfop(nick channel)
* Returns: 1 if <nick> is a channel half-op on <channel>
* 0 if <nick> is not a channel half-op on <channel>
* * O R *
* if you are not on <channel>
*
*/
BUILT_IN_FUNCTION(function_ishalfop, input)
{
char *nick;
GET_STR_ARG(nick, input);
RETURN_INT(is_halfop(input, nick));
}
/*
* Usage: $word(jUmber text)