diff options
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_groupchat.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iq_handlers.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_iqid.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_misc.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_omemo.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_opt.cpp | 582 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_util.cpp | 2 |
11 files changed, 298 insertions, 318 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index e989a1e4d3..c7a739b642 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -234,7 +234,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus gce.ptszUID = user->m_tszResourceName;
gce.ptszText = buf;
gce.dwFlags = GCEF_ADDTOLOG;
- gce.time = time(nullptr);
+ gce.time = time(0);
Chat_Event(&gce);
}
}
@@ -263,7 +263,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t gce.ptszText = szReason;
if (item->bChatActive == 2) {
gce.dwFlags |= GCEF_ADDTOLOG;
- gce.time = time(nullptr);
+ gce.time = time(0);
}
switch (gce.iType = action) {
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 3316875e72..f8bf39701c 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -189,7 +189,7 @@ int CJabberProto::OnIdleChanged(WPARAM, LPARAM lParam) if (lParam & IDF_ISIDLE) {
MIRANDA_IDLE_INFO mii;
Idle_GetInfo(mii);
- m_tmJabberIdleStartTime = time(nullptr) - mii.idleTime * 60;
+ m_tmJabberIdleStartTime = time(0) - mii.idleTime * 60;
}
else m_tmJabberIdleStartTime = 0;
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index b729e79206..698248a5f3 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -377,7 +377,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) PROTORECVFILE pre = { 0 };
pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
- pre.timestamp = time(nullptr);
+ pre.timestamp = time(0);
pre.files.w = (wchar_t**)&filename;
pre.lParam = (LPARAM)ft;
if ((n = XmlGetChild(fileNode, "desc")) != nullptr)
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 89c1f215ed..4deab1e08d 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -800,7 +800,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t * GCEVENT gce = { m_szModuleName, item->jid, GC_EVENT_NICK };
if (jid != nullptr)
gce.ptszUserInfo = jid;
- gce.time = time(nullptr);
+ gce.time = time(0);
gce.ptszNick = oldNick;
gce.ptszUID = newNick;
gce.ptszText = newNick;
@@ -1095,7 +1095,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) }
bool isHistory = msgTime != 0;
- time_t now = time(nullptr);
+ time_t now = time(0);
if (!msgTime || msgTime > now)
msgTime = now;
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 92f4492ee4..942e257746 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -57,7 +57,7 @@ BOOL CJabberProto::OnIqRequestLastActivity(HXML, CJabberIqInfo *pInfo) {
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
- << XATTRI(L"seconds", m_tmJabberIdleStartTime ? time(nullptr) - m_tmJabberIdleStartTime : 0));
+ << XATTRI(L"seconds", m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
return TRUE;
}
@@ -376,7 +376,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) PROTORECVFILE pre;
pre.dwFlags = PRFF_UNICODE;
- pre.timestamp = time(nullptr);
+ pre.timestamp = time(0);
pre.descr.w = desc;
pre.files.w = &str2;
pre.fileCount = 1;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index e98ae24c1e..099b8b8d7f 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -174,7 +174,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq) void CJabberProto::OnLoggedIn()
{
m_bJabberOnline = true;
- m_tmJabberLoggedInTime = time(nullptr);
+ m_tmJabberLoggedInTime = time(0);
m_ThreadInfo->dwLoginRqs = 0;
@@ -1587,7 +1587,7 @@ void CJabberProto::OnIqResultLastActivity(HXML iqNode, CJabberIqInfo *pInfo) if (szSeconds) {
int nSeconds = _wtoi(szSeconds);
if (nSeconds > 0)
- lastActivity = time(nullptr) - nSeconds;
+ lastActivity = time(0) - nSeconds;
}
const wchar_t *szLastStatusMessage = XPathT(iqNode, "query[@xmlns='jabber:iq:last']");
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 440cf657cf..d3a9570255 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -52,7 +52,7 @@ void CJabberProto::DBAddAuthRequest(const wchar_t *jid, const wchar_t *nick) DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (DWORD)time(nullptr);
+ dbei.timestamp = (DWORD)time(0);
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.cbBlob = blob.size();
@@ -123,7 +123,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType) dbei.cbBlob = sizeof(btEventType);
dbei.eventType = EVENTTYPE_JABBER_PRESENCE;
dbei.flags = DBEF_READ;
- dbei.timestamp = time(nullptr);
+ dbei.timestamp = time(0);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index f03d80d3fb..f52b0340fc 100755 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -590,7 +590,7 @@ namespace omemo { session_signed_pre_key* signed_pre_key;
{
const unsigned int signed_pre_key_id = 1;
- signal_protocol_key_helper_generate_signed_pre_key(&signed_pre_key, new_dev->device_key, signed_pre_key_id, time(nullptr), global_context);
+ signal_protocol_key_helper_generate_signed_pre_key(&signed_pre_key, new_dev->device_key, signed_pre_key_id, time(0), global_context);
SIGNAL_UNREF(new_dev->device_key);
signal_buffer *serialized_signed_pre_key;
session_signed_pre_key_serialize(&serialized_signed_pre_key, signed_pre_key);
@@ -1868,7 +1868,7 @@ bool CJabberProto::OmemoHandleMessage(HXML node, wchar_t *jid, time_t msgTime) }
}
- time_t now = time(nullptr);
+ time_t now = time(0);
if (!msgTime)
msgTime = now;
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 9ea5605e9c..1808615c7e 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -590,7 +590,7 @@ private: void cbServer_OnDropdown(CCtrlCombo*)
{
if (!m_gotservers)
- mir_forkthread(QueryServerListThread, this);
+ mir_forkThread<CDlgOptAccount>(QueryServerListThread, this);
}
void chkManualHost_OnChange(CCtrlData *sender)
@@ -710,11 +710,10 @@ private: mir_free(server);
}
- static void QueryServerListThread(void *arg)
+ static void __cdecl QueryServerListThread(CDlgOptAccount *wnd)
{
Thread_SetName("Jabber: QueryServerListThread");
- CDlgOptAccount *wnd = (CDlgOptAccount *)arg;
HWND hwnd = wnd->GetHwnd();
bool bIsError = true;
@@ -1853,7 +1852,7 @@ private: void cbServer_OnDropdown(CCtrlCombo*)
{
if (!m_gotservers)
- mir_forkthread(QueryServerListThread, this);
+ mir_forkThread<CJabberDlgAccMgrUI>(QueryServerListThread, this);
}
void cbType_OnChange(CCtrlData *sender)
@@ -1897,334 +1896,315 @@ private: }
}
- void CheckRegistration();
- void setupConnection(int type);
- void setupPublic();
- void setupSecure();
- void setupSecureSSL();
- void setupGoogle();
- void setupHipchat();
- void setupLJ();
- void setupLOLEN();
- void setupLOLEW();
- void setupLOLOC();
- void setupLOLUS();
- void setupOK();
- void setupSMS();
- void RefreshServers(HXML node);
- static void QueryServerListThread(void *arg);
-};
+ void CheckRegistration()
+ {
+ if (!m_canregister) {
+ m_btnRegister.Disable();
+ return;
+ }
-void CJabberDlgAccMgrUI::CheckRegistration()
-{
- if (!m_canregister) {
- m_btnRegister.Disable();
- return;
+ JABBER_CONN_DATA regInfo;
+ m_txtUsername.GetText(regInfo.username, _countof(regInfo.username));
+ m_txtPassword.GetText(regInfo.password, _countof(regInfo.password));
+ m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server));
+ regInfo.port = m_txtPort.GetInt();
+ if (m_chkManualHost.GetState() == BST_CHECKED)
+ m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost));
+ else
+ regInfo.manualHost[0] = '\0';
+
+ if (regInfo.username[0] && regInfo.password[0] && regInfo.server[0] && regInfo.port > 0 && ((m_chkManualHost.GetState() != BST_CHECKED) || regInfo.manualHost[0]))
+ m_btnRegister.Enable();
+ else
+ m_btnRegister.Disable();
}
- JABBER_CONN_DATA regInfo;
- m_txtUsername.GetText(regInfo.username, _countof(regInfo.username));
- m_txtPassword.GetText(regInfo.password, _countof(regInfo.password));
- m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server));
- regInfo.port = m_txtPort.GetInt();
- if (m_chkManualHost.GetState() == BST_CHECKED)
- m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost));
- else
- regInfo.manualHost[0] = '\0';
+ void setupConnection(int type)
+ {
+ switch (type) {
+ case ACC_PUBLIC: setupPublic(); break;
+ case ACC_TLS: setupSecure(); break;
+ case ACC_SSL: setupSecureSSL(); break;
+ case ACC_GTALK: setupGoogle(); break;
+ case ACC_HIPCHAT: setupHipchat(); break;
+ case ACC_LJTALK: setupLJ(); break;
+ case ACC_LOL_EN: setupLOLEN(); break;
+ case ACC_LOL_EW: setupLOLEW(); break;
+ case ACC_LOL_OC: setupLOLOC(); break;
+ case ACC_LOL_US: setupLOLUS(); break;
+ case ACC_OK: setupOK(); break;
+ case ACC_SMS: setupSMS(); break;
+ }
+ }
- if (regInfo.username[0] && regInfo.password[0] && regInfo.server[0] && regInfo.port > 0 && ((m_chkManualHost.GetState() != BST_CHECKED) || regInfo.manualHost[0]))
+ void setupPublic()
+ {
+ m_canregister = true;
+ m_gotservers = false;
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Enable();
+ m_chkManualHost.Enable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
m_btnRegister.Enable();
- else
- m_btnRegister.Disable();
-}
+ }
-void CJabberDlgAccMgrUI::setupConnection(int type)
-{
- switch (type) {
- case ACC_PUBLIC: setupPublic(); break;
- case ACC_TLS: setupSecure(); break;
- case ACC_SSL: setupSecureSSL(); break;
- case ACC_GTALK: setupGoogle(); break;
- case ACC_HIPCHAT: setupHipchat(); break;
- case ACC_LJTALK: setupLJ(); break;
- case ACC_LOL_EN: setupLOLEN(); break;
- case ACC_LOL_EW: setupLOLEW(); break;
- case ACC_LOL_OC: setupLOLOC(); break;
- case ACC_LOL_US: setupLOLUS(); break;
- case ACC_OK: setupOK(); break;
- case ACC_SMS: setupSMS(); break;
+ void setupSecure()
+ {
+ m_canregister = true;
+ m_gotservers = false;
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Enable();
+ m_chkManualHost.Enable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Enable();
}
-}
-void CJabberDlgAccMgrUI::setupPublic()
-{
- m_canregister = true;
- m_gotservers = false;
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Enable();
- m_chkManualHost.Enable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Enable();
-}
+ void setupSecureSSL()
+ {
+ m_canregister = true;
+ m_gotservers = false;
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5223);
+
+ m_cbServer.Enable();
+ m_chkManualHost.Enable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Enable();
+ }
-void CJabberDlgAccMgrUI::setupSecure()
-{
- m_canregister = true;
- m_gotservers = false;
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Enable();
- m_chkManualHost.Enable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Enable();
-}
+ void setupGoogle()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.AddStringA("gmail.com");
+ m_cbServer.AddStringA("googlemail.com");
+ m_cbServer.SetTextA("gmail.com");
+ m_chkManualHost.SetState(BST_CHECKED);
+ m_txtManualHost.SetTextA("talk.google.com");
+ m_txtPort.SetInt(443);
+
+ m_cbServer.Enable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupSecureSSL()
-{
- m_canregister = true;
- m_gotservers = false;
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5223);
-
- m_cbServer.Enable();
- m_chkManualHost.Enable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Enable();
-}
+ void setupHipchat()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("chat.hipchat.com");
+ m_cbServer.AddStringA("chat.hipchat.com");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupGoogle()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.AddStringA("gmail.com");
- m_cbServer.AddStringA("googlemail.com");
- m_cbServer.SetTextA("gmail.com");
- m_chkManualHost.SetState(BST_CHECKED);
- m_txtManualHost.SetTextA("talk.google.com");
- m_txtPort.SetInt(443);
-
- m_cbServer.Enable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- //m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupLJ()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("livejournal.com");
+ m_cbServer.AddStringA("livejournal.com");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupHipchat()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("chat.hipchat.com");
- m_cbServer.AddStringA("chat.hipchat.com");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupLOLEN()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("pvp.net");
+ m_cbServer.AddStringA("pvp.net");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("chat.eun1.lol.riotgames.com");
+ m_txtPort.SetInt(5223);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupLJ()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("livejournal.com");
- m_cbServer.AddStringA("livejournal.com");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupLOLEW()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("pvp.net");
+ m_cbServer.AddStringA("pvp.net");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("chat.euw1.lol.riotgames.com");
+ m_txtPort.SetInt(5223);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupLOLEN()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("pvp.net");
- m_cbServer.AddStringA("pvp.net");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("chat.eun1.lol.riotgames.com");
- m_txtPort.SetInt(5223);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupLOLOC()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("pvp.net");
+ m_cbServer.AddStringA("pvp.net");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("chat.oc1.lol.riotgames.com");
+ m_txtPort.SetInt(5223);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupLOLEW()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("pvp.net");
- m_cbServer.AddStringA("pvp.net");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("chat.euw1.lol.riotgames.com");
- m_txtPort.SetInt(5223);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupLOLUS()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("pvp.net");
+ m_cbServer.AddStringA("pvp.net");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("chat.na2.lol.riotgames.com");
+ m_txtPort.SetInt(5223);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupLOLOC()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("pvp.net");
- m_cbServer.AddStringA("pvp.net");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("chat.oc1.lol.riotgames.com");
- m_txtPort.SetInt(5223);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupOK()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("xmpp.odnoklassniki.ru");
+ m_cbServer.AddStringA("xmpp.odnoklassniki.ru");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupLOLUS()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("pvp.net");
- m_cbServer.AddStringA("pvp.net");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("chat.na2.lol.riotgames.com");
- m_txtPort.SetInt(5223);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void setupSMS()
+ {
+ m_canregister = false;
+ m_gotservers = true;
+ m_cbServer.ResetContent();
+ m_cbServer.SetTextA("S.ms");
+ m_cbServer.AddStringA("S.ms");
+ m_chkManualHost.SetState(BST_UNCHECKED);
+ m_txtManualHost.SetTextA("");
+ m_txtPort.SetInt(5222);
+
+ m_cbServer.Disable();
+ m_chkManualHost.Disable();
+ m_txtManualHost.Disable();
+ m_txtPort.Disable();
+ m_btnRegister.Disable();
+ }
-void CJabberDlgAccMgrUI::setupOK()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("xmpp.odnoklassniki.ru");
- m_cbServer.AddStringA("xmpp.odnoklassniki.ru");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ void RefreshServers(HXML node)
+ {
+ m_gotservers = node != nullptr;
-void CJabberDlgAccMgrUI::setupSMS()
-{
- m_canregister = false;
- m_gotservers = true;
- m_cbServer.ResetContent();
- m_cbServer.SetTextA("S.ms");
- m_cbServer.AddStringA("S.ms");
- m_chkManualHost.SetState(BST_UNCHECKED);
- m_txtManualHost.SetTextA("");
- m_txtPort.SetInt(5222);
-
- m_cbServer.Disable();
- m_chkManualHost.Disable();
- m_txtManualHost.Disable();
- m_txtPort.Disable();
- m_btnRegister.Disable();
-}
+ wchar_t *server = m_cbServer.GetText();
+ bool bDropdown = m_cbServer.GetDroppedState();
+ if (bDropdown) m_cbServer.ShowDropdown(false);
-void CJabberDlgAccMgrUI::RefreshServers(HXML node)
-{
- m_gotservers = node != nullptr;
+ m_cbServer.ResetContent();
+ if (node) {
+ for (int i = 0;; i++) {
+ HXML n = XmlGetChild(node, i);
+ if (!n)
+ break;
- wchar_t *server = m_cbServer.GetText();
- bool bDropdown = m_cbServer.GetDroppedState();
- if (bDropdown) m_cbServer.ShowDropdown(false);
+ if (!mir_wstrcmp(XmlGetName(n), L"item"))
+ if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
+ if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
+ m_cbServer.AddString(jid);
+ }
+ }
- m_cbServer.ResetContent();
- if (node) {
- for (int i = 0;; i++) {
- HXML n = XmlGetChild(node, i);
- if (!n)
- break;
+ m_cbServer.SetText(server);
- if (!mir_wstrcmp(XmlGetName(n), L"item"))
- if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
- if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
- m_cbServer.AddString(jid);
- }
+ if (bDropdown) m_cbServer.ShowDropdown();
+ mir_free(server);
}
- m_cbServer.SetText(server);
+ static void __cdecl QueryServerListThread(CJabberDlgAccMgrUI *wnd)
+ {
+ HWND hwnd = wnd->GetHwnd();
+ bool bIsError = true;
- if (bDropdown) m_cbServer.ShowDropdown();
- mir_free(server);
-}
+ NETLIBHTTPREQUEST request = { 0 };
+ request.cbSize = sizeof(request);
+ request.requestType = REQUEST_GET;
+ request.flags = NLHRF_HTTP11;
+ request.szUrl = JABBER_SERVER_URL;
-void CJabberDlgAccMgrUI::QueryServerListThread(void *arg)
-{
- CDlgOptAccount *wnd = (CDlgOptAccount *)arg;
- HWND hwnd = wnd->GetHwnd();
- bool bIsError = true;
-
- NETLIBHTTPREQUEST request = { 0 };
- request.cbSize = sizeof(request);
- request.requestType = REQUEST_GET;
- request.flags = NLHRF_HTTP11;
- request.szUrl = JABBER_SERVER_URL;
-
- NETLIBHTTPREQUEST *result = Netlib_HttpTransaction(wnd->GetProto()->m_hNetlibUser, &request);
- if (result && IsWindow(hwnd)) {
- if ((result->resultCode == 200) && result->dataLength && result->pData) {
- wchar_t *ptszText = mir_a2u(result->pData);
- XmlNode node(ptszText, nullptr, nullptr);
- if (node) {
- HXML queryNode = XmlGetChild(node, L"query");
- if (queryNode && IsWindow(hwnd)) {
- SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
- bIsError = false;
+ NETLIBHTTPREQUEST *result = Netlib_HttpTransaction(wnd->GetProto()->m_hNetlibUser, &request);
+ if (result && IsWindow(hwnd)) {
+ if ((result->resultCode == 200) && result->dataLength && result->pData) {
+ wchar_t *ptszText = mir_a2u(result->pData);
+ XmlNode node(ptszText, nullptr, nullptr);
+ if (node) {
+ HXML queryNode = XmlGetChild(node, L"query");
+ if (queryNode && IsWindow(hwnd)) {
+ SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
+ bIsError = false;
+ }
}
+ mir_free(ptszText);
}
- mir_free(ptszText);
}
- }
- if (result)
- Netlib_FreeHttpRequest(result);
- if (bIsError)
- SendMessage(hwnd, WM_JABBER_REFRESH, 0, 0);
-}
+ if (result)
+ Netlib_FreeHttpRequest(result);
+ if (bIsError)
+ SendMessage(hwnd, WM_JABBER_REFRESH, 0, 0);
+ }
+};
INT_PTR CJabberProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
{
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index de7141ecf6..38aae073ee 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1238,7 +1238,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) dbei.cbBlob = 1;
dbei.eventType = EVENTTYPE_JABBER_CHATSTATES;
dbei.flags = DBEF_READ;
- dbei.timestamp = time(nullptr);
+ dbei.timestamp = time(0);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
}
@@ -1490,7 +1490,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) hContact = CreateTemporaryContact(from, chatItem);
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
- time_t now = time(nullptr);
+ time_t now = time(0);
if (!msgTime)
msgTime = now;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 9679ee23ca..b4b4537de5 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -447,7 +447,7 @@ void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, con }
if (m_tmJabberIdleStartTime)
- p << XQUERY(JABBER_FEAT_LAST_ACTIVITY) << XATTRI(L"seconds", time(nullptr) - m_tmJabberIdleStartTime);
+ p << XQUERY(JABBER_FEAT_LAST_ACTIVITY) << XATTRI(L"seconds", time(0) - m_tmJabberIdleStartTime);
if (m_bEnableAvatars) {
HXML x = p << XCHILDNS(L"x", L"vcard-temp:x:update");
|