summaryrefslogtreecommitdiff
path: root/src/mir_core/protos.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-08 18:56:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-08 18:56:00 +0000
commitc181af64bab27eb50e684c64c0a3caa49f8bbe39 (patch)
tree2361b449d0ab242d5de0d8d432a5791c92f42301 /src/mir_core/protos.cpp
parent6dde588a8a294406cb044dd0bce1c82232285efc (diff)
protocol helpers, beginning
git-svn-id: http://svn.miranda-ng.org/main/trunk@5285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core/protos.cpp')
-rw-r--r--src/mir_core/protos.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp
index 6f2309e412..291b7a0fa4 100644
--- a/src/mir_core/protos.cpp
+++ b/src/mir_core/protos.cpp
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
#include <m_protomod.h>
+#include <m_protoint.h>
+#include <m_skin.h>
static HANDLE hAckEvent;
@@ -81,3 +83,20 @@ MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService
strncat_s(str,szService,strlen(szService));
return ServiceExists(str);
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_CORE_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, LPCSTR pszModuleName, LPCTSTR ptszUserName)
+{
+ pThis->m_iVersion = 2;
+ pThis->m_iStatus = pThis->m_iDesiredStatus = ID_STATUS_OFFLINE;
+ pThis->m_szModuleName = mir_strdup(pszModuleName);
+ pThis->m_hProtoIcon = (HANDLE)CallService("Skin2/Icons/IsManaged", (WPARAM)LoadSkinnedProtoIcon(pszModuleName, ID_STATUS_ONLINE), 0);
+ pThis->m_tszUserName = mir_tstrdup(ptszUserName);
+}
+
+MIR_CORE_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis)
+{
+ mir_free(pThis->m_szModuleName);
+ mir_free(pThis->m_tszUserName);
+}