# Add upstream patch 03-attach-channels-on-joining.diff, which ensures, that
# channels are always attached on joining them.

diff -Naur znc-0.092.orig//Chan.cpp znc-0.092/Chan.cpp
--- znc-0.092.orig//Chan.cpp	2010-03-29 21:04:37.000000000 +0200
+++ znc-0.092/Chan.cpp	2010-08-16 20:11:37.000000000 +0200
@@ -98,6 +98,7 @@
 void CChan::JoinUser(bool bForce, const CString& sKey, CClient* pClient) {
 	if (!bForce && (!IsOn() || !IsDetached())) {
 		m_pUser->PutIRC("JOIN " + GetName() + " " + ((sKey.empty()) ? GetKey() : sKey));
+		SetDetached(false);
 		return;
 	}
 
