Send correct away status on client login

If some client now sets "us" away via /away, new clients will be sent a 306
numeric after login to inform them that they are set /away.

Thanks to nobswolf for the suggestion.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1655 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-11-07 14:54:45 +00:00
parent aea6c40a0e
commit ff4e09c594
3 changed files with 16 additions and 0 deletions
+8
View File
@@ -36,6 +36,7 @@ CUser::CUser(const CString& sUserName) {
m_bUseClientIP = false;
m_bDenyLoadMod = false;
m_bAdmin= false;
m_bIRCAway = false;
m_bDenySetVHost= false;
m_sStatusPrefix = "*";
m_sChanPrefixes = "";
@@ -147,6 +148,7 @@ void CUser::IRCDisconnected() {
}
SetIRCServer("");
m_bIRCAway = false;
// Get the reconnect going
CheckIRCConnect();
@@ -275,6 +277,12 @@ void CUser::UserConnected(CClient* pClient) {
}
}
if (m_bIRCAway) {
// If they want to know their away reason they'll have to whois
// themselves. At least we can tell them their away status...
pClient->PutClient(":irc.znc.in 306 " + GetIRCNick().GetNick() + " :You have been marked as being away");
}
const vector<CChan*>& vChans = GetChans();
for (unsigned int a = 0; a < vChans.size(); a++) {
if ((vChans[a]->IsOn()) && (!vChans[a]->IsDetached())) {