From 76b6988e4f565fd26fffc2194b0b6a00fec3dc2f Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 17 Sep 2005 04:05:55 +0000 Subject: [PATCH] Added AttachUser() git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@499 726aef4b-f618-498e-8847-2d620e286838 --- Chan.cpp | 13 +++++++++++-- Chan.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Chan.cpp b/Chan.cpp index c603d795..8e94bb58 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -125,8 +125,17 @@ void CChan::SendBuffer() { } void CChan::DetachUser() { - m_pUser->PutUser(":" + m_pUser->GetIRCNick().GetNickMask() + " PART " + GetName()); - m_bDetached = true; + if (!m_bDetached) { + m_pUser->PutUser(":" + m_pUser->GetIRCNick().GetNickMask() + " PART " + GetName()); + m_bDetached = true; + } +} + +void CChan::AttachUser() { + if (m_bDetached) { + m_pUser->PutUser(":" + m_pUser->GetIRCNick().GetNickMask() + " JOIN " + GetName()); + m_bDetached = false; + } } CString CChan::GetModeString() const { diff --git a/Chan.h b/Chan.h index 18559d45..bbd48306 100644 --- a/Chan.h +++ b/Chan.h @@ -50,6 +50,7 @@ public: void Cycle() const; void JoinUser(bool bForce = false, const CString& sKey = ""); void DetachUser(); + void AttachUser(); void SendBuffer(); void IncClientRequests();