From 9d6d82c4a0575d9715376511e79bd66904bea373 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 31 May 2013 21:04:14 -0400 Subject: [PATCH] GroupActions fixup. Missed a tiny spot for displaying group notifications in profile, slipped by me. --- indra/newview/llgroupactions.cpp | 20 ++++++++++++++++++-- indra/newview/llgroupactions.h | 6 ++++++ indra/newview/llviewermessage.cpp | 10 ++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 292770d12..5efe05ccc 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -38,6 +38,7 @@ #include "llimview.h" // for gIMMgr #include "llnotificationsutil.h" #include "llpanelgroup.h" +#include "llviewermessage.h" #include "groupchatlistener.h" #include "hippolimits.h" // for getMaxAgentGroups // [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0f) @@ -45,8 +46,6 @@ #include "rlvhandler.h" // [/RLVa:KB] -BOOL can_afford_transaction(S32 cost); - // // Globals // @@ -311,6 +310,23 @@ void LLGroupActions::showTab(const LLUUID& group_id, const std::string& tab_name openGroupProfile(group_id)->selectTabByName(tab_name); } +// static +void LLGroupActions::showNotice(const std::string& subj, const std::string& mes, const LLUUID& group_id, const bool& has_inventory, const std::string& item_name, LLOfferInfo* info) +{ + if (LLFloaterGroupInfo* fgi = LLFloaterGroupInfo::getInstance(group_id)) + { + fgi->mPanelGroupp->showNotice(subj, mes, has_inventory, item_name, info); + } + else + { + // We need to clean up that inventory offer. + if (info) + { + info->forceResponse(IOR_DECLINE); + } + } +} + /* Singu Note: How could this ever work with a null id, it's only used by llnotificationgrouphandler.cpp which we don't have void LLGroupActions::refresh_notices() { diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index 1700929c9..b59fbbe40 100644 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -28,6 +28,7 @@ #define LL_LLGROUPACTIONS_H class LLFloaterGroupInfo; +class LLOfferInfo; /** * Group-related actions (join, leave, new, delete, etc) @@ -63,6 +64,11 @@ public: */ static void showTab(const LLUUID& group_id, const std::string& tab_name); + /** + * Show group notice that has come in. + */ + static void showNotice(const std::string& subj, const std::string& mes, const LLUUID& group_id, const bool& has_inventory, const std::string& item_name, LLOfferInfo* info); + /** * Show group inspector floater. */ diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 324b56459..4c72b4801 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2529,6 +2529,16 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) args["MESSAGE"] = mes; LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).timestamp(timestamp)); } + + // Also send down the old path for now. + if (IM_GROUP_NOTICE_REQUESTED == dialog) + { + LLGroupActions::showNotice(subj,mes,group_id,has_inventory,item_name,info); + } + else + { + delete info; + } } break; case IM_GROUP_INVITATION: