diff options
Diffstat (limited to 'protocols/Skype/src/skypekit')
-rw-r--r-- | protocols/Skype/src/skypekit/account.cpp | 15 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/account.h | 6 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/conversation.cpp | 12 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/conversation.h | 9 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/participant.cpp | 14 | ||||
-rw-r--r-- | protocols/Skype/src/skypekit/participant.h | 9 |
6 files changed, 50 insertions, 15 deletions
diff --git a/protocols/Skype/src/skypekit/account.cpp b/protocols/Skype/src/skypekit/account.cpp index 08c37d67e2..088d747a77 100644 --- a/protocols/Skype/src/skypekit/account.cpp +++ b/protocols/Skype/src/skypekit/account.cpp @@ -2,15 +2,12 @@ CAccount::CAccount(unsigned int oid, SERootObject* root) : Account(oid, root)
{
- this->proto = NULL;
- this->callback == NULL;
+ this->ppro = NULL;
}
-void CAccount::SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto* proto)
+void CAccount::SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto *ppro)
{
- this->skype = (Skype *)root;
-
- this->proto = proto;
+ this->ppro = ppro;
this->callback = callback;
}
@@ -24,7 +21,7 @@ bool CAccount::IsOnline() bool CAccount::SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result)
{
int fbl;
- if (!this->skype->ValidateAvatar(avatar, result, fbl) || result != Skype::VALIDATED_OK)
+ if (!((Skype*)this->root)->ValidateAvatar(avatar, result, fbl) || result != Skype::VALIDATED_OK)
return false;
if (!this->SetBinProperty(Account::P_AVATAR_IMAGE, avatar))
@@ -35,6 +32,6 @@ bool CAccount::SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result) void CAccount::OnChange(int prop)
{
- if (this->proto)
- (proto->*callback)(prop);
+ if (this->ppro != NULL)
+ (ppro->*callback)(prop);
}
\ No newline at end of file diff --git a/protocols/Skype/src/skypekit/account.h b/protocols/Skype/src/skypekit/account.h index 36a78e745b..ce6151da63 100644 --- a/protocols/Skype/src/skypekit/account.h +++ b/protocols/Skype/src/skypekit/account.h @@ -15,11 +15,11 @@ public: bool IsOnline();
bool SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result);
- void SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto* proto);
+ void SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto *ppro);
private:
- Skype *skype;
- CSkypeProto* proto;
+ CSkypeProto* ppro;
OnAccountChanged callback;
+
void OnChange(int prop);
};
\ No newline at end of file diff --git a/protocols/Skype/src/skypekit/conversation.cpp b/protocols/Skype/src/skypekit/conversation.cpp index 3c56e57559..25ffbffbfe 100644 --- a/protocols/Skype/src/skypekit/conversation.cpp +++ b/protocols/Skype/src/skypekit/conversation.cpp @@ -1,3 +1,13 @@ #include "conversation.h"
-CConversation::CConversation(unsigned int oid, SERootObject* root) : Conversation(oid, root) { }
\ No newline at end of file +CConversation::CConversation(unsigned int oid, SERootObject* root) : Conversation(oid, root) { }
+
+void CConversation::SetOnConvoChangedCallback(OnConvoChanged callback)
+{
+ this->callback = callback;
+}
+
+void CConversation::OnChange(int prop)
+{
+ //(((CSkypeProto*)this->root)->*callback)(this->ref(), prop);
+}
\ No newline at end of file diff --git a/protocols/Skype/src/skypekit/conversation.h b/protocols/Skype/src/skypekit/conversation.h index 2527ced564..b9b1a51da1 100644 --- a/protocols/Skype/src/skypekit/conversation.h +++ b/protocols/Skype/src/skypekit/conversation.h @@ -5,8 +5,17 @@ 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 SetOnConvoChangedCallback(OnConvoChanged callback);
+
+private:
+ OnConvoChanged callback;
+
+ void OnChange(int prop);
};
\ No newline at end of file diff --git a/protocols/Skype/src/skypekit/participant.cpp b/protocols/Skype/src/skypekit/participant.cpp index 035003d1c9..9b35cfabb2 100644 --- a/protocols/Skype/src/skypekit/participant.cpp +++ b/protocols/Skype/src/skypekit/participant.cpp @@ -1,8 +1,18 @@ #include "participant.h"
-CParticipant::CParticipant(unsigned int oid, SERootObject* root) : Participant(oid, root) { }
+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::OnChange(int prop)
{
- int i = 0;
+ if (this->room != NULL)
+ (room->*callback)(this->ref(), prop);
}
\ No newline at end of file diff --git a/protocols/Skype/src/skypekit/participant.h b/protocols/Skype/src/skypekit/participant.h index 3d6e38b445..e6db40ca1f 100644 --- a/protocols/Skype/src/skypekit/participant.h +++ b/protocols/Skype/src/skypekit/participant.h @@ -2,14 +2,23 @@ #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);
+
private:
+ ChatRoom *room;
+ OnChanged callback;
+
void OnChange(int prop);
};
\ No newline at end of file |