From aa93e9ad960053939cf0e2f45abeac3d61495278 Mon Sep 17 00:00:00 2001 From: barrett Date: Tue, 20 Mar 2012 23:32:18 +0000 Subject: [PATCH] Resolved a conflict between the Yahoo protocol and MSN that was causing both protocols to do not work, removed some annoying error message notifications that are not valid with Caya. Actually, the idea is to reduce the use of pop-up window in favor of notifications. --- protocols/msn/MSN.cpp | 15 ++++----------- protocols/yahoo/Yahoo.cpp | 7 ++++++- protocols/yahoo/YahooConnection.cpp | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/protocols/msn/MSN.cpp b/protocols/msn/MSN.cpp index d81b3c0..0c300f0 100644 --- a/protocols/msn/MSN.cpp +++ b/protocols/msn/MSN.cpp @@ -307,9 +307,9 @@ MSNP::Process(BMessage* msg) if (fLogged) { fMainConnection->setState(MSN::STATUS_AVAILABLE, fClientID); } else if (fSettings) { - if (fMainConnection != NULL) { + if (fMainConnection != NULL) break; - } + if (fUsername == "") Error("Empty Username!", NULL); if (fPassword == "") @@ -333,21 +333,15 @@ MSNP::Process(BMessage* msg) } break; case CAYA_AWAY: - if (fLogged) { + if (fLogged) fMainConnection->setState(MSN::STATUS_AWAY, fClientID); - } else { - Error("MSN Protocol: You are not logged!", NULL); - } break; case CAYA_EXTENDED_AWAY: break; case CAYA_DO_NOT_DISTURB: - if (fLogged) { + if (fLogged) fMainConnection->setState(MSN::STATUS_IDLE, fClientID); - } else { - Error("MSN Protocol: You are not logged!", NULL); - } break; case CAYA_OFFLINE: @@ -397,7 +391,6 @@ MSNP::Process(BMessage* msg) nouveau = false; y = x; } else { - delete fSwitchboardList.ItemAt(x)->second; fSwitchboardList.RemoveItemAt(x); } diff --git a/protocols/yahoo/Yahoo.cpp b/protocols/yahoo/Yahoo.cpp index 33f19ba..8abab0c 100644 --- a/protocols/yahoo/Yahoo.cpp +++ b/protocols/yahoo/Yahoo.cpp @@ -415,18 +415,23 @@ Yahoo::LoggedOut() { LOG("Yahoo::LoggedOut()\n"); + /* + That portion was causing conflicts with other protocols + don't enable unless you know what you are doing. + BMessage msg(IM_MESSAGE); msg.AddInt32("im_what", IM_OWN_STATUS_SET); msg.AddString("protocol", kProtocolSignature); msg.AddInt32("status", CAYA_OFFLINE); - fServerMsgr->SendMessage(&msg); + fServerMsgr->SendMessage(&msg);*/ if (fYahoo) { YahooConnection * oldYahoo = fYahoo; fYahoo = NULL; delete oldYahoo; } + BString content(fYahooID); content << " has logged out!"; _Notify(B_INFORMATION_NOTIFICATION, "Disconnected", diff --git a/protocols/yahoo/YahooConnection.cpp b/protocols/yahoo/YahooConnection.cpp index 2c146d5..1b67762 100644 --- a/protocols/yahoo/YahooConnection.cpp +++ b/protocols/yahoo/YahooConnection.cpp @@ -71,7 +71,7 @@ void YahooConnection::SetAway(enum yahoo_status state, const char *msg) { if (fStatus == YAHOO_STATUS_OFFLINE) { - fManager->Error("Calling SetAway() when offline", NULL); +// fManager->Error("Calling SetAway() when offline", NULL); return; } yahoo_set_away(fID, state, msg, 1); @@ -100,7 +100,7 @@ void YahooConnection::Message(const char* who, const char* msg) { if (fStatus == YAHOO_STATUS_OFFLINE) { - fManager->Error( "Can't send message, not connected", who ); + fManager->Error("Can't send message, not connected", who ); return; }