summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-10-27 18:59:49 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-10-27 18:59:49 +0000
commit1f1769a3332d003f47460478d1d6061d4802fa64 (patch)
tree53b0909005888d7f0a62f61f311955716ff05d31
parente671d82d066063c5c7b02169b5617c58361bf42c (diff)
- Added usermode +W. Users connected via a webirc gateway get this
mode set by servers. - /WHOIS now shows whether a client is connected via a webirc gateway git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2512 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r--doc/modes.txt1
-rw-r--r--help/umode1
-rw-r--r--include/client.h4
-rw-r--r--include/numeric.h1
-rw-r--r--modules/m_svsmode.c1
-rw-r--r--modules/m_webirc.c1
-rw-r--r--modules/m_whois.c5
-rw-r--r--src/numeric.c2
-rw-r--r--src/s_user.c3
9 files changed, 16 insertions, 3 deletions
diff --git a/doc/modes.txt b/doc/modes.txt
index ca6c4fd..90f20ac 100644
--- a/doc/modes.txt
+++ b/doc/modes.txt
@@ -36,6 +36,7 @@ User Modes:
+S - ssl - Client is connected via SSL/TLS
+u - unauth - See unauthorized client notices
+w - wallop - See server generated WALLOPS
++W - webirc - User is connected using a webirc gateway
+x - hiddenhost - User's host has been spoofed by services.
This mode can be set by servers and services only.
+y - spy - See LINKS, STATS (if configured), TRACE notices
diff --git a/help/umode b/help/umode
index f6ce160..245c231 100644
--- a/help/umode
+++ b/help/umode
@@ -8,6 +8,7 @@ Usermodes: (* designates that the umode is oper only)
Use the /oper command to attain this.
+i - Designates this client 'invisible'.
* +w - Can see server wallops.
+ +W - User is connected using a webirc gateway.
* +z - Can see oper wallops.
* +l - Can see oper locops (local wallops).
* +c - Can see client connections and exits.
diff --git a/include/client.h b/include/client.h
index 436f6d3..a80cb43 100644
--- a/include/client.h
+++ b/include/client.h
@@ -163,6 +163,7 @@
#define UMODE_FARCONNECT 0x00800000 /**< Can see remote client connects/exits */
#define UMODE_HIDDENHOST 0x01000000 /**< User's host is hidden */
#define UMODE_SSL 0x02000000 /**< User is connected via TLS/SSL */
+#define UMODE_WEBIRC 0x04000000 /**< User connected via a webirc gateway */
#define UMODE_ALL UMODE_SERVNOTICE
@@ -173,7 +174,8 @@
#define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP |\
UMODE_REGONLY | UMODE_REGISTERED | UMODE_ADMIN |\
- UMODE_HIDDEN | UMODE_HIDDENHOST | UMODE_SSL)
+ UMODE_HIDDEN | UMODE_HIDDENHOST | UMODE_SSL |\
+ UMODE_WEBIRC)
diff --git a/include/numeric.h b/include/numeric.h
index 2a9efad..abdcd5e 100644
--- a/include/numeric.h
+++ b/include/numeric.h
@@ -138,6 +138,7 @@ extern const char *form_str(unsigned int);
#define RPL_NOTOPIC 331
#define RPL_TOPIC 332
#define RPL_TOPICWHOTIME 333
+#define RPL_WHOISTEXT 337
#define RPL_WHOISACTUALLY 338
#define RPL_INVITING 341
#define RPL_INVITELIST 346
diff --git a/modules/m_svsmode.c b/modules/m_svsmode.c
index 851629e..4db45d1 100644
--- a/modules/m_svsmode.c
+++ b/modules/m_svsmode.c
@@ -145,6 +145,7 @@ ms_svsmode(struct Client *client_p, struct Client *source_p,
break;
case 'S': /* Only servers may set +S in a burst */
+ case 'W': /* Only servers may set +W in a burst */
break;
default:
diff --git a/modules/m_webirc.c b/modules/m_webirc.c
index 2aa710a..1fbe4c6 100644
--- a/modules/m_webirc.c
+++ b/modules/m_webirc.c
@@ -149,6 +149,7 @@ mr_webirc(struct Client *client_p, struct Client *source_p, int parc, char *parv
}
}
+ AddUMode(source_p, UMODE_WEBIRC);
sendto_one(source_p, ":%s NOTICE %s :CGI:IRC host/IP set to %s %s", me.name,
source_p->name[0] ? source_p->name : "*", parv[3], parv[4]);
}
diff --git a/modules/m_whois.c b/modules/m_whois.c
index 74149a5..e01901b 100644
--- a/modules/m_whois.c
+++ b/modules/m_whois.c
@@ -129,6 +129,11 @@ whois_person(struct Client *source_p, struct Client *target_p)
RPL_WHOISOPERATOR),
me.name, source_p->name, target_p->name);
+ if (HasUMode(target_p, UMODE_WEBIRC))
+ sendto_one(source_p, form_str(RPL_WHOISTEXT),
+ me.name, source_p->name, target_p->name,
+ "User connected using a webirc gateway");
+
if (target_p->sockhost[0] && strcmp(target_p->sockhost, "0"))
{
if (HasUMode(source_p, UMODE_ADMIN) || source_p == target_p)
diff --git a/src/numeric.c b/src/numeric.c
index 71ca857..78a6420 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -364,7 +364,7 @@ static const char *const replies[] = {
/* 334 */ NULL,
/* 335 */ NULL,
/* 336 */ NULL,
-/* 337 */ NULL,
+/* 338 RPL_WHOISTEXT */ ":%s 337 %s %s :%s",
/* 338 RPL_WHOISACTUALLY */ ":%s 338 %s %s %s :actually using host",
/* 339 */ NULL,
/* 340 */ NULL,
diff --git a/src/s_user.c b/src/s_user.c
index f7d6bd4..30d54f9 100644
--- a/src/s_user.c
+++ b/src/s_user.c
@@ -105,7 +105,7 @@ const unsigned int user_modes[256] =
0, /* T */
0, /* U */
0, /* V */
- 0, /* W */
+ UMODE_WEBIRC, /* W */
0, /* X */
0, /* Y */
0, /* Z 0x5A */
@@ -894,6 +894,7 @@ set_user_mode(struct Client *client_p, struct Client *source_p,
break;
case 'S': /* Only servers may set +S in a burst */
+ case 'W': /* Only servers may set +W in a burst */
case 'r': /* Only services may set +r */
case 'x': /* Only services may set +x */
break;