diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-09-05 12:08:52 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-09-05 12:08:52 +0000 |
commit | f82091b2af907fb1d120c305da75c57b09cb0e7b (patch) | |
tree | f76f25019d39f634696021d2d391669fec633f9c /plugins/!Deprecated/Skype/src/skypekit | |
parent | 387bba529b2a8878a6c66661c09fc02622fe32ea (diff) |
SkypeKit based Skype plugin is moved to deprecated and will be deleted from Plugins folder by PluginUpdater
git-svn-id: http://svn.miranda-ng.org/main/trunk@10372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!Deprecated/Skype/src/skypekit')
17 files changed, 387 insertions, 0 deletions
diff --git a/plugins/!Deprecated/Skype/src/skypekit/account.cpp b/plugins/!Deprecated/Skype/src/skypekit/account.cpp new file mode 100644 index 0000000000..8ec02e08e8 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/account.cpp @@ -0,0 +1,32 @@ +#include "..\skype.h"
+#include "account.h"
+
+CAccount::CAccount(unsigned int oid, CSkypeProto* _ppro) :
+ Account(oid, _ppro),
+ ppro(_ppro)
+{
+}
+
+bool CAccount::IsOnline()
+{
+ CAccount::STATUS status;
+ this->GetPropStatus(status);
+ return status == CAccount::LOGGED_IN;
+}
+
+bool CAccount::SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result)
+{
+ int fbl;
+ if (!((Skype*)this->root)->ValidateAvatar(avatar, result, fbl) || result != Skype::VALIDATED_OK)
+ return false;
+
+ if (!this->SetBinProperty(Account::P_AVATAR_IMAGE, avatar))
+ return false;
+
+ return true;
+}
+
+void CAccount::OnChange(int prop)
+{
+ ppro->OnAccountChanged(prop);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/account.h b/plugins/!Deprecated/Skype/src/skypekit/account.h new file mode 100644 index 0000000000..a7128598ee --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/account.h @@ -0,0 +1,20 @@ +#pragma once
+
+#include "common.h"
+
+class CAccount : public Account
+{
+public:
+ typedef DRef<CAccount, Account> Ref;
+ typedef DRefs<CAccount, Account> Refs;
+
+ CAccount(unsigned int oid, CSkypeProto*);
+
+ bool IsOnline();
+ bool SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result);
+
+private:
+ CSkypeProto* ppro;
+
+ void OnChange(int prop);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/common.h b/plugins/!Deprecated/Skype/src/skypekit/common.h new file mode 100644 index 0000000000..de00501ba3 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/common.h @@ -0,0 +1,8 @@ +#pragma once
+
+#undef OCSP_REQUEST
+#undef OCSP_RESPONSE
+
+#include <skype-embedded_2.h>
+
+struct CSkypeProto;
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/contact.cpp b/plugins/!Deprecated/Skype/src/skypekit/contact.cpp new file mode 100644 index 0000000000..c7a1a3247d --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/contact.cpp @@ -0,0 +1,65 @@ +#include "..\skype.h"
+#include "contact.h"
+
+CContact::CContact(unsigned int oid, CSkypeProto* _ppro) :
+ Contact(oid, _ppro),
+ proto(_ppro)
+{
+}
+
+SEString CContact::GetSid()
+{
+ SEString result;
+ CContact::AVAILABILITY availability;
+ this->GetPropAvailability(availability);
+ if (availability == Contact::SKYPEOUT || availability == Contact::BLOCKED_SKYPEOUT)
+ this->GetPropPstnnumber(result);
+ else
+ this->GetPropSkypename(result);
+ return result;
+}
+
+SEString CContact::GetNick()
+{
+ SEString result;
+ CContact::AVAILABILITY availability;
+ this->GetPropAvailability(availability);
+ if (availability == CContact::SKYPEOUT)
+ this->GetPropPstnnumber(result);
+ else
+ {
+ SEString sid;
+ this->GetIdentity(sid);
+
+ this->GetPropDisplayname(result);
+ if (this->proto && this->proto->login)
+ {
+ if (sid.equals(result))
+ this->GetPropFullname(result);
+ }
+
+ if (result.size() == 0)
+ result = sid;
+ }
+ return result;
+}
+
+bool CContact::GetFullname(SEString &firstName, SEString &lastName)
+{
+ SEString fullname;
+ this->GetPropFullname(fullname);
+ int pos = fullname.find(" ");
+ if (pos != -1)
+ {
+ firstName = fullname.substr(0, pos - 1);
+ lastName = fullname.right((int)fullname.size() - pos - 1);
+ } else
+ firstName = fullname;
+
+ return true;
+}
+
+void CContact::OnChange(int prop)
+{
+ proto->OnContactChanged(this->ref(), prop);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/contact.h b/plugins/!Deprecated/Skype/src/skypekit/contact.h new file mode 100644 index 0000000000..4a79ba723d --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/contact.h @@ -0,0 +1,21 @@ +#pragma once
+
+#include "common.h"
+
+class CContact : public Contact
+{
+public:
+ typedef DRef<CContact, Contact> Ref;
+ typedef DRefs<CContact, Contact> Refs;
+
+ CContact(unsigned int oid, CSkypeProto*);
+
+ SEString GetSid();
+ SEString GetNick();
+ bool GetFullname(SEString &firstName, SEString &lastName);
+
+private:
+ CSkypeProto* proto;
+
+ void OnChange(int prop);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/conversation.cpp b/plugins/!Deprecated/Skype/src/skypekit/conversation.cpp new file mode 100644 index 0000000000..ff393c8efb --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/conversation.cpp @@ -0,0 +1,20 @@ +#include "..\skype.h"
+#include "conversation.h"
+#include "..\skype_chat.h"
+
+CConversation::CConversation(unsigned int oid, SERootObject* root) :
+ Conversation(oid, root)
+{
+ this->room = NULL;
+}
+
+void CConversation::SetChatRoom(ChatRoom *room)
+{
+ this->room = room;
+}
+
+void CConversation::OnChange(int prop)
+{
+ if (this->room != NULL)
+ this->room->OnChange(this->ref(), prop);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/conversation.h b/plugins/!Deprecated/Skype/src/skypekit/conversation.h new file mode 100644 index 0000000000..3441743328 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/conversation.h @@ -0,0 +1,23 @@ +#pragma once
+
+#include "common.h"
+
+class ChatRoom;
+
+class CConversation : public Conversation
+{
+public:
+ //typedef void (CSkypeProto::* OnConvoChanged)(const ConversationRef &conversation, int);
+
+ typedef DRef<CConversation, Conversation> Ref;
+ typedef DRefs<CConversation, Conversation> Refs;
+
+ CConversation(unsigned int oid, SERootObject* root);
+
+ void SetChatRoom(ChatRoom *room);
+
+private:
+ ChatRoom *room;
+
+ void OnChange(int prop);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/group.cpp b/plugins/!Deprecated/Skype/src/skypekit/group.cpp new file mode 100644 index 0000000000..a75c43d371 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/group.cpp @@ -0,0 +1,13 @@ +#include "..\skype.h"
+#include "group.h"
+
+CContactGroup::CContactGroup(unsigned int oid, CSkypeProto* _ppro) :
+ ContactGroup(oid, _ppro),
+ proto(_ppro)
+{
+}
+
+void CContactGroup::OnChange(const ContactRef &contact)
+{
+ proto->OnContactListChanged(contact);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/group.h b/plugins/!Deprecated/Skype/src/skypekit/group.h new file mode 100644 index 0000000000..0443d203ea --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/group.h @@ -0,0 +1,19 @@ +#pragma once
+
+#include "common.h"
+#include "contact.h"
+
+class CContactGroup : public ContactGroup
+{
+public:
+ typedef void (CSkypeProto::* OnContactListChanged)(CContact::Ref contact);
+
+ typedef DRef<CContactGroup, ContactGroup> Ref;
+ typedef DRefs<CContactGroup, ContactGroup> Refs;
+ CContactGroup(unsigned int oid, CSkypeProto*);
+
+private:
+ CSkypeProto* proto;
+
+ void OnChange(const ContactRef &contact);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/message.cpp b/plugins/!Deprecated/Skype/src/skypekit/message.cpp new file mode 100644 index 0000000000..48afa08662 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/message.cpp @@ -0,0 +1,7 @@ +#include "..\skype.h"
+#include "message.h"
+
+CMessage::CMessage(unsigned int oid, SERootObject* root) :
+ Message(oid, root)
+{
+}
diff --git a/plugins/!Deprecated/Skype/src/skypekit/message.h b/plugins/!Deprecated/Skype/src/skypekit/message.h new file mode 100644 index 0000000000..6bf1eda497 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/message.h @@ -0,0 +1,12 @@ +#pragma once
+
+#include "common.h"
+
+class CMessage : public Message
+{
+public:
+ typedef DRef<CMessage, Message> Ref;
+ typedef DRefs<CMessage, Message> Refs;
+
+ CMessage(unsigned int oid, SERootObject* root);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/participant.cpp b/plugins/!Deprecated/Skype/src/skypekit/participant.cpp new file mode 100644 index 0000000000..41e183821b --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/participant.cpp @@ -0,0 +1,27 @@ +#include "..\skype.h"
+#include "participant.h"
+#include "..\skype_chat.h"
+
+CParticipant::CParticipant(unsigned int oid, SERootObject* root) :
+ Participant(oid, root)
+{
+ this->room = NULL;
+}
+
+//void CParticipant::SetOnChangedCallback(OnChanged callback, ChatRoom *room)
+//{
+// this->room = room;
+// this->callback = callback;
+//}
+
+void CParticipant::SetChatRoom(ChatRoom *room)
+{
+ this->room = room;
+}
+
+void CParticipant::OnChange(int prop)
+{
+ if (this->room != NULL)
+ this->room->OnParticipantChanged(this->ref(), prop);
+ //(room->*callback)(this->ref(), prop);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/participant.h b/plugins/!Deprecated/Skype/src/skypekit/participant.h new file mode 100644 index 0000000000..170c14f1b7 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/participant.h @@ -0,0 +1,25 @@ +#pragma once
+
+#include "common.h"
+
+class ChatRoom;
+
+class CParticipant : public Participant
+{
+public:
+ //typedef void (ChatRoom::* OnChanged)(const ParticipantRef &participant, int);
+
+ typedef DRef<CParticipant, Participant> Ref;
+ typedef DRefs<CParticipant, Participant> Refs;
+
+ CParticipant(unsigned int oid, SERootObject* root);
+
+ //void SetOnChangedCallback(OnChanged callback, ChatRoom *room);
+ void SetChatRoom(ChatRoom *room);
+
+private:
+ ChatRoom *room;
+ //OnChanged callback;
+
+ void OnChange(int prop);
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/search.cpp b/plugins/!Deprecated/Skype/src/skypekit/search.cpp new file mode 100644 index 0000000000..f1b20563aa --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/search.cpp @@ -0,0 +1,36 @@ +#include "..\skype.h"
+#include "search.h"
+
+CContactSearch::CContactSearch(unsigned int oid, CSkypeProto* _ppro) :
+ ContactSearch(oid, _ppro),
+ proto(_ppro)
+{
+}
+
+void CContactSearch::OnChange(int prop)
+{
+ if (prop == P_CONTACT_SEARCH_STATUS)
+ {
+ CContactSearch::STATUS status;
+ this->GetPropContactSearchStatus(status);
+ if (status == FINISHED || status == FAILED)
+ {
+ this->isSeachFinished = true;
+ if (this->proto)
+ proto->OnSearchCompleted(this->hSearch);
+ }
+ }
+}
+
+void CContactSearch::OnNewResult(const ContactRef &contact, const uint &rankValue)
+{
+ proto->OnContactFinded(contact, this->hSearch);
+}
+
+void CContactSearch::BlockWhileSearch()
+{
+ this->isSeachFinished = false;
+ this->isSeachFailed = false;
+ while (!this->isSeachFinished && !this->isSeachFailed)
+ Sleep(1);
+}
diff --git a/plugins/!Deprecated/Skype/src/skypekit/search.h b/plugins/!Deprecated/Skype/src/skypekit/search.h new file mode 100644 index 0000000000..dde9a043e3 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/search.h @@ -0,0 +1,29 @@ +#pragma once
+
+#include "common.h"
+#include "contact.h"
+
+class CContactSearch : public ContactSearch
+{
+public:
+ typedef DRef<CContactSearch, ContactSearch> Ref;
+ typedef DRefs<CContactSearch, ContactSearch> Refs;
+
+ bool isSeachFinished;
+ bool isSeachFailed;
+
+ CContactSearch(unsigned int oid, CSkypeProto* _ppro);
+
+ void OnChange(int prop);
+ void OnNewResult(const ContactRef &contact, const uint &rankValue);
+
+ __forceinline void SetProtoInfo(HANDLE _hSearch) {
+ hSearch = _hSearch;
+ }
+
+ void BlockWhileSearch();
+
+private:
+ HANDLE hSearch;
+ CSkypeProto* proto;
+};
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/transfer.cpp b/plugins/!Deprecated/Skype/src/skypekit/transfer.cpp new file mode 100644 index 0000000000..60a41bdcfe --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/transfer.cpp @@ -0,0 +1,13 @@ +#include "..\skype.h"
+#include "transfer.h"
+
+CTransfer::CTransfer(unsigned int oid, CSkypeProto* _ppro) :
+ Transfer(oid, _ppro),
+ proto(_ppro)
+{
+}
+
+void CTransfer::OnChange(int prop)
+{
+ proto->OnTransferChanged(this->ref(), prop);
+}
\ No newline at end of file diff --git a/plugins/!Deprecated/Skype/src/skypekit/transfer.h b/plugins/!Deprecated/Skype/src/skypekit/transfer.h new file mode 100644 index 0000000000..f01d48d328 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/skypekit/transfer.h @@ -0,0 +1,17 @@ +#pragma once
+
+#include "common.h"
+
+class CTransfer : public Transfer
+{
+public:
+ typedef DRef<CTransfer, Transfer> Ref;
+ typedef DRefs<CTransfer, Transfer> Refs;
+
+ CTransfer(unsigned int oid, CSkypeProto*);
+
+private:
+ CSkypeProto* proto;
+
+ void OnChange(int prop);
+};
\ No newline at end of file |