FIRE-15416: Add "block" to the avatar name context menu in chat history using V1 chat headers

Ansariel 2015-01-23 12:48:09 +01:00
parent f4ca2dbc63
commit d6befe9028
7 changed files with 46 additions and 1 deletions

View File

@ -40,7 +40,10 @@ enum EFSRegistrarFunctionActionType
FS_RGSTR_ACT_SHOW_PROFILE,
FS_RGSTR_ACT_TRACK_AVATAR,
FS_RGSTR_ACT_TELEPORT_TO,
FS_RGSTR_ACT_REQUEST_TELEPORT
FS_RGSTR_ACT_REQUEST_TELEPORT,
FS_RGSTR_CHK_AVATAR_BLOCKED,
FS_RGSTR_CHK_IS_SELF,
FS_RGSTR_CHK_IS_NOT_SELF
};
class FSRegistrarUtils

View File

@ -1967,6 +1967,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
registrar.add("FS.RequestTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/requestteleport"));
registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/track"));
registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/addtocontactset")); // [FS:CR]
registrar.add("FS.BlockAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/blockavatar"));
// </FS:Ansariel> Additional convenience options
// <FS:Ansariel> Add enable checks for menu items
@ -1980,6 +1981,8 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
enable_registrar.add("FS.EnableTrackAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_TRACK_AVATAR));
enable_registrar.add("FS.EnableTeleportToTarget", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_TELEPORT_TO));
enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_REQUEST_TELEPORT));
enable_registrar.add("FS.CheckIsAgentBlocked", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_CHK_AVATAR_BLOCKED));
enable_registrar.add("FS.EnableBlockAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_CHK_IS_NOT_SELF));
// </FS:Ansariel>
// create the context menu from the XUI file and display it

View File

@ -2128,6 +2128,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("FS.RequestTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/requestteleport"));
registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/track"));
registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/addtocontactset")); // [FS:CR]
registrar.add("FS.BlockAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/blockavatar"));
// </FS:Ansariel>
// <FS:Ansariel> Add enable checks for menu items
@ -2142,6 +2143,8 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
enable_registrar.add("FS.EnableTrackAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_TRACK_AVATAR));
enable_registrar.add("FS.EnableTeleportToTarget", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_TELEPORT_TO));
enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_REQUEST_TELEPORT));
enable_registrar.add("FS.CheckIsAgentBlocked", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_CHK_AVATAR_BLOCKED));
enable_registrar.add("FS.EnableBlockAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_CHK_IS_NOT_SELF));
// </FS:Ansariel>
// create and return the context menu from the XUI file

View File

@ -34,6 +34,7 @@
#include "llavatarnamecache.h"
#include "llfloaterperms.h"
#include "llinventorymodel.h"
#include "llmutelist.h"
#include "llnotificationmanager.h"
#include "llnotificationsutil.h" // <FS:CR> reportToNearbyChat
#include "lltooldraganddrop.h"
@ -339,6 +340,18 @@ bool FSCommon::checkIsActionEnabled(const LLUUID& av_id, EFSRegistrarFunctionAct
{
return (!isSelf && FSRadar::getInstance()->getEntry(av_id) != NULL);
}
else if (action == FS_RGSTR_CHK_AVATAR_BLOCKED)
{
return (!isSelf && LLMuteList::getInstance()->isMuted(av_id));
}
else if (action == FS_RGSTR_CHK_IS_SELF)
{
return isSelf;
}
else if (action == FS_RGSTR_CHK_IS_NOT_SELF)
{
return !isSelf;
}
return false;
}

View File

@ -117,6 +117,15 @@ public:
return true;
}
if (verb == "blockavatar")
{
if (gAgentID != target_id)
{
LLAvatarActions::toggleBlock(target_id);
}
return true;
}
return false;
}
};

View File

@ -10,6 +10,7 @@
<menu_item_call label="Teleport anfordern" name="request_teleport"/>
<menu_item_call label="Einwohner verfolgen" name="track_agent"/>
<menu_item_call label="Freund entfernen..." name="remove_friend"/>
<menu_item_call label="Blockieren" name="Block"/>
<menu_item_call label="Name in Zwischenablage kopieren" name="url_copy_label"/>
<menu_item_call label="SLurl in die Zwischenablage kopieren" name="url_copy"/>
</context_menu>

View File

@ -93,6 +93,19 @@
<menu_item_call.on_enable
function="Url.EnableRemoveFriend" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_check
label="Block"
layout="topleft"
name="Block">
<menu_item_check.on_click
function="FS.BlockAvatar"/>
<menu_item_check.on_check
function="FS.CheckIsAgentBlocked"/>
<menu_item_check.on_enable
function="FS.EnableBlockAvatar"/>
</menu_item_check>
<menu_item_separator
layout="topleft" />
<menu_item_call