From b156f4066d883586edd1082cb5d0163b58239a9e Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 15 Oct 2005 03:19:40 +0000 Subject: [PATCH] Added +o/v -o/v for when users attach/detach git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@580 726aef4b-f618-498e-8847-2d620e286838 --- modules/partyline.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index ad206431..bdab6ff1 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -61,11 +61,21 @@ public: if (ssNicks.find(m_pUser->GetUserName()) != ssNicks.end()) { m_pUserSock->PutServ(":" + m_pUser->GetIRCNick().GetNickMask() + " JOIN " + it->first); SendNickList(ssNicks, it->first); + PutChan(ssNicks, ":*" + GetModName() + "!znc@rottenboy.com MODE " + it->first + " +" + CString(m_pUser->IsAdmin() ? "o" : "v") + " ?" + m_pUser->GetUserName(), true); } } } virtual void OnUserDetached() { + if (!m_pUser->IsUserAttached()) { + for (map >::iterator it = m_msChans.begin(); it != m_msChans.end(); it++) { + set& ssNicks = it->second; + + if (ssNicks.find(m_pUser->GetUserName()) != ssNicks.end()) { + PutChan(ssNicks, ":*" + GetModName() + "!znc@rottenboy.com MODE " + it->first + " -ov ?" + m_pUser->GetUserName() + " ?" + m_pUser->GetUserName(), true); + } + } + } } virtual EModRet OnUserRaw(CString& sLine) { @@ -138,7 +148,7 @@ public: SendNickList(ssNicks, sChannel); if (m_pUser->IsAdmin()) { - PutChan(ssNicks, ":*status!znc@rottenboy.com MODE " + sChannel + " +o ?" + sNick, false); + PutChan(ssNicks, ":*" + GetModName() + "!znc@rottenboy.com MODE " + sChannel + " +o ?" + sNick, false); } } @@ -260,10 +270,10 @@ public: void SendNickList(set& ssNicks, const CString& sChan) { CString sNickList; for (set::iterator it = ssNicks.begin(); it != ssNicks.end(); it++) { - CUser* pChan = CZNC::Get().FindUser(*it); + CUser* pUser = CZNC::Get().FindUser(*it); - if (pChan && pChan->IsAdmin()) { - sNickList += "@"; + if (pUser && pUser->IsUserAttached()) { + sNickList += (pUser->IsAdmin()) ? "@" : "+"; } sNickList += "?" + (*it) + " ";