diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-09-26 06:27:36 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-09-26 06:27:36 +0000 |
commit | 94c575dc25f045c7083f3aa1cfdbdfac7e08bd00 (patch) | |
tree | e9762c657ede50cf7cb94a4bebc18d8abfda53cf /protocols/Skype/src/skype_proto.cpp | |
parent | 37411234c53dc0e6beb6a92ceddb4aaf128e41d8 (diff) |
default folders structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp new file mode 100644 index 0000000000..b01329ca4e --- /dev/null +++ b/protocols/Skype/src/skype_proto.cpp @@ -0,0 +1,46 @@ +#include "skype.h"
+
+CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName)
+{
+ m_iVersion = 2;
+ m_iStatus = ID_STATUS_OFFLINE;
+ m_tszUserName = mir_tstrdup(userName);
+ m_szModuleName = mir_strdup(protoName);
+ m_szProtoName = mir_strdup(protoName);
+ _strlwr(m_szProtoName);
+ m_szProtoName[0] = toupper(m_szProtoName[0]);
+
+ TCHAR name[128];
+ mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
+
+ NETLIBUSER nlu = {0};
+ nlu.cbSize = sizeof( nlu );
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.ptszDescriptiveName = name;
+ nlu.szSettingsModule = m_szModuleName;
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ this->Log("Setting protocol/module name to '%s/%s'", m_szProtoName, m_szModuleName);
+}
+
+CSkypeProto::~CSkypeProto()
+{
+ Netlib_CloseHandle(m_hNetlibUser);
+ m_hNetlibUser = NULL;
+
+ mir_free(m_szProtoName);
+ mir_free(m_szModuleName);
+ mir_free(m_tszUserName);
+}
+
+void CSkypeProto::Log( const char* fmt, ... )
+{
+ va_list va;
+ char msg[1024];
+
+ va_start(va, fmt);
+ mir_vsnprintf(msg, sizeof(msg), fmt, va);
+ va_end(va);
+
+ CallService(MS_NETLIB_LOG, ( WPARAM )m_hNetlibUser, (LPARAM)msg);
+}
\ No newline at end of file |