summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp18
-rw-r--r--protocols/IRCG/src/input.cpp2
-rw-r--r--protocols/IRCG/src/irclib.cpp26
-rw-r--r--protocols/IRCG/src/scripting.cpp7
-rw-r--r--protocols/IRCG/src/tools.cpp2
-rw-r--r--protocols/IRCG/src/windows.cpp2
6 files changed, 28 insertions, 29 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 52d369a5ba..081d6d6e0a 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -73,7 +73,7 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (!ppro->m_info.sServerName.IsEmpty())
mir_snwprintf(temp2, L"PING %s", ppro->m_info.sServerName.c_str());
else
- mir_snwprintf(temp2, L"PING %u", time(nullptr));
+ mir_snwprintf(temp2, L"PING %u", time(0));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -226,7 +226,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg)
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = (DWORD)time(nullptr);
+ dbei.timestamp = (DWORD)time(0);
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.pBlob = (PBYTE)mir_utf8encodeW(S);
dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1;
@@ -704,7 +704,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg)
MCONTACT hContact = CList_AddContact(&user, false, true);
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(nullptr);
+ pre.timestamp = (DWORD)time(0);
pre.szMessage = mir_utf8encodeW(mess);
setWString(hContact, "User", pmsg->prefix.sUser);
setWString(hContact, "Host", pmsg->prefix.sHost);
@@ -843,7 +843,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
// incoming TIME
else if (pmsg->m_bIncoming && command == L"time") {
wchar_t temp[300];
- time_t tim = time(nullptr);
+ time_t tim = time(0);
mir_wstrncpy(temp, _wctime(&tim), 25);
PostIrcMessage(L"/NOTICE %s \001TIME %s\001", pmsg->prefix.sNick.c_str(), temp);
@@ -1163,7 +1163,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
PROTORECVFILE pre = { 0 };
pre.dwFlags = PRFF_UNICODE;
- pre.timestamp = (DWORD)time(nullptr);
+ pre.timestamp = (DWORD)time(0);
pre.fileCount = 1;
pre.files.w = &tszTemp;
pre.lParam = (LPARAM)di;
@@ -1204,7 +1204,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
}
if (pmsg->m_bIncoming && command == L"ping") {
SetActiveWindow(m_whoisDlg->GetHwnd());
- int s = (int)time(nullptr) - (int)_wtol(GetWordAddress(mess, 1));
+ int s = (int)time(0) - (int)_wtol(GetWordAddress(mess, 1));
wchar_t szTmp[30];
if (s == 1)
mir_snwprintf(szTmp, TranslateT("%u second"), s);
@@ -1219,7 +1219,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
//... else show the reply in the current window
if (pmsg->m_bIncoming && command == L"ping") {
- int s = (int)time(nullptr) - (int)_wtol(GetWordAddress(mess, 1));
+ int s = (int)time(0) - (int)_wtol(GetWordAddress(mess, 1));
mir_snwprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
}
@@ -1316,7 +1316,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg)
else
btOwnMode = 0;
}
- gce.time = gce.bIsMe ? time(nullptr) : 0;
+ gce.time = gce.bIsMe ? time(0) : 0;
Chat_Event(&gce);
DoEvent(GC_EVENT_SETCONTACTSTATUS, sChanName, sTemp, nullptr, nullptr, nullptr, ID_STATUS_ONLINE, FALSE, FALSE);
@@ -2393,7 +2393,7 @@ int CIrcProto::DoPerform(const char* event)
if (!my_strstri(dbv.ptszVal, L"/away"))
PostIrcMessageWnd(nullptr, NULL, dbv.ptszVal);
else
- mir_forkthread(AwayWarningThread, nullptr);
+ mir_forkthread(AwayWarningThread);
db_free(&dbv);
return 1;
}
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index 8b7bec22e7..169dbc4153 100644
--- a/protocols/IRCG/src/input.cpp
+++ b/protocols/IRCG/src/input.cpp
@@ -585,7 +585,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
// if it is not dcc or if it is dcc and a local ip exist
if (mir_wstrcmpi(two.c_str(), L"dcc") != 0 || ulAdr) {
if (mir_wstrcmpi(two.c_str(), L"ping") == 0)
- mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s %u\001", one.c_str(), two.c_str(), time(nullptr));
+ mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s %u\001", one.c_str(), two.c_str(), time(0));
else
mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s\001", one.c_str(), GetWordAddress(text.c_str(), 2));
PostIrcMessageWnd(window, hContact, szTemp);
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 5ffb9c22f1..04b56f2c6a 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -574,11 +574,11 @@ void CIrcProto::CheckDCCTimeout(void)
mir_cslock lck(m_dcc);
for (auto &p : m_dcc_chats)
- if (time(nullptr) > p->tLastActivity + DCCCHATTIMEOUT)
+ if (time(0) > p->tLastActivity + DCCCHATTIMEOUT)
p->Disconnect();
for (auto &p : m_dcc_xfers)
- if (time(nullptr) > p->tLastActivity + DCCSENDTIMEOUT)
+ if (time(0) > p->tLastActivity + DCCSENDTIMEOUT)
p->Disconnect();
}
@@ -719,7 +719,7 @@ CDccSession::CDccSession(CIrcProto* _pro, DCCINFO *pdci) :
con(nullptr),
hBindPort(nullptr)
{
- tLastActivity = time(nullptr);
+ tLastActivity = time(0);
di = pdci; // Setup values passed to the constructor
@@ -783,7 +783,7 @@ CDccSession::~CDccSession() // destroy all that needs destroying
int CDccSession::NLSend(const unsigned char* buf, int cbBuf)
{
- tLastActivity = time(nullptr);
+ tLastActivity = time(0);
if (con)
return Netlib_Send(con, (const char*)buf, cbBuf, di->iType == DCC_CHAT ? MSG_DUMPASTEXT : MSG_NODUMP);
@@ -798,7 +798,7 @@ int CDccSession::NLReceive(const unsigned char* buf, int cbBuf)
if (con)
n = Netlib_Recv(con, (char*)buf, cbBuf, di->iType == DCC_CHAT ? MSG_DUMPASTEXT : MSG_NODUMP);
- tLastActivity = time(nullptr);
+ tLastActivity = time(0);
return n;
}
@@ -863,7 +863,7 @@ int CDccSession::SetupConnection()
pfts.pszFiles.w = file;
pfts.totalProgress = 0;
pfts.currentFileProgress = 0;
- pfts.currentFileTime = (unsigned long)time(nullptr);
+ pfts.currentFileTime = (unsigned long)time(0);
}
// create a listening socket for outgoing chat/send requests. The remote computer connects to this computer. Used for both chat and filetransfer.
@@ -1084,7 +1084,7 @@ void CDccSession::DoSendFile()
// initial ack to set the 'percentage-ready meter' to the correct value
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
- tLastActivity = time(nullptr);
+ tLastActivity = time(0);
// create a packet receiver to handle receiving ack's from the remote computer.
HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(DWORD));
@@ -1155,8 +1155,8 @@ void CDccSession::DoSendFile()
}
// update the filetransfer dialog's 'percentage-ready meter' once per second only to save cpu
- if (tLastPercentageUpdate < time(nullptr)) {
- tLastPercentageUpdate = time(nullptr);
+ if (tLastPercentageUpdate < time(0)) {
+ tLastPercentageUpdate = time(0);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1177,7 +1177,7 @@ void CDccSession::DoSendFile()
}
// ack the progress one final time
- tLastActivity = time(nullptr);
+ tLastActivity = time(0);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1252,8 +1252,8 @@ void CDccSession::DoReceiveFile()
// sets the 'last update time' to check for timed out connections, and also make sure we only
// ack the 'percentage-ready meter' only once a second to save CPU.
- if (tLastPercentageUpdate < time(nullptr)) {
- tLastPercentageUpdate = time(nullptr);
+ if (tLastPercentageUpdate < time(0)) {
+ tLastPercentageUpdate = time(0);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1323,7 +1323,7 @@ void CDccSession::DoChatReceive()
if (*pStart) {
// send it off to some messaging module
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(nullptr);
+ pre.timestamp = (DWORD)time(0);
pre.szMessage = pStart;
ProtoChainRecvMsg(di->hContact, &pre);
}
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index ee3c57ab90..8de2060953 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -64,11 +64,10 @@ static void __stdcall OnHook(void * pi)
delete gch;
}
-static void __cdecl GuiOutThread(LPVOID di)
+static void __cdecl GuiOutThread(GCHOOK *gch)
{
Thread_SetName("IRC: GuiOutThread");
- GCHOOK* gch = (GCHOOK*)di;
- CallFunctionAsync(OnHook, (void*)gch);
+ CallFunctionAsync(OnHook, gch);
}
INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
@@ -100,7 +99,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
else
gchook->pszModule = nullptr;
- mir_forkthread(GuiOutThread, gchook);
+ mir_forkThread<GCHOOK>(GuiOutThread, gchook);
return 0;
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index 96434c7150..311e5bf494 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -395,7 +395,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
gce.dwItemData = dwItemData;
if (timestamp == 1)
- gce.time = time(nullptr);
+ gce.time = time(0);
else
gce.time = timestamp;
gce.bIsMe = bIsMe;
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 0529e63153..72831b3a3c 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -126,7 +126,7 @@ void CWhoisDlg::OnPing(CCtrlButton*)
wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(nullptr));
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(0));
}
void CWhoisDlg::OnUserInfo(CCtrlButton*)