diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
commit | 81ce57622c3166830b23eae534dacc6b008c659d (patch) | |
tree | 6d6ac74667f733a20b94fa27cc01c2f45688c533 /protocols/SkypeWeb/src/skype_proto.h | |
parent | c2bb7727483b9b5620e8cc0ce6adae35ee78d0a4 (diff) |
common protocol instance management code went into template
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.h')
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 5bdd124995..3584fde7c4 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -55,10 +55,6 @@ public: virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
- // accounts
- static CSkypeProto* InitAccount(const char *protoName, const wchar_t *userName);
- static int UninitAccount(CSkypeProto *proto);
-
// icons
static void InitIcons();
@@ -123,11 +119,6 @@ private: static UINT_PTR m_timer;
- //---Accounts
- static LIST<CSkypeProto> CSkypeProto::Accounts;
- static int CompareAccounts(const CSkypeProto *p1, const CSkypeProto *p2);
- //---/
-
RequestQueue *requestQueue;
bool m_bHistorySynced;
@@ -165,7 +156,6 @@ private: EventHandle m_hTrouterHealthEvent;
- static CSkypeProto* GetContactAccount(MCONTACT hContact);
int __cdecl OnAccountLoaded(WPARAM, LPARAM);
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
@@ -427,9 +417,16 @@ private: template<INT_PTR(__cdecl CSkypeProto::*Service)(WPARAM, LPARAM)>
static INT_PTR __cdecl GlobalService(WPARAM wParam, LPARAM lParam)
{
- CSkypeProto *proto = GetContactAccount((MCONTACT)wParam);
+ CSkypeProto *proto = CMPlugin::getInstance((MCONTACT)wParam);
return proto ? (proto->*Service)(wParam, lParam) : 0;
}
};
+struct CMPlugin : public ACCPROTOPLUGIN<CSkypeProto>
+{
+ CMPlugin() :
+ ACCPROTOPLUGIN<CSkypeProto>("SKYPE")
+ {}
+};
+
#endif //_SKYPE_PROTO_H_
\ No newline at end of file |