summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_subclassing.cpp
diff options
context:
space:
mode:
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