summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_subclassing.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-10-07 13:47:03 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-10-07 13:47:03 +0000
commit8aded02eb09d418873002ea6d3e41d4d700e7e07 (patch)
treea1c9e40687203ea16c271481b6e3e8459bf0eb09 /protocols/Skype/src/skype_subclassing.cpp
parent9eff79c4337785d0f2efee63bc3121b3955d161e (diff)
- added first approach of contfct adding/deleting
git-svn-id: http://svn.miranda-ng.org/main/trunk@1801 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_subclassing.cpp')
-rw-r--r--protocols/Skype/src/skype_subclassing.cpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype_subclassing.cpp b/protocols/Skype/src/skype_subclassing.cpp
index bb943a708e..c7752eeca9 100644
--- a/protocols/Skype/src/skype_subclassing.cpp
+++ b/protocols/Skype/src/skype_subclassing.cpp
@@ -1,5 +1,7 @@
#include "skype_subclassing.h"
+// CSkype
+
CAccount* CSkype::newAccount(int oid)
{
return new CAccount(oid, this);
@@ -15,6 +17,13 @@ CContact* CSkype::newContact(int oid)
return new CContact(oid, this);
}
+CConversation* CSkype::newConversation(int oid)
+{
+ return new CConversation(oid, this);
+}
+
+// CAccount
+
CAccount::CAccount(unsigned int oid, SERootObject* root) : Account(oid, root)
{
this->isLoggedOut = true;
@@ -55,14 +64,32 @@ void CAccount::BlockWhileLoggingOut()
Sleep(1);
}
+// CContactGroup
+
CContactGroup::CContactGroup(unsigned int oid, SERootObject* root) : ContactGroup(oid, root)
{
+ this->proto = NULL;
+ this->callback == NULL;
+}
+
+void CContactGroup::SetOnContactListChangedCallback(OnContactListChanged callback, CSkypeProto* proto)
+{
+ this->proto = proto;
+ this->callback = callback;
+}
+
+bool CContactGroup::Contains(const ContactRef& contact)
+{
+ return this->ContactList.contains(contact);
}
void CContactGroup::OnChange(const ContactRef& contact)
{
+ if (this->proto)
+ (proto->*callback)(contact);
}
+// CContact
CContact::CContact(unsigned int oid, SERootObject* root) : Contact(oid, root)
{
@@ -70,7 +97,7 @@ CContact::CContact(unsigned int oid, SERootObject* root) : Contact(oid, root)
this->callback == NULL;
}
-void CContact::SetOnContactChangeCallback(OnContactChangeFunc callback, CSkypeProto* proto)
+void CContact::SetOnContactChangedCallback(OnContactChanged callback, CSkypeProto* proto)
{
this->proto = proto;
this->callback = callback;
@@ -78,6 +105,15 @@ void CContact::SetOnContactChangeCallback(OnContactChangeFunc callback, CSkypePr
void CContact::OnChange(int prop)
{
- if (this->callback && this->proto)
- (proto->*callback)(this, prop);
+ if (this->proto)
+ (proto->*callback)(this->ref(), prop);
+}
+
+// Conversation
+
+CConversation::CConversation(unsigned int oid, SERootObject* root) : Conversation(oid, root) {}
+
+void CConversation::OnMessage(const MessageRef & message)
+{
+ // Message handling goes here
} \ No newline at end of file