From aa387fa04aa096d163932d3f5f9711a2f146c6f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 Feb 2013 19:43:21 +0000 Subject: - PROTO_INTERFACE::GetIcon removed and replaced with the standard implementation; - PS_LOADICON also replaced with the standard function; - ProtoConstructor() & ProtoDestructor() macroses are introduced to simplify protocols' code; - GetIcon() method implementation removed from all protocols git-svn-id: http://svn.miranda-ng.org/main/trunk@3739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Omegle/src/proto.cpp | 26 ++++++-------------------- protocols/Omegle/src/proto.h | 1 - 2 files changed, 6 insertions(+), 21 deletions(-) (limited to 'protocols/Omegle/src') diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index c58d431a4c..2a28589e61 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -24,10 +24,8 @@ along with this program. If not, see . OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) { - m_iVersion = 2; + ProtoConstructor(this, aProtoName, aUserName); m_szProtoName = mir_strdup( proto_name ); - m_szModuleName = mir_strdup( proto_name ); - m_tszUserName = mir_tstrdup( username ); this->facy.parent = this; @@ -41,7 +39,7 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) CreateProtoService(m_szModuleName, PS_LEAVECHAT, &OmegleProto::OnLeaveChat, this); CreateProtoService(m_szModuleName, PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI, this); - + HookProtoEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit, this); HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent, this); @@ -83,9 +81,8 @@ OmegleProto::~OmegleProto( ) mir_free( this->facy.nick_ ); - mir_free( m_tszUserName ); - mir_free( m_szModuleName ); - mir_free( m_szProtoName ); + mir_free( m_szProtoName ); + ProtoDestructor(this); } ////////////////////////////////////////////////////////////////////////////// @@ -110,17 +107,6 @@ DWORD_PTR OmegleProto::GetCaps( int type, HANDLE hContact ) return 0; } -HICON OmegleProto::GetIcon(int index) -{ - if(LOWORD(index) == PLI_PROTOCOL) - { - HICON ico = Skin_GetIcon("Omegle_omegle"); - return CopyIcon(ico); - } else { - return 0; - } -} - ////////////////////////////////////////////////////////////////////////////// int OmegleProto::SetStatus( int new_status ) @@ -146,7 +132,7 @@ int OmegleProto::SetStatus( int new_status ) if ( m_iStatus == ID_STATUS_CONNECTING && new_status != ID_STATUS_OFFLINE ) { - return 0; + return 0; } if ( new_status == ID_STATUS_OFFLINE ) @@ -171,7 +157,7 @@ int OmegleProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam) case EV_PROTO_ONEXIT: return OnPreShutdown (wParam,lParam); - + case EV_PROTO_ONOPTIONS: return OnOptionsInit (wParam,lParam); diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index 053071aac8..3f1703c70b 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -60,7 +60,6 @@ public: virtual int __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename ); virtual DWORD_PTR __cdecl GetCaps( int type, HANDLE hContact = NULL ); - virtual HICON __cdecl GetIcon( int iconIndex ); virtual int __cdecl GetInfo( HANDLE hContact, int infoType ); virtual HANDLE __cdecl SearchBasic( const PROTOCHAR* id ); -- cgit v1.2.3