Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'detached-fix'

  • Loading branch information...
commit 369f93cbbea05282e03ade4d578c65204d9c86b5 2 parents 65a51ea + ebf9aeb
@DarthGandalf DarthGandalf authored
Showing with 32 additions and 4 deletions.
  1. +32 −4 src/IRCSock.cpp
View
36 src/IRCSock.cpp
@@ -242,6 +242,9 @@ void CIRCSock::ReadLine(const CString& sData) {
// reply isn't forwarded.
return;
}
+ if (pChan->IsDetached()) {
+ return;
+ }
}
}
break;
@@ -260,6 +263,9 @@ void CIRCSock::ReadLine(const CString& sData) {
// reply isn't forwarded.
return;
}
+ if (pChan->IsDetached()) {
+ return;
+ }
}
}
break;
@@ -269,6 +275,9 @@ void CIRCSock::ReadLine(const CString& sData) {
if (pChan) {
pChan->SetTopic("");
+ if (pChan->IsDetached()) {
+ return;
+ }
}
break;
@@ -281,6 +290,9 @@ void CIRCSock::ReadLine(const CString& sData) {
CString sTopic = sLine.Token(4, true);
sTopic.LeftChomp();
pChan->SetTopic(sTopic);
+ if (pChan->IsDetached()) {
+ return;
+ }
}
break;
@@ -295,6 +307,10 @@ void CIRCSock::ReadLine(const CString& sData) {
pChan->SetTopicOwner(sNick);
pChan->SetTopicDate(ulDate);
+
+ if (pChan->IsDetached()) {
+ return;
+ }
}
break;
@@ -303,6 +319,7 @@ void CIRCSock::ReadLine(const CString& sData) {
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
sServer = sLine.Token(0);
sNick = sLine.Token(7);
+ CString sChan = sLine.Token(3);
CString sIdent = sLine.Token(4);
CString sHost = sLine.Token(5);
@@ -342,7 +359,7 @@ void CIRCSock::ReadLine(const CString& sData) {
sNewNick = sNick[0] + sNick.substr(pos);
}
CString sNewLine = sServer + " 352 " + sLine.Token(2) + " " +
- sLine.Token(3) + " " + sIdent + " " + sHost + " " +
+ sChan + " " + sIdent + " " + sHost + " " +
sLine.Token(6) + " " + sNewNick + " " +
sLine.Token(8, true);
m_pNetwork->PutUser(sNewLine, pClient);
@@ -352,6 +369,11 @@ void CIRCSock::ReadLine(const CString& sData) {
return;
}
+ CChan* pChan = m_pNetwork->FindChan(sChan);
+ if (pChan && pChan->IsDetached()) {
+ return;
+ }
+
break;
}
case 353: { // NAMES
@@ -363,6 +385,9 @@ void CIRCSock::ReadLine(const CString& sData) {
if (pChan) {
CString sNicks = sRest.Token(2, true).TrimPrefix_n();
pChan->AddNicks(sNicks);
+ if (pChan->IsDetached()) {
+ return;
+ }
}
ForwardRaw353(sLine);
@@ -371,8 +396,6 @@ void CIRCSock::ReadLine(const CString& sData) {
return;
}
case 366: { // end of names list
- m_pNetwork->PutUser(sLine); // First send them the raw
-
// :irc.server.com 366 nick #chan :End of /NAMES list.
CChan* pChan = m_pNetwork->FindChan(sRest.Token(0));
@@ -391,9 +414,14 @@ void CIRCSock::ReadLine(const CString& sData) {
}
}
}
+ if (pChan->IsDetached()) {
+ return;
+ }
}
- return; // return so we don't send them the raw twice
+ m_pNetwork->PutUser(sLine);
+
+ break;
}
case 381: // You are now an IRC Operator
m_pNetwork->AddRawBuffer(":" + _NAMEDFMT(sServer) + " " + sCmd + " {target} " + _NAMEDFMT(sRest));
Please sign in to comment.
Something went wrong with that request. Please try again.