Feature Request: Add Chat History to Group right click menus

This commit is contained in:
Liru Færs
2020-01-08 19:11:46 -05:00
parent c954d02125
commit 6ebd2eef00
4 changed files with 25 additions and 7 deletions

View File

@@ -337,12 +337,21 @@ void LLPanelAvatarFirstLife::enableControls(BOOL self)
void show_picture(const LLUUID& id, const std::string& name);
static std::string profile_picture_title(const std::string& str) { return "Profile Picture: " + str; }
static void show_partner_help() { LLNotificationsUtil::add("ClickPartnerHelpAvatar", LLSD(), LLSD(), boost::bind(LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL, _1, _2)); }
void show_log_browser(const LLUUID& id)
void show_log_browser(const LLUUID& id, const LFIDBearer::Type& type)
{
void show_log_browser(const std::string& name, const std::string& id);
LLAvatarName av_name;
LLAvatarNameCache::get(id, &av_name);
show_log_browser(av_name.getLegacyName(), id.asString());
std::string name;
if (type == LFIDBearer::AVATAR)
{
LLAvatarName av_name;
LLAvatarNameCache::get(id, &av_name);
name = av_name.getLegacyName();
}
else // GROUP
{
gCacheName->getGroupName(id, name);
}
show_log_browser(name, id.asString());
}
BOOL LLPanelAvatarSecondLife::postBuild()
{
@@ -368,7 +377,7 @@ BOOL LLPanelAvatarSecondLife::postBuild()
getChild<LLUICtrl>("GroupInvite_Button")->setCommitCallback(boost::bind(static_cast<void(*)(const LLUUID&)>(LLAvatarActions::inviteToGroup), boost::bind(&LLPanelAvatar::getAvatarID, pa)));
getChild<LLUICtrl>("Add Friend...")->setCommitCallback(boost::bind(LLAvatarActions::requestFriendshipDialog, boost::bind(&LLPanelAvatar::getAvatarID, pa)));
getChild<LLUICtrl>("Log")->setCommitCallback(boost::bind(show_log_browser, boost::bind(&LLPanelAvatar::getAvatarID, pa)));
getChild<LLUICtrl>("Log")->setCommitCallback(boost::bind(show_log_browser, boost::bind(&LLPanelAvatar::getAvatarID, pa), LFIDBearer::AVATAR));
getChild<LLUICtrl>("Pay...")->setCommitCallback(boost::bind(LLAvatarActions::pay, boost::bind(&LLPanelAvatar::getAvatarID, pa)));
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Mute"))
{

View File

@@ -9287,13 +9287,13 @@ bool can_show_web_profile()
return !gSavedSettings.getString("WebProfileURL").empty();
}
void show_log_browser(const LLUUID& id);
void show_log_browser(const LLUUID& id, const LFIDBearer::Type& type);
class ListShowLog : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
for (const LLUUID& id : LFIDBearer::getActiveSelectedIDs())
show_log_browser(id);
show_log_browser(id, LFIDBearer::getActiveType());
return true;
}
};

View File

@@ -19,6 +19,11 @@
<on_enable function="List.EnableSingleSelected"/>
<on_visible function="List.IsInGroup"/>
</menu_item_call>
<menu_item_call label="Chat History" name="Chat History">
<on_click function="List.ShowLog"/>
<on_enable function="List.EnableAnySelected"/>
<on_visible function="List.IsInGroup"/>
</menu_item_call>
<menu_item_call label="Join Group" name="join_group">
<on_click function="List.Join"/>
<on_visible function="List.NotInGroup"/>

View File

@@ -23,6 +23,10 @@
<on_click function="List.Activate"/>
<on_visible function="List.IsInGroup"/>
</menu_item_call>
<menu_item_call label="Chat History" name="Chat History">
<on_click function="List.ShowLog"/>
<on_visible function="List.IsInGroup"/>
</menu_item_call>
<menu_item_call label="Join Group" name="join_group">
<on_click function="List.Join"/>
<on_visible function="List.NotInGroup"/>