diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 70213680f326ba51d05bf46ff766067b39978add..57109c6763c04c6386eab79e62e9f76f4a167d91 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -385,6 +385,7 @@ void LLFloaterNotificationsTabbed::onStoreToast(LLPanel* info_panel, LLUUID id) LLNotificationPtr notify = mChannel->getToastByNotificationID(id)->getNotification(); LLSD payload = notify->getPayload(); p.notification_name = notify->getName(); + p.transaction_id = payload["transaction_id"]; p.group_id = payload["group_id"]; p.fee = payload["fee"]; p.subject = payload["subject"].asString(); diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index 8e7671897d874fb96b84ac9c9c2a8128c876324e..23a2399ed346af29285e1e6c7f800381cda93ab9 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -30,13 +30,14 @@ #include "llnotificationlistitem.h" #include "llagent.h" +#include "llgroupactions.h" #include "llinventoryicon.h" #include "llwindow.h" #include "v4color.h" #include "lltrans.h" #include "lluicolortable.h" #include "message.h" - +#include "llnotificationsutil.h" LLNotificationListItem::LLNotificationListItem(const Params& p) : LLPanel(p), mParams(p), mTitleBox(NULL), @@ -224,9 +225,70 @@ BOOL LLGroupInviteNotificationListItem::postBuild() { BOOL rv = LLGroupNotificationListItem::postBuild(); setFee(mParams.fee); + mInviteButtonPanel = getChild<LLPanel>("button_panel"); + mInviteButtonPanel->setVisible(TRUE); + mJoinBtn = getChild<LLButton>("join_btn"); + mDeclineBtn = getChild<LLButton>("decline_btn"); + mInfoBtn = getChild<LLButton>("info_btn"); + + mJoinBtn->setClickedCallback(boost::bind(&LLGroupInviteNotificationListItem::onClickJoinBtn,this)); + mDeclineBtn->setClickedCallback(boost::bind(&LLGroupInviteNotificationListItem::onClickDeclineBtn,this)); + mInfoBtn->setClickedCallback(boost::bind(&LLGroupInviteNotificationListItem::onClickInfoBtn,this)); + + std::string expanded_height_resize_str = getString("expanded_height_resize_for_attachment"); + mExpandedHeightResize = (S32)atoi(expanded_height_resize_str.c_str()); + return rv; } +void LLGroupInviteNotificationListItem::onClickJoinBtn() +{ + if (!gAgent.canJoinGroups()) + { + LLNotificationsUtil::add("JoinedTooManyGroups"); + return; + } + + if(mParams.fee > 0) + { + LLSD args; + args["COST"] = llformat("%d", mParams.fee); + // Set the fee for next time to 0, so that we don't keep + // asking about a fee. + LLSD next_payload; + next_payload["group_id"]= mParams.group_id; + next_payload["transaction_id"]= mParams.transaction_id; + next_payload["fee"] = 0; + LLNotificationsUtil::add("JoinGroupCanAfford", args, next_payload); + } + else + { + send_improved_im(mParams.group_id, + std::string("name"), + std::string("message"), + IM_ONLINE, + IM_GROUP_INVITATION_ACCEPT, + mParams.transaction_id); + } + LLNotificationListItem::onClickCloseBtn(); +} + +void LLGroupInviteNotificationListItem::onClickDeclineBtn() +{ + send_improved_im(mParams.group_id, + std::string("name"), + std::string("message"), + IM_ONLINE, + IM_GROUP_INVITATION_DECLINE, + mParams.transaction_id); + LLNotificationListItem::onClickCloseBtn(); +} + +void LLGroupInviteNotificationListItem::onClickInfoBtn() +{ + LLGroupActions::show(mParams.group_id); +} + void LLGroupInviteNotificationListItem::setFee(S32 fee) { LLStringUtil::format_map_t string_args; diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index f8d9fc03306aa4d216cb1a5df3be3a2c647559e2..6801e773422f7adf9e8b3d03e01262b44d665db0 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -46,6 +46,7 @@ class LLNotificationListItem : public LLPanel struct Params : public LLInitParam::Block<Params, LLPanel::Params> { LLUUID notification_id; + LLUUID transaction_id; LLUUID group_id; LLUUID paid_from_id; LLUUID paid_to_id; @@ -160,6 +161,15 @@ class LLGroupInviteNotificationListItem LLGroupInviteNotificationListItem & operator=(LLGroupInviteNotificationListItem &); void setFee(S32 fee); + + void onClickJoinBtn(); + void onClickDeclineBtn(); + void onClickInfoBtn(); + + LLPanel* mInviteButtonPanel; + LLButton* mJoinBtn; + LLButton* mDeclineBtn; + LLButton* mInfoBtn; }; class LLGroupNoticeNotificationListItem diff --git a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml index 3dbe11387a6741933ad0b97ec089b037ac0b76f6..6af0115a07e9012af20d43d791d9c3e5462fe581 100644 --- a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml @@ -123,10 +123,15 @@ Attachment goes here b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a b l a bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla. bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla . </text> </panel> + <panel border="false" left="0" bottom="-4" height="30" bevel_style="none" follows="left|right|bottom" layout="topleft" name="button_panel" visible="false"> + <button top="2" left="0" width="65" height="23" layout="topleft" follows="left|top|bottom" name="join_btn" mouse_opaque="true" tab_stop="false" label = "Join"/> + <button top="2" left_pad="12" width="65" height="23" layout="topleft" follows="left|top|bottom" name="decline_btn" mouse_opaque="true" tab_stop="false" label = "Decline"/> + <button top="2" left_pad="12" width="65" height="23" layout="topleft" follows="left|top|bottom" name="info_btn" mouse_opaque="true" tab_stop="false" label = "Info"/> + </panel> </layout_panel> </layout_stack> - </panel> - </layout_panel> + </panel> + </layout_panel> <layout_panel width="18" orientation="horizontal" follows="right|top|bottom" name="layout_panel_left_exp"> <panel top="0" left="0" width="17" follows="left|top|right|bottom" layout="topleft" name="close_expand_panel_exp"> <button top="0" left="2" width="17" height="17" layout="topleft" follows="top" name="close_expanded_btn" mouse_opaque="true"