add usermode for webchat users

Closes #54
This commit is contained in:
Sam Dodrill 2015-03-08 11:38:36 -07:00 committed by Christine Dodrill
parent ad62a8365f
commit 79bd2087c4
8 changed files with 20 additions and 7 deletions

View File

@ -130,6 +130,9 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, const char
}
}
/* Set UMODE_WEBCLIENT */
source_p->umodes = source_p->umodes | UMODE_WEBCLIENT;
sendto_one(source_p, "NOTICE * :CGI:IRC host/IP set to %s %s", parv[3], parv[4]);
return 0;
}

View File

@ -28,3 +28,4 @@ User modes: (* designates that the umode is oper only)
+I - Prevents non-opers from seeing your channel list in
a whois query.
+Z - Is connected via SSL (set only on connection).
+W - Is connected via a web client (set only on connection).

View File

@ -22,3 +22,4 @@ User modes: (? designates that the umode is provided by an extension
anyone who's in a common channel with you to message you.
+V - Prevents you from receiving invites.
+Z - Is connected via SSL (set only on connection).
+W - Is connected via a web client (set only on connection).

View File

@ -425,6 +425,7 @@ struct ListClient {
#define UMODE_OPER 0x1000 /* Operator */
#define UMODE_ADMIN 0x2000 /* Admin on server */
#define UMODE_SSLCLIENT 0x4000 /* using SSL */
#define UMODE_WEBCLIENT 0x100000 /* user is connected via a web client */
#define UMODE_OVERRIDE 0x20000 /* able to override */
#define IsOverride(x) ((x)->umodes & UMODE_OVERRIDE)

View File

@ -330,6 +330,7 @@ extern const char *form_str(int);
#define ERR_HELPNOTFOUND 524
#define RPL_WHOISSECURE 671 /* Unreal3.2 --nenolod */
#define RPL_WHOISWEBIRC 672 /* plexus -- Xe */
#define RPL_MODLIST 702
#define RPL_ENDOFMODLIST 703

View File

@ -313,6 +313,11 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
if(IsSSLClient(target_p))
sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
target_p->name);
if(!(target_p->umodes & UMODE_WEBCLIENT)) {
sendto_one_numeric(source_p, RPL_WHOISWEBIRC, form_str(RPL_WHOISWEBIRC));
}
if((source_p == target_p || IsOper(source_p)) &&
target_p->certfp != NULL)
sendto_one_numeric(source_p, RPL_WHOISCERTFP,

View File

@ -693,7 +693,7 @@ static const char * replies[] = {
/* 669 */ NULL,
/* 670 */ NULL,
/* 671 RPL_WHOISSECURE, */ "%s :is using a secure connection",
/* 672 */ NULL,
/* 672 RPL_WHOISWEBIRC, */ "%s :is using a web IRC client",
/* 673 */ NULL,
/* 674 */ NULL,
/* 675 */ NULL,

View File

@ -88,7 +88,7 @@ int user_modes[256] = {
0, /* T */
0, /* U */
UMODE_NOINVITE, /* V */
0, /* W */
UMODE_WEBCLIENT, /* W */
0, /* X */
0, /* Y */
UMODE_SSLCLIENT, /* Z */
@ -1011,13 +1011,14 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
}
break;
/* we may not get these,
* but they shouldnt be in default
*/
/* we may not get these,
* but they shouldnt be in default
*/
/* can only be set on burst */
/* can only be set on burst */
case 'S':
case 'Z':
case 'W':
case ' ':
case '\n':
case '\r':
@ -1046,7 +1047,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
source_p->umodes &= ~UMODE_SERVNOTICE;
break;
}
/* FALLTHROUGH */
/* FALLTHROUGH */
default:
if (MyConnect(source_p) && *pm == 'Q' && !ConfigChannel.use_forward) {
badflag = YES;