Skip to content
Snippets Groups Projects
Commit 6bb9ec41 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

MAINT-8498 Fixed item offers not appearing after friednship offer

parent 1bdf76dd
Branches
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "llstylemap.h" #include "llstylemap.h"
#include "llslurl.h" #include "llslurl.h"
#include "lllayoutstack.h" #include "lllayoutstack.h"
#include "llnotifications.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "lltoastnotifypanel.h" #include "lltoastnotifypanel.h"
#include "lltooltip.h" #include "lltooltip.h"
...@@ -1314,25 +1315,33 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL ...@@ -1314,25 +1315,33 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// notify processing // notify processing
if (chat.mNotifId.notNull()) if (chat.mNotifId.notNull())
{
LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId);
if (notification != NULL)
{ {
bool create_toast = true; bool create_toast = true;
if (notification->getName() == "OfferFriendship")
{
// We don't want multiple friendship offers to appear, this code checks if there are previous offers
// by iterating though all panels.
// Note: it might be better to simply add a "pending offer" flag somewhere
for (LLToastNotifyPanel::instance_iter ti(LLToastNotifyPanel::beginInstances()) for (LLToastNotifyPanel::instance_iter ti(LLToastNotifyPanel::beginInstances())
, tend(LLToastNotifyPanel::endInstances()); ti != tend; ++ti) , tend(LLToastNotifyPanel::endInstances()); ti != tend; ++ti)
{ {
LLToastNotifyPanel& panel = *ti; LLToastNotifyPanel& panel = *ti;
LLIMToastNotifyPanel * imtoastp = dynamic_cast<LLIMToastNotifyPanel *>(&panel); LLIMToastNotifyPanel * imtoastp = dynamic_cast<LLIMToastNotifyPanel *>(&panel);
const std::string& notification_name = panel.getNotificationName(); const std::string& notification_name = panel.getNotificationName();
if (notification_name == "OfferFriendship" && panel.isControlPanelEnabled() && imtoastp) if (notification_name == "OfferFriendship"
&& panel.isControlPanelEnabled()
&& imtoastp)
{ {
create_toast = false; create_toast = false;
break; break;
} }
} }
}
if (create_toast) if (create_toast)
{
LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId);
if (notification != NULL)
{ {
LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel(
notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history, mEditor); notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history, mEditor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment