diff options
author | George Hazan <ghazan@miranda.im> | 2022-05-07 15:00:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-05-07 15:00:02 +0300 |
commit | c4ffab658f422e84259a0a9769f0003b33a013bd (patch) | |
tree | 667448a4911b47f72acbb82a0142e13ddefb3b6d /protocols/IRCG/src | |
parent | fd1ca33248519ee530d1d05c6a451c9c63bf4e8a (diff) |
Netlib_OpenConnection - finally old stupid structure NETLIBOPENCONNECTION died and converted into a set of parameters + code cleaning
Diffstat (limited to 'protocols/IRCG/src')
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 4e17358632..b36e1b37e7 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -194,10 +194,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) { codepage = m_codepage; - NETLIBOPENCONNECTION ncon = {}; - ncon.szHost = info.sServer.c_str(); - ncon.wPort = info.iPort; - con = Netlib_OpenConnection(m_hNetlibUser, &ncon); + con = Netlib_OpenConnection(m_hNetlibUser, info.sServer, info.iPort); if (con == nullptr) { wchar_t szTemp[300]; mir_snwprintf(szTemp, L"%c5%s %c%s%c (%S: %u).", irc::COLOR, TranslateT("Failed to connect to"), irc::BOLD, m_tszUserName, irc::BOLD, m_sessionInfo.sServer.c_str(), m_sessionInfo.iPort); @@ -856,12 +853,8 @@ int CDccSession::SetupConnection() // If a remote computer initiates a chat session this is used to connect to the remote computer (user already accepted at this point). // also used for connecting to a remote computer for remote file transfers - if (di->iType == DCC_CHAT && !di->bSender || di->iType == DCC_SEND && di->bSender && di->bReverse) { - NETLIBOPENCONNECTION ncon = {}; - ncon.szHost = ConvertIntegerToIP(di->dwAdr); - ncon.wPort = (uint16_t)di->iPort; - con = Netlib_OpenConnection(m_proto->hNetlibDCC, &ncon); - } + if (di->iType == DCC_CHAT && !di->bSender || di->iType == DCC_SEND && di->bSender && di->bReverse) + con = Netlib_OpenConnection(m_proto->hNetlibDCC, ConvertIntegerToIP(di->dwAdr), di->iPort); // If a remote computer initiates a filetransfer this is used to connect to that computer (the user has chosen to accept but it is possible the file exists/needs to be resumed etc still) if (di->iType == DCC_SEND && !di->bSender) { @@ -951,11 +944,7 @@ int CDccSession::SetupConnection() } // connect to the remote computer from which you are receiving the file (now all actions to take (resume/overwrite etc) have been decided - NETLIBOPENCONNECTION ncon = {}; - ncon.szHost = ConvertIntegerToIP(di->dwAdr); - ncon.wPort = (uint16_t)di->iPort; - - con = Netlib_OpenConnection(m_proto->hNetlibDCC, &ncon); + con = Netlib_OpenConnection(m_proto->hNetlibDCC, ConvertIntegerToIP(di->dwAdr), di->iPort); } // if for some reason the plugin has failed to connect to the remote computer the object is destroyed. |