From 5cf285f58876f8a6c32558676e3a9b2d14b851e4 Mon Sep 17 00:00:00 2001 From: barrett Date: Tue, 20 Mar 2012 02:13:35 +0000 Subject: [PATCH] Deletion of the avatar looper/messagerunner in the destructor, moved a piece of code to set the status before to send the list. --- protocols/msn/MSN.cpp | 22 ++++++++++++---------- protocols/msn/MSN.h | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/protocols/msn/MSN.cpp b/protocols/msn/MSN.cpp index 84d3a93..d81b3c0 100644 --- a/protocols/msn/MSN.cpp +++ b/protocols/msn/MSN.cpp @@ -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::vectorSendMessage(&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", diff --git a/protocols/msn/MSN.h b/protocols/msn/MSN.h index 4a4e05f..b88be07 100644 --- a/protocols/msn/MSN.h +++ b/protocols/msn/MSN.h @@ -95,6 +95,7 @@ private: unsigned int fID; BMessageRunner* fAvatarRunner; + BMessageRunner* fAvatarLooper; bigtime_t fRunnerTime; CayaProtocolMessengerInterface* fServerMsgr;