diff -r 1f34825404a1 include/h.h
--- a/include/h.h	Sun Mar 25 12:32:41 2012 +0200
+++ b/include/h.h	Sun Mar 25 12:39:49 2012 -0500
@@ -308,6 +308,7 @@
 extern void sendto_serv_butone_sjoin(aClient *, char *, ...) __attribute__((format(printf,2,3)));
 extern void sendto_serv_sjoin(aClient *, char *, ...) __attribute__((format(printf,2,3)));
 extern void sendto_common_channels(aClient *, char *, ...) __attribute__((format(printf,2,3)));
+extern void sendto_common_channels_local_butone(aClient *, int, char *, ...) __attribute__((format(printf,3,4)));
 extern void sendto_channel_butserv(aChannel *, aClient *, char *, ...) __attribute__((format(printf,3,4)));
 extern void sendto_match_servs(aChannel *, aClient *, char *, ...) __attribute__((format(printf,3,4)));
 extern void sendto_match_butone(aClient *, aClient *, char *, int,
diff -r 1f34825404a1 include/struct.h
--- a/include/struct.h	Sun Mar 25 12:32:41 2012 +0200
+++ b/include/struct.h	Sun Mar 25 12:39:49 2012 -0500
@@ -370,6 +370,7 @@
 #define PROTO_CLICAP	0x20000  /* client capability negotiation in process */
 #define PROTO_STARTTLS	0x40000	 /* client supports STARTTLS */
 #define PROTO_SASL	0x80000  /* client is doing SASL */
+#define PROTO_AWAY_NOTIFY	0x100000	/* client supports away-notify */
 
 /*
  * flags macros.
diff -r 1f34825404a1 src/modules/m_away.c
--- a/src/modules/m_away.c	Sun Mar 25 12:32:41 2012 +0200
+++ b/src/modules/m_away.c	Sun Mar 25 12:39:49 2012 -0500
@@ -116,6 +116,9 @@
 			/* Only send this if they were actually away -- codemastr */
 	                sendto_serv_butone_token(cptr, parv[0], MSG_AWAY, TOK_AWAY, "");
 	                hash_check_watch(cptr, RPL_NOTAWAY);
+
+			sendto_common_channels_local_butone(sptr, PROTO_AWAY_NOTIFY, ":%s!%s@%s AWAY",
+							    sptr->name, sptr->user->username, GetHost(sptr));
                 }
                 /* hope this works XX */
                 if (MyConnect(sptr))
@@ -168,6 +171,9 @@
                 sendto_one(sptr, rpl_str(RPL_NOWAWAY), me.name, parv[0]);
 
 	hash_check_watch(cptr, wasaway ? RPL_REAWAY : RPL_GONEAWAY);
+	sendto_common_channels_local_butone(sptr, PROTO_AWAY_NOTIFY, ":%s!%s@%s AWAY :%s",
+					    sptr->name, sptr->user->username, GetHost(sptr), away);
+
 	
         return 0;
 }
diff -r 1f34825404a1 src/modules/m_cap.c
--- a/src/modules/m_cap.c	Sun Mar 25 12:32:41 2012 +0200
+++ b/src/modules/m_cap.c	Sun Mar 25 12:39:49 2012 -0500
@@ -72,6 +72,7 @@
 #define CLICAP_FLAGS_CLIACK		0x2
 
 static struct clicap clicap_table[] = {
+	{"away-notify", PROTO_AWAY_NOTIFY, CLICAP_FLAGS_NONE},
 	{"multi-prefix", PROTO_NAMESX, CLICAP_FLAGS_NONE},
 	{"sasl", PROTO_SASL, CLICAP_FLAGS_NONE},
 #ifdef USE_SSL
diff -r 1f34825404a1 src/send.c
--- a/src/send.c	Sun Mar 25 12:32:41 2012 +0200
+++ b/src/send.c	Sun Mar 25 12:39:49 2012 -0500
@@ -1173,6 +1173,51 @@
 
 	return;
 }
+
+/*
+ * sendto_common_channels_local_butone()
+ *
+ * Sends a message to all people on local server who are
+ * in same channel with user and have the specified capability.
+ */
+void sendto_common_channels_local_butone(aClient *user, int cap, char *pattern, ...)
+{
+	va_list vl;
+
+	Membership *channels;
+	Member *users;
+	aClient *cptr;
+	int sendlen;
+
+	/* We now create the buffer _before_ we send it to the clients. -- Syzop */
+	*sendbuf = '\0';
+	va_start(vl, pattern);
+	sendlen = vmakebuf_local_withprefix(sendbuf, user, pattern, vl);
+	va_end(vl);
+
+	++sentalong_marker;
+	if (user->fd >= 0)
+		sentalong[user->slot] = sentalong_marker;
+	if (user->user)
+	{
+		for (channels = user->user->channel; channels; channels = channels->next)
+			for (users = channels->chptr->members; users; users = users->next)
+			{
+				cptr = users->cptr;
+				if (!MyConnect(cptr) || (cptr->slot < 0) || (sentalong[cptr->slot] == sentalong_marker) ||
+				    !CHECKPROTO(cptr, cap))
+					continue;
+				if ((channels->chptr->mode.mode & MODE_AUDITORIUM) &&
+				    !(is_chanownprotop(user, channels->chptr) || is_chanownprotop(cptr, channels->chptr)))
+					continue;
+				sentalong[cptr->slot] = sentalong_marker;
+				sendbufto_one(cptr, sendbuf, sendlen);
+			}
+	}
+
+	return;
+}
+
 /*
  * sendto_channel_butserv
  *
