Implemented a nick compare function

As suggested by the todos in IRCSock, added IsNick(CString) method
so the ugly Nick.GetNick().Equals(GetNick()) could be simplified.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
This commit is contained in:
Toon Schoenmakers
2013-10-10 17:22:16 +02:00
parent b7ce935cb3
commit 83b9a28e4c
3 changed files with 8 additions and 6 deletions

View File

@@ -512,8 +512,7 @@ void CIRCSock::ReadLine(const CString& sData) {
}
}
// Todo: use nick compare function here
if (Nick.GetNick().Equals(GetNick())) {
if (Nick.IsNick(GetNick())) {
// We are changing our own nick, the clients always must see this!
bIsVisible = false;
SetNick(sNewNick);
@@ -563,8 +562,7 @@ void CIRCSock::ReadLine(const CString& sData) {
CString sChan = sRest.Token(0).TrimPrefix_n();
CChan* pChan;
// Todo: use nick compare function
if (Nick.GetNick().Equals(GetNick())) {
if (Nick.IsNick(GetNick())) {
m_pNetwork->AddChan(sChan, false);
pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
@@ -598,8 +596,7 @@ void CIRCSock::ReadLine(const CString& sData) {
bDetached = true;
}
// Todo: use nick compare function
if (Nick.GetNick().Equals(GetNick())) {
if (Nick.IsNick(GetNick())) {
m_pNetwork->DelChan(sChan);
}