diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-12-16 13:16:42 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-12-16 13:16:42 +0000 |
commit | 2ae148d3b9040ab734642ea0bc798bede8a06dfa (patch) | |
tree | 83b34145df1307627ac3d3bb9156e17383f81687 /protocols/Skype/src/skype_subclassing.h | |
parent | a3b6e54b51ddf79756a0916740988182637c0cc0 (diff) |
- refactored message receiving
git-svn-id: http://svn.miranda-ng.org/main/trunk@2751 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_subclassing.h')
-rw-r--r-- | protocols/Skype/src/skype_subclassing.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/protocols/Skype/src/skype_subclassing.h b/protocols/Skype/src/skype_subclassing.h index 7f7b7dfd32..0840c57dc3 100644 --- a/protocols/Skype/src/skype_subclassing.h +++ b/protocols/Skype/src/skype_subclassing.h @@ -7,10 +7,20 @@ struct CSkypeProto;
+class CMessage : public Message
+{
+public:
+
+ typedef DRef<CMessage, Message> Ref;
+ typedef DRefs<CMessage, Message> Refs;
+
+ CMessage(unsigned int oid, SERootObject* root);
+};
+
class CConversation : public Conversation
{
public:
- typedef void (CSkypeProto::* OnMessageReceived)(const char *sid, const char *text);
+ typedef void (CSkypeProto::* OnMessageReceived)(CMessage::Ref message);
typedef DRef<CConversation, Conversation> Ref;
typedef DRefs<CConversation, Conversation> Refs;
@@ -115,6 +125,7 @@ private: class CSkype : public Skype
{
public:
+ typedef void (CSkypeProto::* OnMessageReceived)(CMessage::Ref message);
typedef void (CSkypeProto::* OnConversationAdded)(CConversation::Ref conversation);
CAccount* newAccount(int oid);
@@ -122,16 +133,25 @@ public: CConversation* newConversation(int oid);
CContactSearch* newContactSearch(int oid);
CContact* newContact(int oid);
+ CMessage* newMessage(int oid);
CConversation::Refs inbox;
CSkype(int num_threads = 1);
+ void SetOnMessageReceivedCallback(OnMessageReceived callback, CSkypeProto* proto);
void SetOnConversationAddedCallback(OnConversationAdded callback, CSkypeProto* proto);
private:
CSkypeProto* proto;
- OnConversationAdded callback;
+ OnMessageReceived onMessageReceivedCallback;
+ OnConversationAdded onConversationAddedCallback;
+
+ void OnMessage(
+ const MessageRef & message,
+ const bool & changesInboxTimestamp,
+ const MessageRef & supersedesHistoryMessage,
+ const ConversationRef & conversation);
void OnConversationListChange(
const ConversationRef &conversation,
|