summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-26 15:23:19 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-26 15:23:19 +0300
commitda1b2a070c113222cbbad31b18ab704c7d1301b2 (patch)
tree841092328c9c7fb35c3454627296862a956f5d5c /protocols/IRCG
parentbe1918c1b2986ddb387cd593deddf120f9e61874 (diff)
Chat_AddGroup - simplified prototype
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp17
-rw-r--r--protocols/IRCG/src/irclib.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.h3
-rw-r--r--protocols/IRCG/src/services.cpp26
5 files changed, 26 insertions, 24 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 08a2839c37..fcc1da7901 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -1272,16 +1272,17 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg)
CMStringW sID = MakeWndID(sChanName);
BYTE btOwnMode = 0;
- if (Chat_NewSession(GCW_CHATROOM, m_szModuleName, sID, sChanName)) {
+ SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sID, sChanName);
+ if (si) {
PostIrcMessage(L"/MODE %s", sChanName);
// register the statuses
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Owner"));
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Admin"));
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Op"));
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Halfop"));
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Voice"));
- Chat_AddGroup(m_szModuleName, sID, TranslateT("Normal"));
+ Chat_AddGroup(si, TranslateT("Owner"));
+ Chat_AddGroup(si, TranslateT("Admin"));
+ Chat_AddGroup(si, TranslateT("Op"));
+ Chat_AddGroup(si, TranslateT("Halfop"));
+ Chat_AddGroup(si, TranslateT("Voice"));
+ Chat_AddGroup(si, TranslateT("Normal"));
{
int k = 0;
CMStringW sTemp = GetWord(sNamesList, k);
@@ -2376,7 +2377,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
}
}
- Chat_AddGroup(m_szModuleName, SERVERWINDOW, TranslateT("Normal"));
+ Chat_AddGroup(m_pServer, TranslateT("Normal"));
Chat_Control(m_szModuleName, SERVERWINDOW, SESSION_ONLINE);
CallFunctionAsync(sttMainThrdOnConnect, this);
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 04b26ec02f..3dd16b0769 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -201,7 +201,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
con = Netlib_OpenConnection(m_hNetlibUser, &ncon);
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, si.sNetwork.c_str(), irc::BOLD, si.sServer.c_str(), si.iPort);
+ mir_snwprintf(szTemp, L"%c5%s %c%s%c (%S: %u).", irc::COLOR, TranslateT("Failed to connect to"), irc::BOLD, m_sessionInfo.sNetwork.c_str(), irc::BOLD, m_sessionInfo.sServer.c_str(), m_sessionInfo.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
return false;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 380984a4f9..7335225248 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -205,7 +205,7 @@ void CIrcProto::OnModulesLoaded()
HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook);
HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook);
- Chat_NewSession(GCW_SERVER, m_szModuleName, SERVERWINDOW, _A2T(m_network));
+ m_pServer = Chat_NewSession(GCW_SERVER, m_szModuleName, SERVERWINDOW, _A2T(m_network));
if (m_useServer && !m_hideServerWindow)
Chat_Control(m_szModuleName, SERVERWINDOW, WINDOW_VISIBLE);
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h
index 559a919a34..6f28678664 100644
--- a/protocols/IRCG/src/ircproto.h
+++ b/protocols/IRCG/src/ircproto.h
@@ -170,7 +170,8 @@ struct CIrcProto : public PROTO<CIrcProto>
CMStringW m_statusMessage;
int m_iTempCheckTime;
- CIrcSessionInfo si;
+ CIrcSessionInfo m_sessionInfo;
+ SESSION_INFO *m_pServer;
int m_portCount;
DWORD m_bConnectRequested;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 7d622ca3a0..fe3908b465 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -945,7 +945,7 @@ void __cdecl CIrcProto::ConnectServerThread(void*)
Sleep(100);
{
mir_cslock lock(m_csSession);
- Connect(si);
+ Connect(m_sessionInfo);
}
if (IsConnected()) {
if (m_mySpecifiedHost[0])
@@ -977,17 +977,17 @@ void __cdecl CIrcProto::DisconnectServerThread(void*)
void CIrcProto::ConnectToServer(void)
{
m_portCount = atoi(m_portStart);
- si.sServer = GetWord(m_serverName, 0);
- si.iPort = m_portCount;
- si.sNick = m_nick;
- si.sUserID = m_userID;
- si.sFullName = m_name;
- si.sPassword = m_password;
- si.bIdentServer = ((m_ident) ? (true) : (false));
- si.iIdentServerPort = _wtoi(m_identPort);
- si.sIdentServerType = m_identSystem;
- si.m_iSSL = m_iSSL;
- si.sNetwork = m_network;
+ m_sessionInfo.sServer = GetWord(m_serverName, 0);
+ m_sessionInfo.iPort = m_portCount;
+ m_sessionInfo.sNick = m_nick;
+ m_sessionInfo.sUserID = m_userID;
+ m_sessionInfo.sFullName = m_name;
+ m_sessionInfo.sPassword = m_password;
+ m_sessionInfo.bIdentServer = ((m_ident) ? (true) : (false));
+ m_sessionInfo.iIdentServerPort = _wtoi(m_identPort);
+ m_sessionInfo.sIdentServerType = m_identSystem;
+ m_sessionInfo.m_iSSL = m_iSSL;
+ m_sessionInfo.sNetwork = m_network;
bPerformDone = false;
bTempDisableCheck = false;
@@ -1004,7 +1004,7 @@ void CIrcProto::ConnectToServer(void)
InterlockedIncrement((long *)&m_bConnectRequested);
wchar_t szTemp[300];
- mir_snwprintf(szTemp, L"\033%s %c%s%c (%S: %u)", TranslateT("Connecting to"), irc::BOLD, si.sNetwork.c_str(), irc::BOLD, si.sServer.c_str(), si.iPort);
+ mir_snwprintf(szTemp, L"\033%s %c%s%c (%S: %u)", TranslateT("Connecting to"), irc::BOLD, m_sessionInfo.sNetwork.c_str(), irc::BOLD, m_sessionInfo.sServer.c_str(), m_sessionInfo.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
}