1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
#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);
}
void CSkypeProto::CreateProtoService(const char *szService, ServiceFunc serviceProc)
{
char str[ MAXMODULELABELLENGTH ];
strcpy( str, m_szModuleName );
strcat( str, szService );
::CreateServiceFunctionObj( str, ( MIRANDASERVICEOBJ )*( void** )&serviceProc, this );
}
HANDLE CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
return NULL/*hContact*/;
}
HANDLE CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
{
return NULL;
}
int CSkypeProto::Authorize(HANDLE hDbEvent)
{
return NULL;
}
int CSkypeProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason)
{
return NULL;
}
int CSkypeProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
{
return NULL;
}
int CSkypeProto::AuthRequest(HANDLE hContact, const TCHAR *lptszMessage)
{
return NULL;
}
HANDLE CSkypeProto::ChangeInfo(int type, void *info_data)
{
return NULL;
}
HANDLE CSkypeProto::FileAllow(HANDLE hContact, HANDLE hTransfer, const TCHAR *szPath)
{
return NULL;
}
int CSkypeProto::FileCancel(HANDLE hContact, HANDLE hTransfer)
{
return NULL;
}
int CSkypeProto::FileDeny(HANDLE hContact, HANDLE hTransfer, const TCHAR*)
{
return NULL;
}
int CSkypeProto::FileResume(HANDLE, int*, const TCHAR**)
{
return 1;
}
DWORD_PTR CSkypeProto::GetCaps(int type, HANDLE hContact)
{
return NULL;
}
HICON CSkypeProto::GetIcon(int iconIndex)
{
return NULL;
}
int CSkypeProto::GetInfo(HANDLE hContact, int infoType)
{
return NULL;
}
HANDLE CSkypeProto::SearchBasic(const TCHAR *id)
{
return NULL;
}
HANDLE CSkypeProto::SearchByEmail(const TCHAR *email)
{
return NULL;
}
HANDLE CSkypeProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, const TCHAR *pszLastName)
{
return NULL;
}
HWND CSkypeProto::SearchAdvanced(HWND hWndDlg)
{
return NULL;
}
HWND CSkypeProto::CreateExtendedSearchUI(HWND owner)
{
return NULL;
}
int CSkypeProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
{
return NULL;
}
int CSkypeProto::RecvFile(HANDLE hContact, PROTORECVFILET *pre)
{
return NULL;
}
int CSkypeProto::RecvMsg(HANDLE hContact, PROTORECVEVENT *pre)
{
return NULL;
}
int CSkypeProto::RecvUrl(HANDLE, PROTORECVEVENT*)
{
return 1;
}
int CSkypeProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
{
return NULL;
}
HANDLE CSkypeProto::SendFile(HANDLE hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
{
return NULL;
}
int CSkypeProto::SendMsg(HANDLE hContact, int flags, const char *lpszMessage)
{
return NULL;
}
int CSkypeProto::SendUrl(HANDLE, int, const char*)
{
return 1;
}
int CSkypeProto::SetApparentMode(HANDLE hContact, int mode)
{
return NULL;
}
int CSkypeProto::SetStatus(int iNewStatus)
{
return NULL;
}
HANDLE CSkypeProto::GetAwayMsg(HANDLE hContact)
{
return NULL;
}
int CSkypeProto::RecvAwayMsg(HANDLE, int, PROTORECVEVENT*)
{
return 1;
}
int CSkypeProto::SendAwayMsg(HANDLE, HANDLE, const char* )
{
return 1;
}
int CSkypeProto::SetAwayMsg(int m_iStatus, const TCHAR* msg)
{
return NULL;
}
int CSkypeProto::UserIsTyping(HANDLE hContact, int type)
{
return NULL;
}
int CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
return NULL;
}
|