49 |
|
// |
50 |
|
// Contactor.cpp |
51 |
|
|
52 |
– |
#include "conio.h" |
52 |
|
#include "Contactor.h" |
53 |
|
|
54 |
+ |
#ifdef _WIN32 |
55 |
+ |
#include "conio.h" |
56 |
+ |
#else |
57 |
+ |
#include <pwd.h> |
58 |
+ |
#include <unistd.h> |
59 |
+ |
#endif |
60 |
+ |
|
61 |
|
Contactor::Contactor() |
62 |
|
{ |
63 |
|
loadAccount(); |
77 |
|
|
78 |
|
string capability = session->capability(); |
79 |
|
|
80 |
< |
if (capability.find(" IMAP4rev1") == string::npos) |
80 |
> |
if (capability.find(" IMAP4rev1") == string::npos && |
81 |
> |
capability.find(" IMAP4REV1") == string::npos) |
82 |
|
{ |
83 |
|
cerr << program << ": Server does not have IMAP4rev1 capability\n"; |
84 |
|
|
196 |
|
account.setEmail(email); |
197 |
|
delete [] email; |
198 |
|
|
199 |
+ |
#ifdef _WIN32 |
200 |
|
cout << "Password: " << flush; |
201 |
|
|
202 |
|
string password; |
226 |
|
} |
227 |
|
} |
228 |
|
while (letter != '\r' && letter != '\n'); |
229 |
+ |
#else |
230 |
+ |
string password = getpass("Password: "); |
231 |
+ |
#endif |
232 |
|
|
233 |
|
account.setPassword(password); |
234 |
|
|
287 |
|
|
288 |
|
if (account.getPassword() == "") |
289 |
|
{ |
290 |
+ |
#ifdef _WIN32 |
291 |
|
cout << "Password: " << flush; |
292 |
|
|
293 |
|
string password; |
317 |
|
} |
318 |
|
} |
319 |
|
while (letter != '\r' && letter != '\n'); |
320 |
+ |
#else |
321 |
+ |
string password = getpass("Password: "); |
322 |
+ |
#endif |
323 |
|
|
324 |
|
account.setPassword(password); |
325 |
|
} |