All pastes #249215 Raw Edit

InspIRCd patch

public text v1 · immutable
#249215 ·published 2006-11-15 15:31 UTC
rendered paste body
Index: m_whoismodes.cpp
===================================================================
--- m_whoismodes.cpp	(revision 55)
+++ m_whoismodes.cpp	(working copy)
@@ -1,13 +1,14 @@
 // m_whoismodes.cpp - ViaraiX
 // Updated for new API - LeaChim
 // Updated for even newer API - Om
+// Updated for 1.1-beta5 - AnMaster
 
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
 #include "inspircd.h"
 
-/* $ModDesc: Allows opers to see users modes on whois and adds "is registered and identifed" for +r nicks */
+/* $ModDesc: Allows opers to see users modes on whois */
 class ModuleWhoismodes : public Module
 {
 public:
@@ -28,15 +29,16 @@
 
 	virtual void OnWhois(userrec* source, userrec* dest)
 	{
-		if(strchr(source->modes,'o'))
-		{
-			source->WriteServ("379 %s :%s usermodes [+%s]",source->nick,dest->nick,dest->modes);
+		if(*source->oper) {
+			if (dest->modes[UM_SNOMASK] != 0) {
+				ServerInstance->SendWhoisLine(source, dest, 379, "%s %s :usermodes [+%s +%s]",
+				                              source->nick, dest->nick, dest->FormatModes(),
+				                              dest->FormatNoticeMasks());
+			} else {
+				ServerInstance->SendWhoisLine(source, dest, 379, "%s %s :usermodes [+%s]",
+				                              source->nick, dest->nick, dest->FormatModes());
+			}
 		}
-
-		if(strchr(dest->modes,'r'))
-		{
-			source->WriteServ("307 %s :%s is registered and identified",source->nick,dest->nick);
-		}
 	}
 };