Update and Sync Mutelist with upstream alchemy

Satisfies the feature request for mute toggle to display mute status
Adds dynamic mute/unmute option to P2P IM dropdown.

Translators should look into the changes made in this commit for:
floater_chat_history.xml, floater_instant_message.xml, floater_instant_message_concisebuttons.xml
panel_avatar.xml has been taken care of for spanish and french, although they should be looked into more closely by the translators.

Cleanup and Sync in related places~
Removal of old static callbacks.
Moves God Names logic into LFSimFeatureHandler
Adds a custom function LLMuteList::hasMute() for quickly checking if a mute is in the internal set.
This commit is contained in:
Inusaito Sayori
2014-12-16 19:42:27 -05:00
parent 0e48a2196f
commit cc32df6fd8
17 changed files with 173 additions and 338 deletions

View File

@@ -952,10 +952,8 @@ P(regionResponder);
P(remoteParcelRequestResponder);
P(requestAgentUpdateAppearance);
P(responderIgnore);
P(sessionInviteResponder);
P(setDisplayNameResponder);
P2(simulatorFeaturesReceived, transfer_22s_connect_10s);
P(startConferenceChatResponder);
P2(startGroupVoteResponder, transfer_300s);
P(translationReceiver);
P(uploadModelPremissionsResponder);

View File

@@ -21,6 +21,7 @@
#include "llagent.h"
#include "llviewerregion.h"
#include "llmutelist.h"
#include "hippogridmanager.h"
LFSimFeatureHandler::LFSimFeatureHandler()
@@ -33,6 +34,7 @@ LFSimFeatureHandler::LFSimFeatureHandler()
{
if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features
gAgent.addRegionChangedCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this));
LLMuteList::instance().mGodLastNames.insert("Linden");
}
ExportPolicy LFSimFeatureHandler::exportPolicy() const
@@ -108,5 +110,33 @@ void LFSimFeatureHandler::setSupportedFeatures()
mShoutRange.reset();
mWhisperRange.reset();
}
LLMuteList& mute_list(LLMuteList::instance());
mute_list.mGodLastNames.clear();
mute_list.mGodFullNames.clear();
if (info.has("god_names"))
{
const LLSD& god_names(info["god_names"]);
if (god_names.has("last_names"))
{
const LLSD& last_names(god_names["last_names"]);
for (LLSD::array_const_iterator it = last_names.beginArray(); it != last_names.endArray(); ++it)
mute_list.mGodLastNames.insert((*it).asString());
}
if (god_names.has("full_names"))
{
const LLSD& full_names(god_names["full_names"]);
for (LLSD::array_const_iterator it = full_names.beginArray(); it != full_names.endArray(); ++it)
mute_list.mGodFullNames.insert((*it).asString());
}
}
else
{
mute_list.mGodLastNames.insert("Linden");
}
}
}

View File

@@ -75,6 +75,7 @@
//
LLColor4 agent_chat_color(const LLUUID& id, const std::string&, bool local_chat = true);
LLColor4 get_text_color(const LLChat& chat, bool from_im = false);
void show_log_browser(const std::string&, const std::string&);
//
// Member Functions
@@ -89,12 +90,10 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed)
// do not automatically open singleton floaters (as result of getInstance())
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chat_history.xml", &getFactoryMap(), /*no_open =*/false);
childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes
//childSetCommitCallback("translate chat",onClickToggleTranslateChat,this);
//childSetValue("translate chat", gSavedSettings.getBOOL("TranslateChat"));
childSetVisible("Chat History Editor with mute",FALSE);
childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
childSetAction("chat_history_open", onClickChatHistoryOpen, this);
LLTextEditor* history_editor_with_mute = getChild<LLTextEditor>("Chat History Editor with mute");
getChild<LLUICtrl>("show mutes")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleShowMute, this, _2, getChild<LLTextEditor>("Chat History Editor"), history_editor_with_mute));
history_editor_with_mute->setVisible(false);
getChild<LLUICtrl>("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", "chat"));
}
LLFloaterChat::~LLFloaterChat()
@@ -104,16 +103,7 @@ LLFloaterChat::~LLFloaterChat()
void LLFloaterChat::draw()
{
// enable say and shout only when text available
mToggleActiveSpeakersBtn->setValue(mPanel->getVisible());
LLChatBar* chat_barp = mChatPanel;
if (chat_barp)
{
chat_barp->refresh();
}
mChatPanel->refresh();
mPanel->refreshSpeakers();
LLFloater::draw();
}
@@ -122,22 +112,12 @@ BOOL LLFloaterChat::postBuild()
{
mPanel = getChild<LLParticipantList>("active_speakers_panel");
LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE);
if (chat_barp)
{
chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture"));
}
mToggleActiveSpeakersBtn.connect(this,"toggle_active_speakers_btn");
getChild<LLUICtrl>("toggle_active_speakers_btn")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleActiveSpeakers, this, _2));
mChatPanel.connect(this,"chat_panel");
mChatPanel->setGestureCombo(getChild<LLComboBox>( "Gesture"));
return TRUE;
}
void LLFloaterChat::onOpen()
{
gSavedSettings.setBOOL("ShowChatHistory", true);
}
// public virtual
void LLFloaterChat::onClose(bool app_quitting)
{
@@ -169,8 +149,7 @@ void LLFloaterChat::onFocusReceived()
if (getVisible() && chat_editor->getVisible())
{
gFocusMgr.setKeyboardFocus(chat_editor);
chat_editor->setFocus(TRUE);
chat_editor->setFocus(true);
}
LLFloater::onFocusReceived();
@@ -213,10 +192,15 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str());
}
if(chat.mSourceType == CHAT_SOURCE_OBJECT && !chat.mFromName.length())
if(chat.mSourceType == CHAT_SOURCE_OBJECT)
{
chat.mFromName = LLTrans::getString("Unnamed");
line = chat.mFromName + line;
LLStringUtil::trim(chat.mFromName);
if (!chat.mFromName.length())
{
chat.mFromName = LLTrans::getString("Unnamed");
line = chat.mFromName + line;
}
llassert_always(!chat.mURL.empty());
}
static const LLCachedControl<bool> italicize("LiruItalicizeActions");
@@ -227,7 +211,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
{
std::string start_line = line.substr(0, chat.mFromName.length() + 1);
line = line.substr(chat.mFromName.length() + 1);
LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL);
LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL);
sourceStyle->mItalic = is_irc;
edit->appendStyledText(start_line, false, prepend_newline, sourceStyle);
prepend_newline = false;
@@ -240,13 +224,13 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&
void log_chat_text(const LLChat& chat)
{
std::string histstr;
if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp"))
histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText;
else
histstr = chat.mText;
std::string histstr;
if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp"))
histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText;
else
histstr = chat.mText;
LLLogChat::saveHistory(std::string("chat"),histstr);
LLLogChat::saveHistory(std::string("chat"), histstr);
}
// static
void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
@@ -275,7 +259,7 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
}
// [/RLVa:KB]
if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file)
if (gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file)
{
log_chat_text(chat);
}
@@ -298,8 +282,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
// could flash the chat button in the status bar here. JC
LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD());
LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");
LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");
LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
history_editor->setParseHTML(TRUE);
history_editor_with_mute->setParseHTML(TRUE);
@@ -347,72 +331,12 @@ void LLFloaterChat::setHistoryCursorAndScrollToEnd()
}
//static
void LLFloaterChat::onClickMute(void *data)
{
LLFloaterChat* self = (LLFloaterChat*)data;
LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox");
const std::string& name = chatter_combo->getSimple();
LLUUID id = chatter_combo->getCurrentID();
if (name.empty()) return;
LLMute mute(id);
mute.setFromDisplayName(name);
LLMuteList::getInstance()->add(mute);
LLFloaterMute::showInstance();
}
//static
void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data)
void LLFloaterChat::onClickToggleShowMute(bool show_mute, LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute)
{
LLFloaterChat* floater = (LLFloaterChat*)data;
//LLCheckBoxCtrl*
BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get();
LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor");
LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
if (!history_editor || !history_editor_with_mute)
return;
//BOOL show_mute = floater->mShowMuteCheckBox->get();
if (show_mute)
{
history_editor->setVisible(FALSE);
history_editor_with_mute->setVisible(TRUE);
history_editor_with_mute->setCursorAndScrollToEnd();
}
else
{
history_editor->setVisible(TRUE);
history_editor_with_mute->setVisible(FALSE);
history_editor->setCursorAndScrollToEnd();
}
}
// Update the "TranslateChat" pref after "translate chat" checkbox is toggled in
// the "Local Chat" floater.
//static
void LLFloaterChat::onClickToggleTranslateChat(LLUICtrl* caller, void *data)
{
LLFloaterChat* floater = (LLFloaterChat*)data;
BOOL translate_chat = floater->getChild<LLCheckBoxCtrl>("translate chat")->get();
gSavedSettings.setBOOL("TranslateChat", translate_chat);
}
// Update the "translate chat" checkbox after the "TranslateChat" pref is set in
// some other place (e.g. prefs dialog).
//static
void LLFloaterChat::updateSettings()
{
BOOL translate_chat = gSavedSettings.getBOOL("TranslateChat");
LLFloaterChat::getInstance(LLSD())->getChild<LLCheckBoxCtrl>("translate chat")->set(translate_chat);
history_editor->setVisible(!show_mute);
history_editor_with_mute->setVisible(show_mute);
(show_mute ? history_editor_with_mute : history_editor)->setCursorAndScrollToEnd();
}
// Put a line of chat in all the right places
@@ -596,24 +520,24 @@ LLColor4 get_text_color(const LLChat& chat, bool from_im)
//static
void LLFloaterChat::loadHistory()
{
LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance(LLSD()));
LLLogChat::loadHistory("chat", &chatFromLogFile, (void*)LLFloaterChat::getInstance());
}
//static
void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string line, void* userdata)
void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata)
{
switch (type)
{
case LLLogChat::LOG_EMPTY:
if (gSavedPerAccountSettings.getBOOL("LogChat"))
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_logging_string"), false);
break;
case LLLogChat::LOG_END:
// *TODO: nice message from XML file here
if (gSavedPerAccountSettings.getBOOL("LogChat"))
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_end_log_string"), false);
break;
case LLLogChat::LOG_LINE:
{
LLChat chat;
chat.mText = line;
addChatHistory(chat, FALSE);
}
addChatHistory(line, FALSE);
break;
default:
// nothing
@@ -630,29 +554,18 @@ void* LLFloaterChat::createSpeakersPanel(void* data)
//static
void* LLFloaterChat::createChatPanel(void* data)
{
LLChatBar* chatp = new LLChatBar();
return chatp;
return new LLChatBar;
}
// static
void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata)
void LLFloaterChat::onClickToggleActiveSpeakers(const LLSD& val)
{
LLFloaterChat* self = (LLFloaterChat*)userdata;
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
self->childSetVisible("active_speakers_panel",
(!self->childIsVisible("active_speakers_panel")) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) );
mPanel->setVisible(val && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
// [/RLVa:KB]
//self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel"));
//mPanel->setVisible(val);
}
void show_log_browser(const std::string& name = "chat", const std::string& id = "chat");
// static
void LLFloaterChat::onClickChatHistoryOpen(void* userdata)
{
show_log_browser();
}
//static
bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key)

View File

@@ -40,17 +40,9 @@
#include "llfloater.h"
#include "lllogchat.h"
class LLButton;
class LLChat;
class LLComboBox;
class LLLineEditor;
class LLViewerTextEditor;
class LLMessageSystem;
class LLUUID;
class LLCheckBoxCtrl;
class LLParticipantList;
class LLLogChat;
class LLChatBar;
class LLParticipantList;
class LLFloaterChat
: public LLFloater, public LLUISingleton<LLFloaterChat, LLFloaterChat>
@@ -61,13 +53,11 @@ public:
virtual void draw();
virtual BOOL postBuild();
virtual void onOpen();
virtual void onClose(bool app_quitting);
virtual void onFocusReceived();
virtual void handleVisibilityChange(BOOL cur_visibility);
virtual void setMinimized(BOOL);
void updateConsoleVisibility();
void updateSettings();
static void setHistoryCursorAndScrollToEnd();
@@ -80,12 +70,9 @@ public:
static void triggerAlerts(const std::string& text);
static void onClickMute(void *data);
static void onClickToggleShowMute(LLUICtrl* caller, void *data);
static void onClickToggleTranslateChat(LLUICtrl* caller, void *data);
static void onClickToggleActiveSpeakers(void* userdata);
static void onClickChatHistoryOpen(void* userdata);
static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata);
void onClickToggleShowMute(bool show_mute, class LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute);
void onClickToggleActiveSpeakers(const LLSD& val);
static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata);
static void loadHistory();
static void* createSpeakersPanel(void* data);
static void* createChatPanel(void* data);
@@ -100,7 +87,6 @@ public:
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
CachedUICtrl<LLChatBar> mChatPanel;
};

View File

@@ -69,7 +69,6 @@
// [/RLVa:KB]
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy startConferenceChatResponder_timeout;
extern AIHTTPTimeoutPolicy sessionInviteResponder_timeout;
//
@@ -172,7 +171,7 @@ public:
mAgents = agents_to_invite;
}
/*virtual*/ void httpFailure(void)
/*virtual*/ void httpFailure()
{
//try an "old school" way.
if ( mStatus == 400 )
@@ -191,9 +190,7 @@ public:
//and it is not worth the effort switching over all
//the possible different language translations
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return startConferenceChatResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLStartConferenceChatResponder"; }
/*virtual*/ char const* getName() const { return "LLStartConferenceChatResponder"; }
private:
LLUUID mTempSessionID;
@@ -347,6 +344,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
case IM_SESSION_P2P_INVITE:
mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID);
LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
LLMuteList::instance().addObserver(this);
mDing = gSavedSettings.getBOOL("LiruNewMessageSoundIMsOn");
break;
default:
@@ -418,6 +416,7 @@ void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name)
LLFloaterIMPanel::~LLFloaterIMPanel()
{
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
LLMuteList::instance().removeObserver(this);
delete mSpeakers;
mSpeakers = NULL;
@@ -463,6 +462,13 @@ void LLFloaterIMPanel::changed(U32 mask)
*/
}
// virtual
void LLFloaterIMPanel::onChangeDetailed(const LLMute& mute)
{
if (mute.mID == mOtherParticipantUUID)
rebuildDynamics(getChild<LLComboBox>("instant_message_flyout"));
}
// virtual
BOOL LLFloaterIMPanel::postBuild()
{
@@ -638,20 +644,14 @@ void LLFloaterIMPanel::draw()
class LLSessionInviteResponder : public LLHTTPClient::ResponderIgnoreBody
{
public:
LLSessionInviteResponder(const LLUUID& session_id)
{
mSessionID = session_id;
}
LLSessionInviteResponder(const LLUUID& session_id) : mSessionID(session_id) {}
/*virtual*/ void httpFailure(void)
/*virtual*/ void httpFailure()
{
llwarns << "Error inviting all agents to session [status:"
<< mStatus << "]: " << mReason << llendl;
llwarns << "Error inviting all agents to session [status:" << mStatus << "]: " << mReason << llendl;
//throw something back to the viewer here?
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return sessionInviteResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "LLSessionInviteResponder"; }
/*virtual*/ char const* getName() const { return "LLSessionInviteResponder"; }
private:
LLUUID mSessionID;
@@ -960,7 +960,7 @@ void LLFloaterIMPanel::removeDynamics(LLComboBox* flyout)
flyout->remove(mDing ? getString("ding on") : getString("ding off"));
flyout->remove(mRPMode ? getString("rp mode on") : getString("rp mode off"));
flyout->remove(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"));
//flyout->remove(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"));
flyout->remove(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"));
}
void LLFloaterIMPanel::addDynamics(LLComboBox* flyout)
@@ -968,7 +968,7 @@ void LLFloaterIMPanel::addDynamics(LLComboBox* flyout)
flyout->add(mDing ? getString("ding on") : getString("ding off"), 6);
flyout->add(mRPMode ? getString("rp mode on") : getString("rp mode off"), 7);
flyout->add(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"), 8);
//flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9);
flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9);
}
void copy_profile_uri(const LLUUID& id, bool group = false);
@@ -997,7 +997,7 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
if (option == 6) mDing = !mDing;
else if (option == 7) mRPMode = !mRPMode;
else if (option == 8) LLAvatarActions::isFriend(mOtherParticipantUUID) ? LLAvatarActions::removeFriendDialog(mOtherParticipantUUID) : LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID);
//else if (option == 9) LLAvatarActions::toggleBlock(mOtherParticipantUUID);
else if (option == 9) LLAvatarActions::toggleBlock(mOtherParticipantUUID);
// Last add them back
addDynamics(flyout);

View File

@@ -35,6 +35,7 @@
#include "llcallingcard.h"
#include "llfloater.h"
#include "lllogchat.h"
#include "llmutelist.h"
class LLAvatarName;
class LLIMSpeakerMgr;
@@ -46,7 +47,7 @@ class LLParticipantList;
class LLViewerTextEditor;
class LLVoiceChannel;
class LLFloaterIMPanel : public LLFloater, public LLFriendObserver
class LLFloaterIMPanel : public LLFloater, public LLFriendObserver, public LLMuteListObserver
{
public:
@@ -65,6 +66,8 @@ public:
void onAvatarNameLookup(const LLAvatarName& avatar_name);
/*virtual*/ void changed(U32 mask); // From LLFriendObserver, check friend status
/*virtual*/ void onChange() {}
/*virtual*/ void onChangeDetailed(const LLMute& mute); // From LLMuteListObserver, check for mute status changes for OtherParticipant
/*virtual*/ BOOL postBuild();
// Check typing timeout timer.

View File

@@ -50,6 +50,8 @@
#include "llmutelist.h"
#include "pipeline.h"
#include <boost/tokenizer.hpp>
#include "lldispatcher.h"
@@ -62,9 +64,8 @@
#include "llimpanel.h"
#include "llimview.h"
#include "llnotifications.h"
#include "lluistring.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "lltrans.h"
namespace
{
@@ -105,12 +106,6 @@ static LLDispatchEmptyMuteList sDispatchEmptyMuteList;
//-----------------------------------------------------------------------------
// LLMute()
//-----------------------------------------------------------------------------
const char BY_NAME_SUFFIX[] = " (by name)";
const char AGENT_SUFFIX[] = " (resident)";
const char OBJECT_SUFFIX[] = " (object)";
const char GROUP_SUFFIX[] = " (group)";
const char EXTERNAL_SUFFIX[] = " (avaline)";
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
: mID(id),
@@ -136,79 +131,29 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags)
}
std::string LLMute::getDisplayName() const
std::string LLMute::getDisplayType() const
{
std::string name_with_suffix = mName;
switch (mType)
{
case BY_NAME:
default:
name_with_suffix += BY_NAME_SUFFIX;
return LLTrans::getString("MuteByName");
break;
case AGENT:
name_with_suffix += AGENT_SUFFIX;
return LLTrans::getString("MuteAgent");
break;
case OBJECT:
name_with_suffix += OBJECT_SUFFIX;
return LLTrans::getString("MuteObject");
break;
case GROUP:
name_with_suffix += GROUP_SUFFIX;
return LLTrans::getString("MuteGroup");
break;
case EXTERNAL:
name_with_suffix += EXTERNAL_SUFFIX;
return LLTrans::getString("MuteExternal");
break;
}
return name_with_suffix;
}
void LLMute::setFromDisplayName(const std::string& display_name)
{
size_t pos = 0;
mName = display_name;
pos = mName.rfind(GROUP_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = GROUP;
return;
}
pos = mName.rfind(OBJECT_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = OBJECT;
return;
}
pos = mName.rfind(AGENT_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = AGENT;
return;
}
pos = mName.rfind(BY_NAME_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = BY_NAME;
return;
}
pos = mName.rfind(EXTERNAL_SUFFIX);
if (pos != std::string::npos)
{
mName.erase(pos);
mType = EXTERNAL;
return;
}
llwarns << "Unable to set mute from display name " << display_name << llendl;
return;
}
/* static */
LLMuteList* LLMuteList::getInstance()
@@ -232,9 +177,6 @@ LLMuteList::LLMuteList() :
mIsLoaded(FALSE)
{
gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList);
checkNewRegion();
gAgent.addRegionChangedCallback(boost::bind(&LLMuteList::checkNewRegion, this));
}
//-----------------------------------------------------------------------------
@@ -327,6 +269,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
llinfos << "Muting by name " << mute.mName << llendl;
updateAdd(mute);
notifyObservers();
notifyObserversDetailed(mute);
return TRUE;
}
else
@@ -375,6 +318,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
llinfos << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl;
updateAdd(localmute);
notifyObservers();
notifyObserversDetailed(localmute);
if(!(localmute.mFlags & LLMute::flagParticles))
{
//Kill all particle systems owned by muted task
@@ -472,19 +416,23 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
}
// Must be after erase.
notifyObserversDetailed(localmute);
setLoaded(); // why is this here? -MG
}
// Clean up any legacy mutes
string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
if (legacy_it != mLegacyMutes.end())
else
{
// Database representation of legacy mute is UUID null.
LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME);
updateRemove(mute);
mLegacyMutes.erase(legacy_it);
// Must be after erase.
setLoaded(); // why is this here? -MG
// Clean up any legacy mutes
string_set_t::iterator legacy_it = mLegacyMutes.find(mute.mName);
if (legacy_it != mLegacyMutes.end())
{
// Database representation of legacy mute is UUID null.
LLMute mute(LLUUID::null, *legacy_it, LLMute::BY_NAME);
updateRemove(mute);
mLegacyMutes.erase(legacy_it);
// Must be after erase.
notifyObserversDetailed(mute);
setLoaded(); // why is this here? -MG
}
}
return found;
@@ -537,15 +485,13 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& full_na
if (reason == LLMuteList::AR_IM)
{
LLFloaterIMPanel *timp = gIMMgr->findFloaterBySession(agent_id);
if (timp)
if (LLFloaterIMPanel* timp = gIMMgr->findFloaterBySession(agent_id))
{
timp->addHistoryLine(message);
}
}
LLChat auto_chat(message);
LLFloaterChat::addChat(auto_chat, FALSE, FALSE);
LLFloaterChat::addChat(message, FALSE, FALSE);
}
}
@@ -701,14 +647,10 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
LLViewerObject* mute_object = get_object_to_mute_from_id(id);
LLUUID id_to_check = (mute_object) ? mute_object->getID() : id;
if (id_to_check == gAgentID) return false; // Can't mute self.
// don't need name or type for lookup
LLMute mute(id_to_check);
// Can't mute self.
if (mute.mID == gAgent.getID() && !mute_object)
{
getInstance()->remove(mute);
return false;
}
mute_set_t::const_iterator mute_it = mMutes.find(mute);
if (mute_it != mMutes.end())
{
@@ -721,7 +663,8 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
}
// empty names can't be legacy-muted
if (name.empty()) return FALSE;
bool avatar = mute_object && mute_object->isAvatar();
if (name.empty() || avatar) return FALSE;
// Look in legacy pile
string_set_t::const_iterator legacy_it = mLegacyMutes.find(name);
@@ -849,52 +792,15 @@ void LLMuteList::notifyObservers()
}
}
void LLMuteList::checkNewRegion()
void LLMuteList::notifyObserversDetailed(const LLMute& mute)
{
LLViewerRegion* regionp = gAgent.getRegion();
if (!regionp) return;
if (regionp->getFeaturesReceived())
for (observer_set_t::iterator it = mObservers.begin();
it != mObservers.end();
)
{
parseSimulatorFeatures();
}
else
{
regionp->setFeaturesReceivedCallback(boost::bind(&LLMuteList::parseSimulatorFeatures, this));
}
}
void LLMuteList::parseSimulatorFeatures()
{
LLViewerRegion* regionp = gAgent.getRegion();
if (!regionp) return;
LLSD info;
regionp->getSimulatorFeatures(info);
mGodLastNames.clear();
mGodFullNames.clear();
if (info.has("god_names"))
{
if (info["god_names"].has("last_names"))
{
LLSD godNames = info["god_names"]["last_names"];
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
mGodLastNames.insert((*godNames_it).asString());
}
if (info["god_names"].has("full_names"))
{
LLSD godNames = info["god_names"]["full_names"];
for (LLSD::array_iterator godNames_it = godNames.beginArray(); godNames_it != godNames.endArray(); ++godNames_it)
mGodFullNames.insert((*godNames_it).asString());
}
}
else // Just use Linden
{
mGodLastNames.insert("Linden");
LLMuteListObserver* observer = *it;
observer->onChangeDetailed(mute);
// In case onChange() deleted an entry.
it = mObservers.upper_bound(observer);
}
}

View File

@@ -64,18 +64,12 @@ public:
LLMute(const LLUUID& id, const std::string& name = std::string(), EType type = BY_NAME, U32 flags = 0);
// Returns name + suffix based on type
// For example: "James Tester (resident)"
std::string getDisplayName() const;
// Converts a UI name into just the agent or object name
// For example: "James Tester (resident)" sets the name to "James Tester"
// and the type to AGENT.
void setFromDisplayName(const std::string& display_name);
// Returns localized type name of muted item
std::string getDisplayType() const;
public:
LLUUID mID; // agent or object id
std::string mName; // agent or object name
std::string mName; // agent or object name, does not store last name "Resident"
EType mType; // needed for UI display of existing mutes
U32 mFlags; // flags pertaining to this mute entry
};
@@ -119,6 +113,9 @@ public:
BOOL isLinden(const std::string& name) const;
bool isLinden(const LLUUID& id) const;
// <singu/> Quick way to check if LLMute is in the set
bool hasMute(const LLMute& mute) const { return mMutes.find(mute) != mMutes.end(); }
BOOL isLoaded() const { return mIsLoaded; }
std::vector<LLMute> getMutes() const;
@@ -135,6 +132,7 @@ private:
void setLoaded();
void notifyObservers();
void notifyObserversDetailed(const LLMute &mute);
void updateAdd(const LLMute& mute);
void updateRemove(const LLMute& mute);
@@ -145,9 +143,6 @@ private:
static void onFileMuteList(void** user_data, S32 code, LLExtStat ext_status);
void checkNewRegion();
void parseSimulatorFeatures();
private:
struct compare_by_name
{
@@ -182,6 +177,7 @@ private:
friend class LLDispatchEmptyMuteList;
friend class LFSimFeatureHandler;
std::set<std::string> mGodLastNames;
std::set<std::string> mGodFullNames;
};
@@ -191,6 +187,7 @@ class LLMuteListObserver
public:
virtual ~LLMuteListObserver() { }
virtual void onChange() = 0;
virtual void onChangeDetailed(const LLMute& ) { }
};

View File

@@ -102,7 +102,11 @@ void LLPanelAvatarTab::setAvatarID(const LLUUID& avatar_id)
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarID, this);
mAvatarID = avatar_id;
if (mAvatarID.notNull())
{
LLAvatarPropertiesProcessor::getInstance()->addObserver(mAvatarID, this);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Mute"))
ctrl->setValue(LLMuteList::instance().isMuted(mAvatarID));
}
}
}
@@ -130,11 +134,13 @@ LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name,
: LLPanelAvatarTab(name, rect, panel_avatar),
mPartnerID()
{
LLMuteList::instance().addObserver(this);
}
LLPanelAvatarSecondLife::~LLPanelAvatarSecondLife()
{
mCacheConnection.disconnect();
LLMuteList::instance().removeObserver(this);
}
void LLPanelAvatarSecondLife::refresh()
@@ -278,6 +284,12 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType
}
}
void LLPanelAvatarSecondLife::onChangeDetailed(const LLMute& mute)
{
if (mute.mID != mAvatarID) return;
getChild<LLUICtrl>("Mute")->setValue(LLMuteList::instance().hasMute(mute));
}
//-----------------------------------------------------------------------------
// enableControls()
//-----------------------------------------------------------------------------

View File

@@ -38,6 +38,7 @@
#include "lluuid.h"
#include "llmediactrl.h"
#include "llavatarpropertiesprocessor.h"
#include "llmutelist.h"
class LLAvatarName;
class LLCheckBoxCtrl;
@@ -99,6 +100,7 @@ public:
class LLPanelAvatarSecondLife
: public LLPanelAvatarTab
, public LLMuteListObserver
{
public:
LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar );
@@ -108,6 +110,8 @@ public:
/*virtual*/ void refresh();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
/*virtual*/ void onChange() {}
/*virtual*/ void onChangeDetailed(const LLMute& mute);
void onClickImage();
void onClickFriends();

View File

@@ -77,7 +77,6 @@
#include "llworldmapview.h"
#include "llnetmap.h"
#include "llrender.h"
#include "llfloaterchat.h"
#include "aistatemachine.h"
#include "aithreadsafe.h"
#include "lldrawpoolbump.h"
@@ -585,18 +584,6 @@ bool handleVelocityInterpolate(const LLSD& newvalue)
return true;
}
bool handleTranslateChatPrefsChanged(const LLSD& newvalue)
{
LLFloaterChat* floaterp = LLFloaterChat::getInstance();
if(floaterp)
{
// update "translate chat" pref in "Local Chat" floater
floaterp->updateSettings();
}
return true;
}
bool handleCloudSettingsChanged(const LLSD& newvalue)
{
bool bCloudsEnabled = gSavedSettings.getBOOL("CloudsEnabled");
@@ -795,7 +782,6 @@ void settings_setup_listeners()
gSavedSettings.getControl("AudioLevelMic")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _2));
gSavedSettings.getControl("VelocityInterpolate")->getSignal()->connect(boost::bind(&handleVelocityInterpolate, _2));
gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _2));
gSavedSettings.getControl("StateMachineMaxTime")->getSignal()->connect(boost::bind(&handleStateMachineMaxTimeChanged, _2));
gSavedSettings.getControl("CloudsEnabled")->getSignal()->connect(boost::bind(&handleCloudSettingsChanged, _2));

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater bottom="27" can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="true" can_tear_off="true" enabled="true" height="175" left="15"
min_height="100" min_width="425" name="chat floater" rect_control="FloaterChatRect" title="Local Chat" width="435">
min_height="100" min_width="425" name="chat floater" control_name="ShowChatHistory" rect_control="FloaterChatRect" title="Local Chat" width="435">
<string name="ringing">Connecting to in-world Voice Chat...</string>
<string name="connected">Connected</string>
<string name="unavailable">Voice not available at your current location</string>
<string name="hang_up">Disconnected from in-world Voice Chat</string>
<string name="voice_icon">icn_voice-localchat.tga</string>
<string name="IM_logging_string">-- Instant message logging enabled --</string>
<string name="IM_logging_string">-- Logging Enabled --</string>
<string name="IM_end_log_string">-- End of Log --</string>
<layout_stack border="false" bottom="0" follows="left|top|right|bottom" height="160" left="0" orientation="horizontal" width="430" name="panels">
<layout_panel border="false" bottom="0" height="160" left="0" min_width="275" name="im_contents_panel" width="305">
@@ -16,7 +16,7 @@
<combo_item name="Gestures">Gestures</combo_item>
</combo_box>
<check_box bottom_delta="-2" enabled="true" follows="left|top" font="SansSerifSmall" height="20" initial_value="false" label="Show Muted Text" left_delta="124" name="show mutes" width="116"/>
<!--check_box bottom_delta="-15" enabled="true" follows="left|top" font="SansSerifSmall" height="20" initial_value="false" label="Translate Chat (powered by Google)" name="translate chat" width="100"/-->
<!--check_box bottom_delta="-15" enabled="true" follows="left|top" font="SansSerifSmall" height="20" initial_value="false" label="Translate Chat (powered by Google)" name="translate chat" width="100" control_name="TranslateChat"/-->
<button bottom_delta="2" left_delta="120" follows="left|top" font="SansSerifSmall" height="20" width="100" label="Open History" name="chat_history_open" tool_tip="Click here to open chat history in external editor."/>
<button bottom_delta="0" follows="right|top" height="20" label="&lt; &lt;" label_selected="&gt; &gt;" left="272" name="toggle_active_speakers_btn" right="305" tool_tip="Click here to show a list of active participants in this IM session." width="80"/>
<text_editor type="string" length="1" bg_readonly_color="ChatHistoryBgColor" bg_writeable_color="ChatHistoryBgColor" bottom="0" enabled="false" follows="left|top|right|bottom" font="SansSerif" height="107" left="5" max_length="2147483647" name="Chat History Editor" text_color="ChatHistoryTextColor" track_bottom="true" text_readonly_color="ChatHistoryTextColor" width="300" word_wrap="true"/>

View File

@@ -22,8 +22,8 @@
<string name="rp mode off" value="RP Mode (Off)"/>
<string name="add friend" value="Add Friend"/>
<string name="remove friend" value="Remove Friend"/>
<!--string name="mute" value="Mute"/>
<string name="unmute" value="Unmute"/-->
<string name="mute" value="Mute"/>
<string name="unmute" value="Unmute"/>
<button bottom_delta="0" follows="left|top" height="20" left_delta="81" width="50" name="tp_btn" label="TP"/>
<button bottom_delta="0" follows="left|top" height="20" left_delta="50" width="50" name="pay_btn" label="Pay"/>
<button bottom_delta="0" follows="left|top" height="20" left_delta="50" width="50" name="history_btn" label="Log"/>

View File

@@ -26,8 +26,8 @@
<string name="rp mode off" value="RP Mode (Off)"/>
<string name="add friend" value="Add Friend"/>
<string name="remove friend" value="Remove Friend"/>
<!--string name="mute" value="Mute"/>
<string name="unmute" value="Unmute"/-->
<string name="mute" value="Mute"/>
<string name="unmute" value="Unmute"/>
<button bottom="-20" follows="right|top" height="20" image_overlay="icn_voice-call-start.tga" image_overlay_alignment="left" label="Call" left_delta="81" name="start_call_btn" width="60"/>
<button bottom="-20" follows="right|top" height="20" image_overlay="icn_voice-call-end.tga" image_overlay_alignment="left" scale_image="true" label="End" name="end_call_btn" width="24"/>
<panel mouse_opaque="false" border="false" bottom="-20" follows="right|top" height="20" left_delta="16" name="speaker_controls" width="60">

View File

@@ -156,7 +156,7 @@
label="Instant Message..." label_selected="Instant Message..."
left_delta="71" mouse_opaque="true" name="Instant Message..."
tool_tip="Instant Message (IM)" width="140" />
<button bottom="-470" font="SansSerifSmall" halign="center" height="20" label="(Un)Mute"
<button bottom="-470" font="SansSerifSmall" halign="center" height="20" label="Mute" label_selected="Unmute" toggle="true"
left_delta="141" mouse_opaque="true" name="Mute"
width="60" />
<button bottom="-470" font="SansSerif" halign="center" height="20" label="Invite to Group"

View File

@@ -62,7 +62,7 @@
<button label="Añadir como Amigo" label_selected="Añadir como Amigo" name="Add Friend..." left_delta="129" />
<button label="Pagar..." label_selected="Pagar..." name="Pay..." left="10"/>
<button label="Mensaje Instantáneo" label_selected="Mensaje Instantáneo" name="Instant Message..." tool_tip="Mensaje Instantáneo (IM)" left_delta="75"/>
<button label="(No) Ignorar" label_selected="Ignorar" name="Mute" left_delta="143" width="69"/>
<button label="Ignorar" label_selected="No Ignorar" name="Mute" left_delta="143" width="69"/>
<button label="Invitar al Grupo" label_selected="Invitar al Grupo" name="GroupInvite_Button" left_delta="74" width="110"/>
</panel>
<!-- =========================== -->

View File

@@ -58,7 +58,7 @@ objets :
<button label="Devenir amis" label_selected="Devenir amis" name="Add Friend..." left_delta="167"/>
<button label="Payer" label_selected="Payer" name="Pay..."/>
<button label="IM" label_selected="IM" left_delta="80" name="Instant Message..." tool_tip="Message instantané (IM)" width="70"/>
<button label="Mute/Ignorer" label_selected="Mute" left_delta="85" name="Mute" tool_tip="ATTENTION VOUS ALLEZ MUTER LA PERSONNE" width="110"/>
<button label="Mute/Ignorer" label_selected="UnMuter" left_delta="85" name="Mute" tool_tip="ATTENTION VOUS ALLEZ MUTER LA PERSONNE" width="110"/>
<button label="Invit. Groupe" label_selected="Invit. Groupe" left_delta="120" name="GroupInvite_Button" width="130"/>
</panel>