summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-23 19:43:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-23 19:43:21 +0000
commitaa387fa04aa096d163932d3f5f9711a2f146c6f0 (patch)
tree7efe5dabf5bf5b9a78f8f991522487814bfc8cb0 /protocols/Omegle/src/proto.cpp
parent139c2c1a61d9f765704a2001199c2712d6587fb4 (diff)
- 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
Diffstat (limited to 'protocols/Omegle/src/proto.cpp')
-rw-r--r--protocols/Omegle/src/proto.cpp26
1 files changed, 6 insertions, 20 deletions
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 <http://www.gnu.org/licenses/>.
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);