diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-02 11:27:20 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-02 11:27:20 +0000 |
commit | b96fa2b498afb19bda93d0cd1e399589d17d3d3e (patch) | |
tree | 7ffdee1b60531babd7ea6269fd50f91eccdd9bb3 /protocols/SkypeWeb/src/skype_proto.cpp | |
parent | 198c817b781f9982f73c411a30fd6e1e79760a3e (diff) |
SkypeWeb: Sound on call cancel. Minor fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13369 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index b11462fdd4..0d3b1f7578 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -60,10 +60,13 @@ PROTO<CSkypeProto>(protoName, userName), password(NULL) dbEventType.descr = Translate("Incoming call");
dbEventType.eventIcon = GetIconHandle("inc_call");
CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+
//hooks
m_hCallHook = CreateHookableEvent(MODULE"/IncomingCall");
+
//sounds
- SkinAddNewSoundEx("skype_inc_call", "SkypeWeb", LPGEN("Incoming call sound"));
+ SkinAddNewSoundEx("skype_inc_call", "SkypeWeb", LPGEN("Incoming call sound") );
+ SkinAddNewSoundEx("skype_call_canceled", "SkypeWeb", LPGEN("Incoming call canceled sound") );
}
CSkypeProto::~CSkypeProto()
@@ -107,7 +110,30 @@ MCONTACT CSkypeProto::AddToList(int, PROTOSEARCHRESULT *psr) return hContact;
}
-MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT) { return 0; }
+MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT hDbEvent)
+{
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
+ return NULL;
+ if ((dbei.pBlob=(PBYTE)alloca(dbei.cbBlob)) == NULL)
+ return NULL;
+ if (db_event_get(hDbEvent, &dbei))
+ return NULL;
+ if (strcmp(dbei.szModule, m_szModuleName))
+ return NULL;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
+ return NULL;
+
+ char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
+ char *firstName = nick + strlen(nick) + 1;
+ char *lastName = firstName + strlen(firstName) + 1;
+ char *skypename = lastName + strlen(lastName) + 1;
+
+ char *newSkypename = (dbei.flags & DBEF_UTF) ? mir_utf8decodeA(skypename) : skypename;
+ MCONTACT hContact = AddContact(newSkypename);
+ mir_free(newSkypename);
+ return hContact;
+}
int CSkypeProto::Authorize(MEVENT hDbEvent)
{
@@ -256,12 +282,14 @@ int CSkypeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam int CSkypeProto::OnPreShutdown(WPARAM, LPARAM)
{
debugLogA(__FUNCTION__);
-
+
isTerminated = true;
if (m_pollingConnection)
CallService(MS_NETLIB_SHUTDOWN, (WPARAM)m_pollingConnection, 0);
if (m_TrouterConnection)
CallService(MS_NETLIB_SHUTDOWN, (WPARAM)m_TrouterConnection, 0);
+ requestQueue->Stop();
+
return 0;
}
\ No newline at end of file |