From 38ca8be9a3881a3cb3cf6864e67b779ffbab6874 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 15 Mar 2007 17:37:25 +0000 Subject: Add third parameter to OnUserQuit (quit reason for opers only) - bump api version Add SetOperQuit and GetOperQuit methods to userrec Add OPERQUIT command to protocol - bump protocol version All this is to properly allow hidebans etc to work properly git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6675 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 9f54975b4..48260bd1f 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -331,13 +331,15 @@ userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance) memset(modes,0,sizeof(modes)); memset(snomasks,0,sizeof(snomasks)); /* Invalidate cache */ - cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL; + operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL; } userrec::~userrec() { this->InvalidateCache(); this->DecrementModes(); + if (operquit) + free(operquit); if (ip) { clonemap::iterator x = ServerInstance->local_clones.find(this->GetIPString()); @@ -1914,3 +1916,17 @@ void userrec::HandleEvent(EventType et, int errornum) } } +void userrec::SetOperQuit(const std::string &oquit) +{ + if (operquit) + return; + + operquit = strdup(oquit.c_str()); +} + +const char* userrec::GetOperQuit() +{ + return operquit ? operquit : ""; +} + + -- cgit v1.2.3