Ported the Speak button patch from Catznip, sent in by Satomi Ahn.
commit
21995e8f45
|
|
@ -97,7 +97,11 @@ void LLAudioEngine::setDefaults()
|
|||
}
|
||||
|
||||
mMasterGain = 1.f;
|
||||
mInternalGain = 0.f;
|
||||
// Setting mInternalGain to an out of range value fixes the issue reported in STORM-830.
|
||||
// There is an edge case in setMasterGain during startup which prevents setInternalGain from
|
||||
// being called if the master volume setting and mInternalGain both equal 0, so using -1 forces
|
||||
// the if statement in setMasterGain to execute when the viewer starts up.
|
||||
mInternalGain = -1.f;
|
||||
mNextWindUpdate = 0.f;
|
||||
|
||||
mStreamingAudioImpl = NULL;
|
||||
|
|
|
|||
|
|
@ -532,8 +532,22 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
|
|||
return "(\?\?\?)";
|
||||
}
|
||||
|
||||
std::string::size_type index = full_name.find(' ');
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
// regexp doesn't play nice with unicode, chop off the display name
|
||||
S32 open_paren = full_name.rfind(" (");
|
||||
if (open_paren != std::string::npos)
|
||||
{
|
||||
std::string username = full_name.substr(open_paren + 2, full_name.length() - open_paren - 3);
|
||||
boost::regex complete_name_regex("^[a-z0-9]+(\\.[a-z]+)?$");
|
||||
boost::match_results<std::string::const_iterator> name_results;
|
||||
if (boost::regex_match(username, name_results, complete_name_regex))
|
||||
{
|
||||
return username;
|
||||
}
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
std::string::size_type index = full_name.find(' ');
|
||||
if (index != std::string::npos)
|
||||
{
|
||||
std::string username;
|
||||
|
|
|
|||
|
|
@ -88,6 +88,11 @@ public:
|
|||
// Converts a standard legacy name to a username
|
||||
// "bobsmith123 Resident" -> "bobsmith"
|
||||
// "Random Linden" -> "random.linden"
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
// Additionally, converts a complete display name to a username
|
||||
// "bobsmith123 Resident (bobsmith123)" -> "bobsmith123"
|
||||
// "Alias (random.linden)" -> "random.linden"
|
||||
// [/SL:KB]
|
||||
static std::string buildUsername(const std::string& name);
|
||||
|
||||
// Converts a complete display name to a legacy name
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
mHasBeenDraggedWhileMinimized(FALSE),
|
||||
mPreviousMinimizedBottom(0),
|
||||
mPreviousMinimizedLeft(0),
|
||||
mHideOnMinimize(false),
|
||||
mMinimizeSignal(NULL)
|
||||
// mNotificationContext(NULL)
|
||||
{
|
||||
|
|
@ -918,6 +919,12 @@ void LLFloater::setTitle( const std::string& title )
|
|||
applyTitle();
|
||||
}
|
||||
|
||||
void LLFloater::setHideOnMinimize(bool hide)
|
||||
{
|
||||
mHideOnMinimize = hide;
|
||||
}
|
||||
|
||||
|
||||
std::string LLFloater::getTitle() const
|
||||
{
|
||||
if (mTitle.empty())
|
||||
|
|
@ -1057,10 +1064,13 @@ void LLFloater::setMinimized(BOOL minimize)
|
|||
{
|
||||
// AO Pseudo-hide minimized sidebar floaters. We get into trouble if they are actually not-visible,
|
||||
// so fake invisibility with offscreen location.
|
||||
bool isSideTrayTab = false;
|
||||
LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", getName());
|
||||
if (LLFloater::isShown(floater_tab))
|
||||
isSideTrayTab = true;
|
||||
if (LLFloater::isShown(floater_tab))
|
||||
{
|
||||
mHideOnMinimize = true;
|
||||
llinfos << "SideTray minimized floater " << getName() << " detected, hiding." << llendl;
|
||||
}
|
||||
|
||||
|
||||
// minimized flag should be turned on before release focus
|
||||
mMinimized = TRUE;
|
||||
|
|
@ -1078,8 +1088,9 @@ void LLFloater::setMinimized(BOOL minimize)
|
|||
{
|
||||
S32 left, bottom;
|
||||
|
||||
if (isSideTrayTab)
|
||||
if (mHideOnMinimize)
|
||||
{
|
||||
llinfos << "mHideOnMinize: setting origin off screen" << llendl;
|
||||
setOrigin( -9999, -9999 );
|
||||
}
|
||||
else
|
||||
|
|
@ -1135,11 +1146,18 @@ void LLFloater::setMinimized(BOOL minimize)
|
|||
}
|
||||
|
||||
// Reshape *after* setting mMinimized
|
||||
if (isSideTrayTab)
|
||||
reshape( 0, 0, TRUE);
|
||||
else
|
||||
if (mHideOnMinimize)
|
||||
{
|
||||
llinfos << "mHideOnMinize - reshaping to be hidden" << llendl;
|
||||
//LLPanel::reshape(width, height, called_from_parent);
|
||||
//reshape( 1, 1, TRUE);
|
||||
reshape( 1, floater_header_size, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "AO: reshaping to minimized bar" << llendl;
|
||||
reshape( minimized_width, floater_header_size, TRUE);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ public:
|
|||
std::string getTitle() const;
|
||||
void setShortTitle( const std::string& short_title );
|
||||
std::string getShortTitle() const;
|
||||
void setHideOnMinimize(bool hide);
|
||||
void setTitleVisible(bool visible);
|
||||
virtual void setMinimized(BOOL b);
|
||||
void moveResizeHandlesToFront();
|
||||
|
|
@ -389,6 +390,7 @@ private:
|
|||
BOOL mDragOnLeft;
|
||||
BOOL mResizable;
|
||||
bool mOpenCentered;
|
||||
bool mHideOnMinimize;
|
||||
|
||||
S32 mMinWidth;
|
||||
S32 mMinHeight;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "llfloater.h"
|
||||
#include "llmultifloater.h"
|
||||
#include "llfloaterreglistener.h"
|
||||
#include <string>
|
||||
|
||||
//*******************************************************
|
||||
|
||||
|
|
@ -135,6 +136,15 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
|
|||
// Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe
|
||||
res->mKey = key;
|
||||
res->setInstanceName(name);
|
||||
|
||||
// handle restored undocked sidebar tabs specially
|
||||
llinfos << "trying to restore variables for name: " << name << llendl;
|
||||
std::string pat = "side_bar_tab";
|
||||
size_t found = name.find(pat);
|
||||
if (found!=std::string::npos)
|
||||
res->setHideOnMinimize(true);
|
||||
|
||||
|
||||
res->applySavedVariables(); // Can't apply rect and dock state until setting instance name
|
||||
if (res->mAutoTile && !res->getHost() && index > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11666,6 +11666,17 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>UseLegacyIMLogNames</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Use legacy filenames for P2P IMs logs</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>UseOcclusion</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ void LLAvatarTracker::addParticularFriendObserver(const LLUUID& buddy_id, LLFrie
|
|||
{
|
||||
if (buddy_id.notNull() && observer)
|
||||
mParticularFriendObserverMap[buddy_id].insert(observer);
|
||||
llinfos << "AO DEBUG: postAdd: ob_it->second.size=" << mParticularFriendObserverMap[buddy_id].size() << llendl;
|
||||
}
|
||||
|
||||
void LLAvatarTracker::removeParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer)
|
||||
|
|
@ -511,12 +512,19 @@ void LLAvatarTracker::removeParticularFriendObserver(const LLUUID& buddy_id, LLF
|
|||
|
||||
observer_map_t::iterator obs_it = mParticularFriendObserverMap.find(buddy_id);
|
||||
if(obs_it == mParticularFriendObserverMap.end())
|
||||
return;
|
||||
|
||||
{
|
||||
llinfos << "AO DEBUG: preremove: no observers found, skipping." << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
llinfos << "AO DEBUG: preremove: ob_it->second.size=" << obs_it->second.size() << llendl;
|
||||
obs_it->second.erase(observer);
|
||||
llinfos << "AO DEBUG: postremove: ob_it->second.size=" << obs_it->second.size() << llendl;
|
||||
|
||||
// purge empty sets from the map
|
||||
if (obs_it->second.size() == 0)
|
||||
// AO: Remove below check as last resort to resolve a crash from dangling pointer.
|
||||
// TODO: clean up all observers and don't leave dangling pointers here.
|
||||
if (obs_it->second.size() == 0)
|
||||
mParticularFriendObserverMap.erase(obs_it);
|
||||
}
|
||||
|
||||
|
|
@ -528,6 +536,7 @@ void LLAvatarTracker::notifyParticularFriendObservers(const LLUUID& buddy_id)
|
|||
|
||||
// Notify observers interested in buddy_id.
|
||||
observer_set_t& obs = obs_it->second;
|
||||
llinfos << "AO DEBUG: notifying particularFriends, size=" << obs_it->second.size() << llendl;
|
||||
for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ob_it++)
|
||||
{
|
||||
if (*ob_it)
|
||||
|
|
|
|||
|
|
@ -327,11 +327,18 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im
|
|||
// If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history.
|
||||
else
|
||||
{
|
||||
std::string full_name;
|
||||
if (gCacheName->getFullName(to_agent, full_name))
|
||||
// std::string full_name;
|
||||
// if (gCacheName->getFullName(to_agent, full_name))
|
||||
// {
|
||||
// LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im"));
|
||||
// }
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
std::string strFilename;
|
||||
if (LLIMModel::buildIMP2PLogFilename(to_agent, LLStringUtil::null, strFilename))
|
||||
{
|
||||
LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im"));
|
||||
LLIMModel::instance().logToFile(strFilename, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im"));
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,6 +155,22 @@ void LLIMFloater::onClose(bool app_quitting)
|
|||
//
|
||||
// Last change:
|
||||
// EXT-3516 X Button should end IM session, _ button should hide
|
||||
|
||||
|
||||
// AO: Make sure observers are removed on close
|
||||
mVoiceChannelStateChangeConnection.disconnect();
|
||||
if(LLVoiceClient::instanceExists())
|
||||
{
|
||||
LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this);
|
||||
}
|
||||
|
||||
LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID);
|
||||
if ((pIMSession) && (pIMSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION))
|
||||
{
|
||||
llinfos << "AO: Cleaning up stray particularFriendObservers" << llendl;
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
|
||||
}
|
||||
|
||||
gIMMgr->leaveSession(mSessionID);
|
||||
}
|
||||
|
||||
|
|
@ -298,6 +314,13 @@ LLIMFloater::~LLIMFloater()
|
|||
{
|
||||
LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this);
|
||||
}
|
||||
|
||||
LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID);
|
||||
if ((pIMSession) && (pIMSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION))
|
||||
{
|
||||
llinfos << "AO: Cleaning up stray particularFriendObservers" << llendl;
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
|
||||
}
|
||||
}
|
||||
|
||||
// <AO> Callbacks previously in llcontrol_panel, moved to this floater.
|
||||
|
|
@ -519,9 +542,10 @@ BOOL LLIMFloater::postBuild()
|
|||
getChild<LLLayoutPanel>("voice_ctrls_btn_panel")->setVisible(false);
|
||||
getChild<LLLayoutStack>("ls_control_panel")->reshape(180,20,true);
|
||||
|
||||
|
||||
llinfos << "AO: adding llimfloater removing/adding particularfriendobserver" << llendl;
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this);
|
||||
LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this);
|
||||
|
||||
// Disable "Add friend" button for friends.
|
||||
llinfos << "add_friend_btn check start" << llendl;
|
||||
getChild<LLButton>("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID));
|
||||
|
|
|
|||
|
|
@ -557,23 +557,53 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline()
|
|||
|
||||
void LLIMModel::LLIMSession::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
|
||||
{
|
||||
if (av_name.mUsername.empty())
|
||||
// if (av_name.mUsername.empty())
|
||||
// {
|
||||
// // display names is off, use mDisplayName which will be the legacy name
|
||||
// mHistoryFileName = LLCacheName::buildUsername(av_name.mDisplayName);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// mHistoryFileName = av_name.mUsername;
|
||||
// }
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2011-01-16 (Catznip-2.4.0h) | Modified: Catznip-2.4.0h
|
||||
if (!av_name.mIsTemporaryName)
|
||||
{
|
||||
// display names is off, use mDisplayName which will be the legacy name
|
||||
mHistoryFileName = LLCacheName::buildUsername(av_name.mDisplayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
mHistoryFileName = av_name.mUsername;
|
||||
LLIMModel::buildIMP2PLogFilename(avatar_id, mName, mHistoryFileName);
|
||||
|
||||
// See note in LLIMModel::LLIMSession::buildHistoryFileName() - standardize P2P IM session names to "complete name"
|
||||
mName = av_name.getCompleteName();
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
void LLIMModel::LLIMSession::buildHistoryFileName()
|
||||
{
|
||||
mHistoryFileName = mName;
|
||||
|
||||
//ad-hoc requires sophisticated chat history saving schemes
|
||||
if (isAdHoc())
|
||||
// mHistoryFileName = mName;
|
||||
//
|
||||
// //ad-hoc requires sophisticated chat history saving schemes
|
||||
// if (isAdHoc())
|
||||
// {
|
||||
// //in case of outgoing ad-hoc sessions
|
||||
// if (mInitialTargetIDs.size())
|
||||
// {
|
||||
// std::set<LLUUID> sorted_uuids(mInitialTargetIDs.begin(), mInitialTargetIDs.end());
|
||||
// mHistoryFileName = mName + " hash" + generateHash(sorted_uuids);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// //in case of incoming ad-hoc sessions
|
||||
// mHistoryFileName = mName + " " + LLLogChat::timestamp(true) + " " + mSessionID.asString().substr(0, 4);
|
||||
// }
|
||||
//
|
||||
// // look up username to use as the log name
|
||||
// if (isP2P())
|
||||
// {
|
||||
// LLAvatarNameCache::get(mOtherParticipantID, boost::bind(&LLIMModel::LLIMSession::onAvatarNameCache, this, _1, _2));
|
||||
// }
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
// Not all of the code above is broken but it becomes a bit of a mess otherwise
|
||||
if (isAdHoc()) //ad-hoc requires sophisticated chat history saving schemes
|
||||
{
|
||||
/* in case of outgoing ad-hoc sessions we need to make specilized names
|
||||
* if this naming system is ever changed then the filtering definitions in
|
||||
|
|
@ -591,12 +621,20 @@ void LLIMModel::LLIMSession::buildHistoryFileName()
|
|||
//in case of incoming ad-hoc sessions
|
||||
mHistoryFileName = mName + " " + LLLogChat::timestamp(true) + " " + mSessionID.asString().substr(0, 4);
|
||||
}
|
||||
|
||||
// look up username to use as the log name
|
||||
if (isP2P())
|
||||
else if (isP2P()) // look up username to use as the log name
|
||||
{
|
||||
// NOTE-Catznip: [SL-2.4.0] mName will be:
|
||||
// - the "complete name" if display names are enabled and it's an outgoing IM
|
||||
// - the "legacy name" if display names are disabled or if it's an incoming IM
|
||||
LLIMModel::buildIMP2PLogFilename(mOtherParticipantID, mName, mHistoryFileName);
|
||||
|
||||
LLAvatarNameCache::get(mOtherParticipantID, boost::bind(&LLIMModel::LLIMSession::onAvatarNameCache, this, _1, _2));
|
||||
}
|
||||
else
|
||||
{
|
||||
mHistoryFileName = mName;
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -777,6 +815,43 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from,
|
|||
return true;
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
bool LLIMModel::buildIMP2PLogFilename(const LLUUID& idAgent, const std::string& strName, std::string& strFilename)
|
||||
{
|
||||
static LLCachedControl<bool> fLegacyFilenames(gSavedSettings, "UseLegacyIMLogNames");
|
||||
|
||||
// If we have the name cached then we can simply return the username
|
||||
LLAvatarName avName;
|
||||
if ( (LLAvatarNameCache::get(idAgent, &avName)) && (!avName.mIsTemporaryName) )
|
||||
{
|
||||
if (!fLegacyFilenames)
|
||||
{
|
||||
// If display names are turned off mUserName will be empty and we have to construct it from the legacy name
|
||||
strFilename = (!avName.mUsername.empty()) ? avName.mUsername : LLCacheName::buildUsername(avName.mDisplayName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the legacy name to base the filename on
|
||||
strFilename = LLCacheName::cleanFullName( (!avName.mLegacyFirstName.empty()) ? avName.getLegacyName() : avName.mDisplayName );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!fLegacyFilenames)
|
||||
{
|
||||
// If we don't have it cached 'strName' *should* be a legacy name (or a complete name) and we can construct a username from that
|
||||
strFilename = LLCacheName::buildUsername(strName);
|
||||
return strName != strFilename; // If the assumption above was wrong then the two will match which signals failure
|
||||
}
|
||||
else
|
||||
{
|
||||
// Strip any possible mention of a username
|
||||
strFilename = LLCacheName::buildLegacyName(strName);
|
||||
return (!strFilename.empty()); // Assume success as long as the filename isn't an empty string
|
||||
}
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text)
|
||||
{
|
||||
if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
|
||||
|
|
@ -2466,10 +2541,17 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess
|
|||
// log message to file
|
||||
else
|
||||
{
|
||||
std::string session_name;
|
||||
// since we select user to share item with - his name is already in cache
|
||||
gCacheName->getFullName(args["user_id"], session_name);
|
||||
LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString());
|
||||
// std::string session_name;
|
||||
// // since we select user to share item with - his name is already in cache
|
||||
// gCacheName->getFullName(args["user_id"], session_name);
|
||||
// LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString());
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
std::string strFilename;
|
||||
if (LLIMModel::buildIMP2PLogFilename(args["user_id"], LLStringUtil::null, strFilename))
|
||||
{
|
||||
LLIMModel::instance().logToFile(strFilename, SYSTEM_FROM, LLUUID::null, message.getString());
|
||||
}
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,6 +283,13 @@ public:
|
|||
|
||||
void testMessages();
|
||||
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
/**
|
||||
* Attempts to build the correct IM P2P log filename for the specified agent UUID and agent name
|
||||
*/
|
||||
static bool buildIMP2PLogFilename(const LLUUID& idAgent, const std::string& strName, std::string& strFilename);
|
||||
// [/SL:KB]
|
||||
|
||||
/**
|
||||
* Saves an IM message into a file
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "llnotifications.h"
|
||||
#include "llimview.h"
|
||||
#include "llagent.h"
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
#include "llavatarnamecache.h"
|
||||
// [/SL:KB]
|
||||
#include "llfloaterreg.h"
|
||||
#include "llnearbychat.h"
|
||||
#include "llimfloater.h"
|
||||
|
|
@ -254,7 +257,10 @@ bool LLHandlerUtil::isIMFloaterFocused(const LLNotificationPtr& notification)
|
|||
|
||||
// static
|
||||
void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
|
||||
const std::string& session_name, const std::string& from_name,
|
||||
// const std::string& session_name, const std::string& from_name,
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
const std::string& file_name, const std::string& from_name,
|
||||
// [/SL:KB]
|
||||
const std::string& message, const LLUUID& session_owner_id,
|
||||
const LLUUID& from_id)
|
||||
{
|
||||
|
|
@ -275,7 +281,10 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
|
|||
{
|
||||
from = SYSTEM_FROM;
|
||||
}
|
||||
LLIMModel::instance().logToFile(session_name, from, from_id, message);
|
||||
// LLIMModel::instance().logToFile(session_name, from, from_id, message);
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
LLIMModel::instance().logToFile(file_name, from, from_id, message);
|
||||
// [/SL:KB]
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -315,13 +324,24 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
|
|||
logToIMP2P(notification, false);
|
||||
}
|
||||
|
||||
void log_name_callback(const std::string& full_name, const std::string& from_name,
|
||||
const std::string& message, const LLUUID& from_id)
|
||||
|
||||
//void log_name_callback(const std::string& full_name, const std::string& from_name,
|
||||
// const std::string& message, const LLUUID& from_id)
|
||||
//
|
||||
//{
|
||||
// LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, full_name, from_name, message,
|
||||
// from_id, LLUUID());
|
||||
//}
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
void log_name_callback(const LLUUID& agent_id, const LLAvatarName& av_name,
|
||||
const std::string& from_name, const std::string& message, const LLUUID& from_id)
|
||||
{
|
||||
LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, full_name, from_name, message,
|
||||
from_id, LLUUID());
|
||||
std::string strFilename;
|
||||
if (LLIMModel::buildIMP2PLogFilename(agent_id, av_name.getCompleteName(), strFilename))
|
||||
{
|
||||
LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, strFilename, from_name, message, from_id, LLUUID());
|
||||
}
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
||||
// static
|
||||
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
|
||||
|
|
@ -339,11 +359,17 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
|
|||
|
||||
if(to_file_only)
|
||||
{
|
||||
gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID()));
|
||||
// gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID()));
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _1, _2, "", notification->getMessage(), LLUUID()));
|
||||
// [/SL:KB]
|
||||
}
|
||||
else
|
||||
{
|
||||
gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
|
||||
// gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _1, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
|
||||
// [/SL:KB]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,8 +109,11 @@ bool LLTipHandler::processNotification(const LLSD& notify)
|
|||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
if (LLHandlerUtil::canLogToIM(notification))
|
||||
{
|
||||
LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, session_name, name,
|
||||
notification->getMessage(), from_id, from_id);
|
||||
// LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, session_name, name,
|
||||
// notification->getMessage(), from_id, from_id);
|
||||
// [SL:KB] - Patch: Chat-Logs | Checked: 2010-11-18 (Catznip-2.4.0c) | Added: Catznip-2.4.0c
|
||||
LLHandlerUtil::logToIMP2P(notification, false);
|
||||
// [/SL:KB]
|
||||
}
|
||||
|
||||
if (LLHandlerUtil::canSpawnIMSession(notification))
|
||||
|
|
|
|||
|
|
@ -107,20 +107,21 @@ void LLPanelChatControlPanel::updateButtons(bool is_call_started)
|
|||
|
||||
LLPanelChatControlPanel::~LLPanelChatControlPanel()
|
||||
{
|
||||
mVoiceChannelStateChangeConnection.disconnect();
|
||||
if(LLVoiceClient::instanceExists())
|
||||
{
|
||||
LLVoiceClient::getInstance()->removeObserver(this);
|
||||
}
|
||||
// AO: Now handled by main im floater
|
||||
//mVoiceChannelStateChangeConnection.disconnect();
|
||||
//if(LLVoiceClient::instanceExists())
|
||||
//{
|
||||
// LLVoiceClient::getInstance()->removeObserver(this);
|
||||
//}
|
||||
}
|
||||
|
||||
BOOL LLPanelChatControlPanel::postBuild()
|
||||
{
|
||||
childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this));
|
||||
childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this));
|
||||
childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this));
|
||||
|
||||
LLVoiceClient::getInstance()->addObserver(this);
|
||||
// AO: Now handled by main im floater
|
||||
//childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this));
|
||||
//childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this));
|
||||
//childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this));
|
||||
//LLVoiceClient::getInstance()->addObserver(this);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -129,14 +130,16 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id)
|
|||
{
|
||||
//Method is called twice for AdHoc and Group chat. Second time when server init reply received
|
||||
mSessionId = session_id;
|
||||
LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId);
|
||||
if(voice_channel)
|
||||
{
|
||||
mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2));
|
||||
|
||||
//call (either p2p, group or ad-hoc) can be already in started state
|
||||
updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
|
||||
}
|
||||
|
||||
// AO: Now handled by main im floater
|
||||
//LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId);
|
||||
//if(voice_channel)
|
||||
//{
|
||||
// mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2));
|
||||
//
|
||||
// //call (either p2p, group or ad-hoc) can be already in started state
|
||||
// updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED);
|
||||
//}
|
||||
}
|
||||
|
||||
LLPanelIMControlPanel::LLPanelIMControlPanel()
|
||||
|
|
@ -145,18 +148,19 @@ LLPanelIMControlPanel::LLPanelIMControlPanel()
|
|||
|
||||
LLPanelIMControlPanel::~LLPanelIMControlPanel()
|
||||
{
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this);
|
||||
// AO: Now handled by main im floater
|
||||
//LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this);
|
||||
}
|
||||
|
||||
BOOL LLPanelIMControlPanel::postBuild()
|
||||
{
|
||||
childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this));
|
||||
childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this));
|
||||
|
||||
childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this));
|
||||
childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this));
|
||||
childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this));
|
||||
getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId()));
|
||||
// AO: Now handled by main im floater
|
||||
//childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this));
|
||||
//childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this));
|
||||
//childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this));
|
||||
//childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this));
|
||||
//childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this));
|
||||
//getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId()));
|
||||
|
||||
setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this));
|
||||
|
||||
|
|
@ -204,43 +208,44 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
|
|||
|
||||
LLIMModel& im_model = LLIMModel::instance();
|
||||
|
||||
LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this);
|
||||
// AO: Now handled by main im floater
|
||||
//LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this);
|
||||
mAvatarID = im_model.getOtherParticipantID(session_id);
|
||||
LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this);
|
||||
//LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this);
|
||||
|
||||
// Disable "Add friend" button for friends.
|
||||
getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID));
|
||||
//getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID));
|
||||
|
||||
// Disable "Teleport" button if friend is offline
|
||||
if(LLAvatarActions::isFriend(mAvatarID))
|
||||
{
|
||||
getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID));
|
||||
}
|
||||
//if(LLAvatarActions::isFriend(mAvatarID))
|
||||
//{
|
||||
// getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID));
|
||||
//}
|
||||
|
||||
getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(mAvatarID);
|
||||
//getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(mAvatarID);
|
||||
|
||||
// Disable most profile buttons if the participant is
|
||||
// not really an SL avatar (e.g., an Avaline caller).
|
||||
LLIMModel::LLIMSession* im_session =
|
||||
im_model.findIMSession(session_id);
|
||||
if( im_session && !im_session->mOtherParticipantIsAvatar )
|
||||
{
|
||||
getChildView("view_profile_btn")->setEnabled(FALSE);
|
||||
getChildView("add_friend_btn")->setEnabled(FALSE);
|
||||
//LLIMModel::LLIMSession* im_session =
|
||||
// im_model.findIMSession(session_id);
|
||||
//if( im_session && !im_session->mOtherParticipantIsAvatar )
|
||||
//{
|
||||
// getChildView("view_profile_btn")->setEnabled(FALSE);
|
||||
// getChildView("add_friend_btn")->setEnabled(FALSE);
|
||||
|
||||
getChildView("share_btn")->setEnabled(FALSE);
|
||||
getChildView("teleport_btn")->setEnabled(FALSE);
|
||||
getChildView("pay_btn")->setEnabled(FALSE);
|
||||
// getChildView("share_btn")->setEnabled(FALSE);
|
||||
// getChildView("teleport_btn")->setEnabled(FALSE);
|
||||
// getChildView("pay_btn")->setEnabled(FALSE);
|
||||
|
||||
getChild<LLTextBox>("avatar_name")->setValue(im_session->mName);
|
||||
getChild<LLTextBox>("avatar_name")->setToolTip(im_session->mName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the participant is an avatar, fetch the currect name
|
||||
gCacheName->get(mAvatarID, false,
|
||||
boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3));
|
||||
}
|
||||
// getChild<LLTextBox>("avatar_name")->setValue(im_session->mName);
|
||||
// getChild<LLTextBox>("avatar_name")->setToolTip(im_session->mName);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // If the participant is an avatar, fetch the currect name
|
||||
// gCacheName->get(mAvatarID, false,
|
||||
// boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3));
|
||||
//}
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -272,7 +277,7 @@ mParticipantList(NULL)
|
|||
|
||||
BOOL LLPanelGroupControlPanel::postBuild()
|
||||
{
|
||||
childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this));
|
||||
//childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this));
|
||||
|
||||
return LLPanelChatControlPanel::postBuild();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,8 +213,10 @@ void LLSideTrayTab::toggleTabDocked()
|
|||
|
||||
// bool docking = LLFloater::isShown(floater_tab);
|
||||
// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c
|
||||
if (floater_tab->isMinimized())
|
||||
floater_tab->setMinimized(FALSE);
|
||||
|
||||
// AO: Don't change minimized state. We want it preserved.
|
||||
// if (floater_tab->isMinimized())
|
||||
// floater_tab->setMinimized(FALSE);
|
||||
|
||||
LLSideTray* pSideTray = getSideTray();
|
||||
if (!pSideTray) return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue