summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_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/IcqOscarJ/src/icq_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/IcqOscarJ/src/icq_proto.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp38
1 files changed, 3 insertions, 35 deletions
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index e00ed256f2..cf2d9bf790 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -77,11 +77,8 @@ expectedFileRecvs(10, CompareFT),
contactsCache(10, CompareContactsCache),
cheekySearchId( -1 )
{
- m_iVersion = 2;
- m_iStatus = ID_STATUS_OFFLINE;
- m_tszUserName = mir_tstrdup( aUserName );
- m_szModuleName = mir_strdup( aProtoName );
- m_szProtoName = mir_strdup( aProtoName );
+ ProtoConstructor(this, aProtoName, aUserName);
+ m_szProtoName = mir_strdup(aProtoName);
_strlwr( m_szProtoName );
m_szProtoName[0] = toupper( m_szProtoName[0] );
NetLog_Server( "Setting protocol/module name to '%s/%s'", m_szProtoName, m_szModuleName );
@@ -165,8 +162,6 @@ cheekySearchId( -1 )
CreateProtoService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
CreateProtoService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
- m_hIconProtocol = (HANDLE)CallService(MS_SKIN2_ISMANAGEDICON, (WPARAM)LoadSkinnedProtoIcon(m_szModuleName, ID_STATUS_ONLINE), 0);
-
// Reset a bunch of session specific settings
UpdateGlobalSettings();
ResetSettingsOnLoad();
@@ -271,14 +266,10 @@ CIcqProto::~CIcqProto()
SAFE_FREE(&m_modeMsgs.szDnd);
SAFE_FREE(&m_modeMsgs.szFfc);
- // Remove account icons
- Skin_RemoveIconHandle(m_hIconProtocol);
-
NetLog_Server("%s: Protocol instance '%s' destroyed.", ICQ_PROTOCOL_NAME, m_szModuleName);
mir_free( m_szProtoName );
- mir_free( m_szModuleName );
- mir_free( m_tszUserName );
+ ProtoDestructor(this);
}
@@ -788,29 +779,6 @@ DWORD_PTR __cdecl CIcqProto::GetCaps( int type, HANDLE hContact )
}
////////////////////////////////////////////////////////////////////////////////////////
-// GetIcon - loads an icon for the contact list
-
-HICON __cdecl CIcqProto::GetIcon( int iconIndex )
-{
- if (LOWORD(iconIndex) == PLI_PROTOCOL)
- {
- if (iconIndex & PLIF_ICOLIBHANDLE)
- return (HICON)m_hIconProtocol;
-
- bool big = (iconIndex & PLIF_SMALL) == 0;
- HICON hIcon = Skin_GetIconByHandle(m_hIconProtocol, big);
-
- if (iconIndex & PLIF_ICOLIB)
- return hIcon;
-
- HICON hIconNew = CopyIcon(hIcon);
- Skin_ReleaseIcon(hIcon);
- return hIconNew;
- }
- return NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
int __cdecl CIcqProto::GetInfo(HANDLE hContact, int infoType)