Deletion of the avatar looper/messagerunner in the destructor, moved a piece of code to set the status before to send the list.
This commit is contained in:
parent
0e3579b9c3
commit
5cf285f588
|
@ -186,12 +186,12 @@ MSNP::MSNP()
|
|||
fCachePath(""),
|
||||
fRunnerTime(40000000)
|
||||
{
|
||||
AvatarLooper* looper = new AvatarLooper(this);
|
||||
BMessenger* mess = new BMessenger(NULL, looper);
|
||||
AvatarLooper* fAvatarLooper = new AvatarLooper(this);
|
||||
BMessenger* mess = new BMessenger(NULL, fAvatarLooper);
|
||||
if (!mess->IsValid()) {
|
||||
printf("Avatar BMessenger error\n");
|
||||
}
|
||||
looper->Run();
|
||||
fAvatarLooper->Run();
|
||||
fAvatarRunner = new BMessageRunner(*mess, new BMessage(kAvatarCheckMessage), fRunnerTime);
|
||||
if (fAvatarRunner->InitCheck() != B_OK) {
|
||||
printf("Avatar MessageRunner error %s\n",
|
||||
|
@ -247,7 +247,8 @@ status_t
|
|||
MSNP::Shutdown()
|
||||
{
|
||||
// LogOut();
|
||||
|
||||
delete fAvatarRunner;
|
||||
delete fAvatarLooper;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
@ -920,6 +921,13 @@ void MSNP::gotOIMList(MSN::NotificationServerConnection * conn, std::vector<MSN:
|
|||
void MSNP::connectionReady(MSN::Connection * conn)
|
||||
{
|
||||
fLogged = true;
|
||||
|
||||
BMessage msg(IM_MESSAGE);
|
||||
msg.AddInt32("im_what", IM_OWN_STATUS_SET);
|
||||
msg.AddString("protocol", kProtocolSignature);
|
||||
msg.AddInt32("status", CAYA_ONLINE);
|
||||
fServerMsgr->SendMessage(&msg);
|
||||
|
||||
BMessage serverBased(IM_MESSAGE);
|
||||
serverBased.AddInt32("im_what", IM_CONTACT_LIST);
|
||||
serverBased.AddString("protocol", kProtocolSignature);
|
||||
|
@ -941,12 +949,6 @@ void MSNP::connectionReady(MSN::Connection * conn)
|
|||
}
|
||||
}
|
||||
|
||||
BMessage msg(IM_MESSAGE);
|
||||
msg.AddInt32("im_what", IM_OWN_STATUS_SET);
|
||||
msg.AddString("protocol", kProtocolSignature);
|
||||
msg.AddInt32("status", CAYA_ONLINE);
|
||||
fServerMsgr->SendMessage(&msg);
|
||||
|
||||
BString content(fUsername.c_str());
|
||||
content << " has logged in!";
|
||||
_Notify(B_INFORMATION_NOTIFICATION, "Connected",
|
||||
|
|
|
@ -95,6 +95,7 @@ private:
|
|||
unsigned int fID;
|
||||
|
||||
BMessageRunner* fAvatarRunner;
|
||||
BMessageRunner* fAvatarLooper;
|
||||
bigtime_t fRunnerTime;
|
||||
|
||||
CayaProtocolMessengerInterface* fServerMsgr;
|
||||
|
|
Ŝarĝante…
Reference in New Issue