diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-04-29 05:05:06 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-04-29 05:05:06 +0000 |
commit | 68aeed54fb2c7c7d10c192a99c25d0a0c870b017 (patch) | |
tree | c6d0056480519c69823db8374fcde3eb72b4eef5 /protocols/Skype/src | |
parent | f0ca17cf986fc21dd98037a4599e85437261d5de (diff) |
- added new db event type
- added new icons
- fixed few bugs
git-svn-id: http://svn.miranda-ng.org/main/trunk@4565 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r-- | protocols/Skype/src/resource.h | 5 | ||||
-rw-r--r-- | protocols/Skype/src/skype.h | 3 | ||||
-rw-r--r-- | protocols/Skype/src/skype_avatars.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_events.cpp | 16 | ||||
-rw-r--r-- | protocols/Skype/src/skype_hooks.cpp | 9 | ||||
-rw-r--r-- | protocols/Skype/src/skype_icons.cpp | 7 | ||||
-rw-r--r-- | protocols/Skype/src/skype_menus.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 13 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_utils.cpp | 4 |
10 files changed, 41 insertions, 22 deletions
diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index b6c51c5a9d..524a4ff0fa 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -15,6 +15,9 @@ #define IDI_AUTH_REVOKE 105
#define IDD_PASSWORD_REQUEST 106
#define IDR_KEY 107
+#define IDI_CALL 108
+#define IDI_ICON1 109
+#define IDI_CONF_INVITE 109
#define IDC_CCLIST 173
#define IDC_EDITSCR 174
#define IDC_ADDSCR 175
@@ -48,7 +51,7 @@ //
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 108
+#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1025
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h index b8463cb10a..3faceb3bf8 100644 --- a/protocols/Skype/src/skype.h +++ b/protocols/Skype/src/skype.h @@ -53,7 +53,8 @@ #define SKYPE_SEARCH_BYEMAIL 1002
#define SKYPE_SEARCH_BYNAMES 1003
-#define SKYPE_DB_EVENT_TYPE_CALL 9000
+#define SKYPE_DB_EVENT_TYPE_EMOTE 10001
+#define SKYPE_DB_EVENT_TYPE_CALL 10010
#define CMI_AUTH_REVOKE 0
#define CMI_AUTH_REQUEST 1
diff --git a/protocols/Skype/src/skype_avatars.cpp b/protocols/Skype/src/skype_avatars.cpp index c95d4e3d2a..adf956edeb 100644 --- a/protocols/Skype/src/skype_avatars.cpp +++ b/protocols/Skype/src/skype_avatars.cpp @@ -210,7 +210,7 @@ INT_PTR __cdecl CSkypeProto::SetMyAvatar(WPARAM, LPARAM lParam) return iRet;
}
- uint newTS = this->account->GetUintProp(/* *::P_AVATAR_TIMESTAMP */ 182);
+ uint newTS = this->account->GetUintProp(Account::P_AVATAR_IMAGE);
::db_set_dw(NULL, this->m_szModuleName, "AvatarTS", newTS);
iRet = 0;
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index ac5bebdab2..bbe7aaf9fe 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -98,6 +98,9 @@ void CSkypeProto::OnMessageReceived(CConversation::Ref &conversation, CMessage:: {
SEString data;
+ CMessage::TYPE messageType;
+ message->GetPropType(messageType);
+
uint timestamp;
message->GetPropTimestamp(timestamp);
@@ -150,6 +153,9 @@ void CSkypeProto::OnMessageSended(CConversation::Ref &conversation, CMessage::Re {
SEString data;
+ CMessage::TYPE messageType;
+ message->GetPropType(messageType);
+
uint timestamp;
message->GetPropTimestamp(timestamp);
@@ -366,9 +372,6 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa switch (messageType)
{
case CMessage::POSTED_EMOTE:
- //int i = 0;
- break;
-
case CMessage::POSTED_TEXT:
{
SEString author;
@@ -485,7 +488,7 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa break;
case CMessage::STARTED_LIVESESSION:
- //conversation->LeaveLiveSession();
+ conversation->LeaveLiveSession();
uint timestamp;
message->GetPropTimestamp(timestamp);
@@ -498,15 +501,14 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa HANDLE hContact = this->AddContact(author);
- wchar_t *message = new wchar_t[14];
- ::wcscpy(message, L"Incoming call");
+ char *message = ::mir_utf8encode(Translate("Incoming call"));
this->AddDBEvent(
hContact,
SKYPE_DB_EVENT_TYPE_CALL,
timestamp,
DBEF_UTF,
- (DWORD)::wcslen(message) + 1,
+ (DWORD)::strlen(message) + 1,
(PBYTE)message);
break;
diff --git a/protocols/Skype/src/skype_hooks.cpp b/protocols/Skype/src/skype_hooks.cpp index 9fb927f1a2..6a2e9073d7 100644 --- a/protocols/Skype/src/skype_hooks.cpp +++ b/protocols/Skype/src/skype_hooks.cpp @@ -18,8 +18,13 @@ void CSkypeProto::UninitHookList() void CSkypeProto::InitInstanceHookList()
{
- this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
- this->HookEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit);
+ this->instanceHookList.insert(
+ this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit));
+ this->instanceHookList.insert(
+ this->HookEvent(ME_USERINFO_INITIALISE, &CSkypeProto::OnUserInfoInit));
+
+ this->instanceHookList.insert(
+ this->HookEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate));
}
void CSkypeProto::UninitInstanceHookList()
diff --git a/protocols/Skype/src/skype_icons.cpp b/protocols/Skype/src/skype_icons.cpp index 9a739f57ae..87294370ec 100644 --- a/protocols/Skype/src/skype_icons.cpp +++ b/protocols/Skype/src/skype_icons.cpp @@ -2,7 +2,10 @@ _tag_iconList CSkypeProto::IconList[] =
{
- { LPGENT("Protocol icon"), "main", IDI_ICON },
+ { LPGENT("Protocol icon"), "main", IDI_ICON },
+
+ { LPGENT("Call"), "call", IDI_CALL },
+ { LPGENT("Invite to conference"), "confInvite", IDI_CONF_INVITE },
{ LPGENT("Revoke authorization"), "authRevoke", IDI_AUTH_REVOKE },
{ LPGENT("Request authorization"), "authRequest", IDI_AUTH_REQUEST },
{ LPGENT("Grant authorization"), "authGrant", IDI_AUTH_GRANT },
@@ -38,7 +41,7 @@ HANDLE CSkypeProto::GetIconHandle(const char* name) {
for (size_t i = 0; i < SIZEOF(CSkypeProto::IconList); i++)
{
- if (::strcmp(CSkypeProto::IconList[i].Name, name) == 0)
+ if (::stricmp(CSkypeProto::IconList[i].Name, name) == 0)
return CSkypeProto::IconList[i].Handle;
}
return 0;
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp index 48efbfe558..565d97198f 100644 --- a/protocols/Skype/src/skype_menus.cpp +++ b/protocols/Skype/src/skype_menus.cpp @@ -188,7 +188,7 @@ void CSkypeProto::OnInitStatusMenu() mi.position = -1999901006;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.icolibItem = CSkypeProto::GetIconHandle("Skype_main");
+ mi.icolibItem = CSkypeProto::GetIconHandle("main");
hJabberRoot = m_hMenuRoot = ::Menu_AddProtoMenuItem(&mi);
}
else {
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 9b5dd72dd3..ba2caabe44 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -11,12 +11,17 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) : this->SetAllContactStatus(ID_STATUS_OFFLINE);
DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) };
- dbEventType.module = m_szModuleName;
- dbEventType.eventType = SKYPE_DB_EVENT_TYPE_CALL;
- dbEventType.descr = "Skype call";
+ dbEventType.module = this->m_szModuleName;
+ dbEventType.flags = DETF_HISTORY | DETF_MSGWINDOW;
+
+ dbEventType.eventType = SKYPE_DB_EVENT_TYPE_EMOTE;
+ dbEventType.descr = "Skype emote";
::CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
- this->HookEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnMessagePreCreate);
+ dbEventType.eventType = SKYPE_DB_EVENT_TYPE_CALL;
+ dbEventType.descr = "Skype call";
+ dbEventType.eventIcon = CSkypeProto::GetIconHandle("call");
+ ::CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
this->InitInstanceServiceList();
}
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index bb8388c669..ed9f407c0d 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -369,7 +369,7 @@ protected: void CreateServiceObjParam(const char* szService, SkypeServiceFunc serviceProc, LPARAM lParam);
HANDLE CreateEvent(const char* szService);
- void HookEvent(const char*, SkypeEventFunc);
+ HANDLE HookEvent(const char*, SkypeEventFunc);
int SendBroadcast(int type, int result, HANDLE hProcess, LPARAM lParam);
int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index 2bd14e00a5..4ad81024b3 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -278,9 +278,9 @@ HANDLE CSkypeProto::CreateEvent(const char* szService) return ::CreateHookableEvent(moduleName);
}
-void CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
+HANDLE CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler)
{
- ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
+ return ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*( void**)&handler, this);
}
void CSkypeProto::FakeAsync(void *param)
|