Created
September 9, 2011 14:02
-
-
Save amyreese/1206300 to your computer and use it in GitHub Desktop.
Query Buffering Patch for ZNC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch make ZNC query buffering behave the way I like, as I use | |
multiple clients and still want the query buffer to be filled and replayed | |
for the newly connecting client. | |
diff -rup znc-0.074/IRCSock.cpp znc/IRCSock.cpp | |
--- znc-0.074/IRCSock.cpp 2009-06-29 13:26:19 +0200 | |
+++ znc/IRCSock.cpp 2009-08-26 11:30:56 +0200 | |
@@ -724,21 +724,14 @@ bool CIRCSock::OnGeneralCTCP(CNick& Nick | |
bool CIRCSock::OnPrivNotice(CNick& Nick, CString& sMessage) { | |
MODULECALL(OnPrivNotice(Nick, sMessage), m_pUser, NULL, return true); | |
- if (!m_pUser->IsUserAttached()) { | |
- // If the user is detached, add to the buffer | |
- m_pUser->AddQueryBuffer(":" + Nick.GetNickMask() + " NOTICE ", " :" + m_pUser->AddTimestamp(sMessage)); | |
- } | |
+ m_pUser->AddQueryBuffer(":" + Nick.GetNickMask() + " NOTICE ", " :" + m_pUser->AddTimestamp(sMessage)); | |
return false; | |
} | |
bool CIRCSock::OnPrivMsg(CNick& Nick, CString& sMessage) { | |
MODULECALL(OnPrivMsg(Nick, sMessage), m_pUser, NULL, return true); | |
- | |
- if (!m_pUser->IsUserAttached()) { | |
- // If the user is detached, add to the buffer | |
- m_pUser->AddQueryBuffer(":" + Nick.GetNickMask() + " PRIVMSG ", " :" + m_pUser->AddTimestamp(sMessage)); | |
- } | |
+ m_pUser->AddQueryBuffer(":" + Nick.GetNickMask() + " PRIVMSG ", " :" + m_pUser->AddTimestamp(sMessage)); | |
return false; | |
} | |
diff -rup znc-0.074/User.cpp znc/User.cpp | |
--- znc-0.074/User.cpp 2009-07-22 18:54:52 +0200 | |
+++ znc/User.cpp 2009-08-26 11:30:56 +0200 | |
@@ -290,6 +290,7 @@ void CUser::UserConnected(CClient* pClie | |
MODULECALL(OnPrivBufferPlayLine(*pClient, sBufLine), this, NULL, continue); | |
pClient->PutClient(sBufLine); | |
} | |
+ m_QueryBuffer.Clear(); | |
// Tell them why they won't connect | |
if (!GetIRCConnectEnabled()) |
Can you recreate the features of the original patch? Always everything in the query buffer? No stars?
With the latest patch, I am additionally having a weird behavior. On reconnect of the last clients, I get many emtpy messages in the query. On my iPad client, when I conenct to the server, the client crashes immediately and I have to restart it. Then I get no querybuffer.
I've updated the original patch for 1.2 and improved upon it. See znc/znc#521
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jonypoin's patch updated to compile against 1.0: https://gist.github.com/4710462