summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 16:17:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 16:17:03 +0000
commitf6b8a12a8066b60446570729f77084116853fe2e (patch)
tree982ff1e2795b3378cc8c7874202ed09a75ed97e1 /src/modules
parentb4d1587b44ca01ef90c64cb21e5ddc0783564491 (diff)
Convert to new api
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9144 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_namesx.cpp2
-rw-r--r--src/modules/m_uhnames.cpp30
2 files changed, 11 insertions, 21 deletions
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp
index 3ce1b00eb..d4e5def63 100644
--- a/src/modules/m_namesx.cpp
+++ b/src/modules/m_namesx.cpp
@@ -16,7 +16,7 @@
static const char* dummy = "ON";
-/* $ModDesc: Provides aliases of commands. */
+/* $ModDesc: Provides the NAMESX (CAP multi-prefix) capability. */
class ModuleNamesX : public Module
{
diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp
index dddf45591..b56ed5229 100644
--- a/src/modules/m_uhnames.cpp
+++ b/src/modules/m_uhnames.cpp
@@ -15,7 +15,7 @@
static const char* dummy = "ON";
-/* $ModDesc: Provides aliases of commands. */
+/* $ModDesc: Provides the UHNAMES facility. */
class ModuleUHNames : public Module
{
@@ -25,11 +25,10 @@ class ModuleUHNames : public Module
ModuleUHNames(InspIRCd* Me)
: Module(Me)
{
- Implementation eventlist[] = { I_OnSyncUserMetaData, I_OnPreCommand, I_OnUserList, I_On005Numeric };
+ Implementation eventlist[] = { I_OnSyncUserMetaData, I_OnPreCommand, I_OnNamesListItem, I_On005Numeric };
ServerInstance->Modules->Attach(eventlist, this, 4);
}
-
virtual ~ModuleUHNames()
{
}
@@ -50,12 +49,6 @@ class ModuleUHNames : public Module
output.append(" UHNAMES");
}
- void Prioritize()
- {
- Module* namesx = ServerInstance->Modules->Find("m_namesx.so");
- ServerInstance->Modules->SetPriority(this, I_OnUserList, PRIO_BEFORE, &namesx);
- }
-
virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
{
irc::string c = command.c_str();
@@ -75,19 +68,16 @@ class ModuleUHNames : public Module
return 0;
}
- /* IMPORTANT: This must be prioritized above NAMESX! */
- virtual int OnUserList(User* user, Channel* Ptr, CUList* &ulist)
+ virtual void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick)
{
- if (user->GetExt("UHNAMES"))
- {
- if (!ulist)
- ulist = Ptr->GetUsers();
+ if (!issuer->GetExt("UHNAMES"))
+ return;
- for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++)
- i->second = i->first->GetFullHost();
- }
- return 0;
- }
+ if (nick.empty())
+ return;
+
+ nick = user->GetFullHost();
+ }
};
MODULE_INIT(ModuleUHNames)