12 |
|
|
13 |
|
Collector::Collector(const ext::String& login, ext::String& password, const |
14 |
|
std::set<Buddy>& buddies, bool start) : login(login), password(password), |
15 |
< |
start(start) |
15 |
> |
start(start), prompted(false) |
16 |
|
{ |
17 |
|
if (start) |
18 |
|
{ |
22 |
|
} |
23 |
|
} |
24 |
|
|
25 |
– |
net::Oscar::BuddyTool* Collector::buddy(NULL); |
26 |
– |
net::Oscar::IcbmTool* Collector::icbm(NULL); |
27 |
– |
|
25 |
|
int Collector::collect(const std::set<Buddy>& buddies) |
26 |
|
{ |
27 |
|
cerr << "Collector::collect()\n"; |
35 |
|
|
36 |
|
auth.Login(login, password); |
37 |
|
|
38 |
< |
Collector::buddy = &buddy; |
42 |
< |
Collector::icbm = &icbm; |
38 |
> |
if (prompted) password.Clear(); |
39 |
|
|
40 |
< |
icbm.OnIncomingIcbm += &Collector::reply; |
40 |
> |
this->buddy = &buddy; |
41 |
> |
this->icbm = &icbm; |
42 |
|
|
43 |
< |
// for (size_t index(password.GetSize()); index > 0; --index) password[index - |
44 |
< |
// 1] = '\0'; |
43 |
> |
// buddy.OnOnline += etl::Bind<0>(&Collector::status, this); |
44 |
> |
icbm.OnReceive += etl::Bind<0>(&Collector::reply, this); |
45 |
|
|
46 |
|
net::Oscar::StringSet buddies_; |
47 |
|
|
63 |
|
|
64 |
|
void Collector::prompt() |
65 |
|
{ |
66 |
+ |
if (!prompted) prompted = true; |
67 |
+ |
|
68 |
|
ext::String prompt(login + "'s AIM Password: "); |
69 |
|
char* password(getpass(prompt.NullTerminate())); |
70 |
|
|