diff options
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 16 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 57 |
2 files changed, 33 insertions, 40 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 64cea2b2e4..1e859eaba1 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -123,7 +123,7 @@ FacebookProto::~FacebookProto() ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT) +INT_PTR FacebookProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -149,7 +149,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE: return FACEBOOK_MESSAGE_LIMIT; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR) "Facebook ID"; + return (INT_PTR) "Facebook ID"; } return 0; } @@ -390,12 +390,6 @@ INT_PTR FacebookProto::GetNotificationsCount(WPARAM, LPARAM) int FacebookProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam) { switch (event) { - case EV_PROTO_ONLOAD: - return OnModulesLoaded(wParam, lParam); - - case EV_PROTO_ONEXIT: - return OnPreShutdown(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: return OnContactDeleted(wParam, lParam); @@ -416,7 +410,7 @@ INT_PTR FacebookProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, FBAccountProc, (LPARAM)this); } -int FacebookProto::OnModulesLoaded(WPARAM, LPARAM) +void FacebookProto::OnModulesLoaded() { HookProtoEvent(ME_MSG_WINDOWEVENT, &FacebookProto::OnProcessSrmmEvent); HookProtoEvent(ME_MSG_PRECREATEEVENT, &FacebookProto::OnPreCreateEvent); @@ -427,13 +421,11 @@ int FacebookProto::OnModulesLoaded(WPARAM, LPARAM) gcr.ptszDispName = m_tszUserName; gcr.iMaxText = FACEBOOK_MESSAGE_LIMIT; Chat_Register(&gcr); - return 0; } -int FacebookProto::OnPreShutdown(WPARAM, LPARAM) +void FacebookProto::OnShutdown() { SetStatus(ID_STATUS_OFFLINE); - return 0; } int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM) diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 099d75a187..de18548415 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -100,32 +100,35 @@ public: __forceinline void setStringUtf(const char *name, const char* value) { db_set_utf(0, m_szModuleName, name, value); } __forceinline void setStringUtf(MCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } - //PROTO_INTERFACE - - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - - virtual int __cdecl Authorize(MEVENT hDbEvent); - virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason); - virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage); - - virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = 0); - virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); - - virtual HANDLE __cdecl SearchBasic(const wchar_t* id); - virtual HANDLE __cdecl SearchByEmail(const wchar_t* email); - virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName); - - virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); - - virtual int __cdecl SetStatus(int iNewStatus); - - virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); - virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg); - - virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); - - virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); + //////////////////////////////////////////////////////////////////////////////////////// + // PROTO_INTERFACE + + MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override; + + int Authorize(MEVENT hDbEvent) override; + int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override; + int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override; + + INT_PTR GetCaps(int type, MCONTACT hContact = 0) override; + int GetInfo(MCONTACT hContact, int infoType) override; + + HANDLE SearchBasic(const wchar_t* id) override; + HANDLE SearchByEmail(const wchar_t* email) override; + HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override; + + int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override; + int SendMsg(MCONTACT hContact, int flags, const char* msg) override; + + int SetStatus(int iNewStatus) override; + + HANDLE GetAwayMsg(MCONTACT hContact) override; + int SetAwayMsg(int iStatus, const wchar_t* msg) override; + + int UserIsTyping(MCONTACT hContact, int type) override; + + int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override; + void OnModulesLoaded() override; + void OnShutdown() override; //////////////////////// @@ -164,12 +167,10 @@ public: void InitMenu(); // Events - int __cdecl OnModulesLoaded(WPARAM, LPARAM); int __cdecl OnOptionsInit(WPARAM, LPARAM); int __cdecl OnToolbarInit(WPARAM, LPARAM); int __cdecl OnBuildStatusMenu(WPARAM,LPARAM); int __cdecl OnContactDeleted(WPARAM,LPARAM); - int __cdecl OnPreShutdown(WPARAM,LPARAM); int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM); int __cdecl OnIdleChanged(WPARAM,LPARAM); int __cdecl OnGCEvent(WPARAM,LPARAM); |