summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_events.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index 66402d442a..bad357df93 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -135,4 +135,44 @@ int CSkypeProto::ProcessSrmmEvent(WPARAM, LPARAM lParam)
SetSrmmReadStatus(event->hContact);
return 0;
+}
+
+//Timers
+
+mir_cs timerLock;
+mir_cs CSkypeProto::accountsLock;
+
+void CSkypeProto::ProcessTimer()
+{
+ if (IsOnline())
+ {
+ PushRequest(new GetContactListRequest(m_szTokenSecret), &CSkypeProto::LoadContactList);
+ SendPresence(false);
+ if (!m_hTrouterThread)
+ SendRequest(new CreateTrouterRequest(), &CSkypeProto::OnCreateTrouter);
+ }
+}
+
+static VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
+{
+ mir_cslock lck(CSkypeProto::accountsLock);
+ for (int i = 0; i < Accounts.getCount(); i++)
+ {
+ Accounts[i]->ProcessTimer();
+ }
+}
+
+void CSkypeProto::SkypeSetTimer(void*)
+{
+ mir_cslock lck(timerLock);
+ if (!CSkypeProto::m_timer)
+ CSkypeProto::m_timer = SetTimer(NULL, 0, 600000, TimerProc);
+}
+
+void CSkypeProto::SkypeUnsetTimer(void*)
+{
+ mir_cslock lck(timerLock);
+ if (CSkypeProto::m_timer)
+ KillTimer(NULL, CSkypeProto::m_timer);
+ CSkypeProto::m_timer = 0;
} \ No newline at end of file