Add LLIMProcessing and support for new message caps! And UserInfo cap!

Also delayed sound support!
Fixed memory leaks and pass by values that LL likes to introduce.
Extended LLCoroResponder to have a responder for Raw strings, also clean it
Adds friend request message logging.
This commit is contained in:
Liru Færs
2020-02-25 02:32:14 -05:00
parent 6a56d048c0
commit 842d1b8d93
17 changed files with 3221 additions and 2369 deletions

View File

@@ -28,15 +28,35 @@
#include <functional>
#include "llhttpclient.h"
struct LLCoroResponder final : public LLHTTPClient::ResponderWithCompleted
struct LLCoroResponderBase : public LLHTTPClient::ResponderWithCompleted
{
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; }
const LLSD& getContent() const { return mContent; }
char const* getName() const override final { return "LLCoroResponder"; }
protected:
LLCoroResponderBase() {}
};
struct LLCoroResponder final : public LLCoroResponderBase
{
typedef std::function<void(const LLCoroResponder&)> cb_t;
LLCoroResponder(const cb_t& cb) : mCB(cb) {}
LLCoroResponder(const cb_t& cb) : mCB(cb) {}
void httpCompleted() override { mCB(*this); }
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; }
const LLSD& getContent() const { return mContent; }
char const* getName() const override { return "LLCoroResponder"; }
private:
const cb_t mCB;
};
struct LLCoroResponderRaw final : public LLCoroResponderBase
{
typedef std::function<void(const LLCoroResponderRaw&, const std::string&)> cb_t;
LLCoroResponderRaw(const cb_t& cb) : mCB(cb) {}
void completedRaw(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) override
{
std::string content;
decode_raw_body(channels, buffer, content);
mCB(*this, content);
}
private:
const cb_t mCB;
};

View File

@@ -324,6 +324,7 @@ set(viewer_SOURCE_FILES
llhudtext.cpp
llhudview.cpp
llimpanel.cpp
llimprocessing.cpp
llimview.cpp
llinventoryactions.cpp
llinventorybridge.cpp
@@ -867,6 +868,7 @@ set(viewer_HEADER_FILES
llhudtext.h
llhudview.h
llimpanel.h
llimprocessing.h
llimview.h
llinventorybridge.h
llinventoryclipboard.h

View File

@@ -38,11 +38,14 @@
#include "llanimationstates.h"
#include "llcallingcard.h"
#include "llcapabilitylistener.h"
#include "llcororesponder.h"
#include "llconsole.h"
#include "llenvmanager.h"
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloatertools.h"
#include "llfloaterpostcard.h"
#include "llfloaterpreference.h"
#include "llgroupactions.h"
#include "llgroupmgr.h"
#include "llhomelocationresponder.h"
@@ -184,10 +187,10 @@ public:
LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId);
virtual ~LLTeleportRequestViaLandmark();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
protected:
inline const LLUUID &getLandmarkId() const {return mLandmarkId;};
@@ -196,15 +199,15 @@ private:
LLUUID mLandmarkId;
};
class LLTeleportRequestViaLure : public LLTeleportRequestViaLandmark
class LLTeleportRequestViaLure final : public LLTeleportRequestViaLandmark
{
public:
LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike);
virtual ~LLTeleportRequestViaLure();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
void startTeleport() override;
protected:
inline BOOL isLureGodLike() const {return mIsLureGodLike;};
@@ -219,10 +222,10 @@ public:
LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocation();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
protected:
inline const LLVector3d &getPosGlobal() const {return mPosGlobal;};
@@ -232,16 +235,16 @@ private:
};
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation
class LLTeleportRequestViaLocationLookAt final : public LLTeleportRequestViaLocation
{
public:
LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocationLookAt();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
protected:
@@ -258,12 +261,12 @@ const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f;
std::map<std::string, std::string> LLAgent::sTeleportErrorMessages;
std::map<std::string, std::string> LLAgent::sTeleportProgressMessages;
class LLAgentFriendObserver : public LLFriendObserver
class LLAgentFriendObserver final : public LLFriendObserver
{
public:
LLAgentFriendObserver() {}
virtual ~LLAgentFriendObserver() {}
virtual void changed(U32 mask);
LLAgentFriendObserver() = default;
virtual ~LLAgentFriendObserver() = default;
void changed(U32 mask) override;
};
void LLAgentFriendObserver::changed(U32 mask)
@@ -293,7 +296,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
{
bool allow_agent_voice = false;
LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel();
if (channel != NULL)
if (channel != nullptr)
{
if (channel->getSessionName().empty() && channel->getSessionID().isNull())
{
@@ -2589,15 +2592,11 @@ void LLAgent::onAnimStop(const LLUUID& id)
}
else if (id == ANIM_AGENT_AWAY)
{
// clearAFK();
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE))
clearAFK();
#else
clearAFK();
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB]
// clearAFK();
}
else if (id == ANIM_AGENT_STANDUP)
{
@@ -2668,7 +2667,7 @@ bool LLAgent::canAccessMaturityInRegion( U64 region_handle ) const
return true;
}
bool LLAgent::canAccessMaturityAtGlobal( LLVector3d pos_global ) const
bool LLAgent::canAccessMaturityAtGlobal(const LLVector3d& pos_global ) const
{
U64 region_handle = to_region_handle_global( pos_global.mdV[0], pos_global.mdV[1] );
return canAccessMaturityInRegion( region_handle );
@@ -2715,7 +2714,7 @@ int LLAgent::convertTextToMaturity(char text)
return LLAgentAccess::convertTextToMaturity(text);
}
class LLMaturityPreferencesResponder : public LLHTTPClient::ResponderWithResult
class LLMaturityPreferencesResponder final : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLMaturityPreferencesResponder);
public:
@@ -2723,12 +2722,10 @@ public:
virtual ~LLMaturityPreferencesResponder();
protected:
virtual void httpSuccess();
virtual void httpFailure();
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
protected:
void httpSuccess() override;
void httpFailure() override;
char const* getName() const override { return "LLMaturityPreferencesResponder"; }
private:
U8 parseMaturityFromServerResponse(const LLSD &pContent) const;
@@ -2929,7 +2926,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
boost::intrusive_ptr<LLHTTPClient::ResponderWithResult> responderPtr = boost::intrusive_ptr<LLHTTPClient::ResponderWithResult>(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity));
// If we don't have a region, report it as an error
if (getRegion() == NULL)
if (getRegion() == nullptr)
{
responderPtr->failureResult(0U, "region is not defined", LLSD());
}
@@ -3206,24 +3203,27 @@ void LLAgent::sendAnimationRequests(const uuid_vec_t &anim_ids, EAnimRequest req
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
for (U32 i = 0; i < anim_ids.size(); i++)
for (auto anim_id : anim_ids)
{
if (anim_ids[i].isNull())
if (anim_id.isNull())
{
continue;
}
msg->nextBlockFast(_PREHASH_AnimationList);
msg->addUUIDFast(_PREHASH_AnimID, (anim_ids[i]) );
msg->addUUIDFast(_PREHASH_AnimID, anim_id);
msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE);
num_valid_anims++;
}
if (!num_valid_anims)
{
msg->clearMessage();
return;
}
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
if (num_valid_anims)
{
sendReliableMessage();
}
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage();
}
void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
@@ -3244,7 +3244,7 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage();
}
@@ -3268,7 +3268,7 @@ void LLAgent::sendAnimationStateReset()
msg->addBOOLFast(_PREHASH_StartAnim, FALSE);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage();
}
@@ -3507,8 +3507,8 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
// Remove the group if it already exists remove it and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
@@ -3534,12 +3534,12 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
}
}
class LLAgentDropGroupViewerNode : public LLHTTPNode
class LLAgentDropGroupViewerNode final : public LLHTTPNode
{
virtual void post(
void post(
LLHTTPNode::ResponsePtr response,
const LLSD& context,
const LLSD& input) const
const LLSD& input) const override
{
if (
@@ -3566,11 +3566,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
//there is only one set of data in the AgentData block
LLSD agent_data = body["AgentData"][0];
LLUUID agent_id;
LLUUID group_id;
agent_id = agent_data["AgentID"].asUUID();
group_id = agent_data["GroupID"].asUUID();
LLUUID agent_id = agent_data["AgentID"].asUUID();
LLUUID group_id = agent_data["GroupID"].asUUID();
if (agent_id != gAgentID)
{
@@ -3585,8 +3582,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
// and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
@@ -3657,8 +3654,8 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
}
@@ -3672,12 +3669,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
}
class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
class LLAgentGroupDataUpdateViewerNode final : public LLHTTPNode
{
virtual void post(
void post(
LLHTTPNode::ResponsePtr response,
const LLSD& context,
const LLSD& input) const
const LLSD& input) const override
{
LLSD body = input["body"];
if(body.has("body"))
@@ -3717,8 +3714,8 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
}
@@ -3919,7 +3916,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
return;
}
if (gAgentAvatarp->isEditingAppearance())
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
{
// ignore baked textures when in customize mode
return;
@@ -4050,6 +4047,7 @@ void LLAgent::clearVisualParams(void *data)
// protected
bool LLAgent::teleportCore(bool is_local)
{
LL_INFOS("Teleport") << "In teleport core!" << LL_ENDL;
if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
{
LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL;
@@ -4067,7 +4065,7 @@ bool LLAgent::teleportCore(bool is_local)
// Stop all animation before actual teleporting
if (isAgentAvatarValid())
{
for ( LLVOAvatar::AnimIterator anim_it= gAgentAvatarp->mPlayingAnimations.begin();
for ( auto anim_it= gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end();
++anim_it)
{
@@ -4086,8 +4084,7 @@ bool LLAgent::teleportCore(bool is_local)
LLFloaterWorldMap::hide();
// hide land floater too - it'll be out of date
if (LLFloaterLand::findInstance())
LLFloaterLand::hideInstance();
if (LLFloaterLand::findInstance()) LLFloaterLand::hideInstance();
LLViewerParcelMgr::getInstance()->deselectLand();
LLViewerMediaFocus::getInstance()->clearFocus();
@@ -4861,7 +4858,7 @@ void LLAgent::sendAgentSetAppearance()
// This means the baked texture IDs on the server will be untouched.
// Once all textures are baked, another AvatarAppearance message will be sent to update the TEs
msg->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0);
gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, nullptr, 0);
}
@@ -4884,9 +4881,7 @@ void LLAgent::sendAgentSetAppearance()
}
LL_INFOS() << "Avatar XML num VisualParams transmitted = " << transmitted_params << LL_ENDL;
if(transmitted_params < 218) {
LLNotificationsUtil::add("SGIncompleteAppearance");
}
if (transmitted_params < 218) LLNotificationsUtil::add("SGIncompleteAppearance");
sendReliableMessage();
}
@@ -4901,8 +4896,96 @@ void LLAgent::sendAgentDataUpdateRequest()
void LLAgent::sendAgentUserInfoRequest()
{
if(getID().isNull())
std::string cap;
if (getID().isNull())
return; // not logged in
if (mRegionp)
cap = mRegionp->getCapability("UserInfo");
if (!cap.empty())
{
LLHTTPClient::get(cap, new LLCoroResponder(
boost::bind(&LLAgent::requestAgentUserInfoCoro, this, _1)));
}
else
{
sendAgentUserInfoRequestMessage();
}
}
void LLAgent::requestAgentUserInfoCoro(const LLCoroResponder& responder)
{
const auto& result = responder.getContent();
const auto& status = responder.getStatus();
if (!responder.isGoodStatus(status))
{
LL_WARNS("UserInfo") << "Failed to get user information: " << result["message"] << "Status " << status << " Reason: " << responder.getReason() << LL_ENDL;
return;
}
bool im_via_email;
bool is_verified_email;
std::string email;
std::string dir_visibility;
im_via_email = result["im_via_email"].asBoolean();
is_verified_email = result["is_verified"].asBoolean();
email = result["email"].asString();
dir_visibility = result["directory_visibility"].asString();
// TODO: This should probably be changed. I'm not entirely comfortable
// having LLAgent interact directly with the UI in this way.
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, email, is_verified_email);
LLFloaterPostcard::updateUserInfo(email);
}
void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility)
{
std::string cap;
if (getID().isNull())
return; // not logged in
if (mRegionp)
cap = mRegionp->getCapability("UserInfo");
if (!cap.empty())
{
LLSD body(LLSDMap
("dir_visibility", LLSD::String(directory_visibility))
("im_via_email", LLSD::Boolean(im_via_email)));
LLHTTPClient::post(cap, body, new LLCoroResponder(
boost::bind(&LLAgent::updateAgentUserInfoCoro, this, _1)));
}
else
{
sendAgentUpdateUserInfoMessage(im_via_email, directory_visibility);
}
}
void LLAgent::updateAgentUserInfoCoro(const LLCoroResponder& responder)
{
const auto& result = responder.getContent();
const auto& status = responder.getStatus();
if (!responder.isGoodStatus(status))
{
LL_WARNS("UserInfo") << "Failed to set user information." << LL_ENDL;
}
else if (!result["success"].asBoolean())
{
LL_WARNS("UserInfo") << "Failed to set user information: " << result["message"] << LL_ENDL;
}
}
// deprecated:
// May be removed when UserInfo cap propagates to all simhosts in grid
void LLAgent::sendAgentUserInfoRequestMessage()
{
gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
@@ -4910,6 +4993,21 @@ void LLAgent::sendAgentUserInfoRequest()
sendReliableMessage();
}
void LLAgent::sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility)
{
gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gAgent.sendReliableMessage();
}
// end deprecated
//------
void LLAgent::observeFriends()
{
if(!mFriendObserver)
@@ -4977,18 +5075,6 @@ const void LLAgent::getTeleportSourceSLURL(LLSLURL& slurl) const
slurl = *mTeleportSourceSLURL;
}
void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility )
{
gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gAgent.sendReliableMessage();
}
void LLAgent::dumpGroupInfo()
{
LL_INFOS() << "group " << mGroupName << LL_ENDL;

View File

@@ -33,8 +33,6 @@
#ifndef LL_LLAGENT_H
#define LL_LLAGENT_H
#include <set>
#include "indra_constants.h"
#include "llevent.h" // LLObservable base class
#include "llagentconstants.h"
@@ -46,7 +44,6 @@
#include "llinventorymodel.h"
#include "v3dmath.h"
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
@@ -70,6 +67,7 @@ class LLAgentAccess;
class LLSLURL;
class LLSimInfo;
class LLTeleportRequest;
struct LLCoroResponder;
typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
@@ -100,7 +98,7 @@ struct LLGroupData
//------------------------------------------------------------------------
// LLAgent
//------------------------------------------------------------------------
class LLAgent : public LLOldEvents::LLObservable
class LLAgent final : public LLOldEvents::LLObservable
{
LOG_CLASS(LLAgent);
@@ -248,7 +246,7 @@ public:
void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary
// Register a boost callback to be called when the agent changes parcels
typedef boost::function<void()> parcel_changed_callback_t;
typedef std::function<void()> parcel_changed_callback_t;
boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t);
private:
@@ -786,7 +784,7 @@ public:
void requestEnterGodMode();
void requestLeaveGodMode();
typedef boost::function<void (U8)> god_level_change_callback_t;
typedef std::function<void (U8)> god_level_change_callback_t;
typedef boost::signals2::signal<void (U8)> god_level_change_signal_t;
typedef boost::signals2::connection god_level_change_slot_t;
@@ -808,7 +806,7 @@ public:
bool canAccessMature() const;
bool canAccessAdult() const;
bool canAccessMaturityInRegion( U64 region_handle ) const;
bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const;
bool canAccessMaturityAtGlobal( const LLVector3d& pos_global ) const;
bool prefersPG() const;
bool prefersMature() const;
bool prefersAdult() const;
@@ -965,9 +963,17 @@ public:
void sendAgentSetAppearance();
void sendAgentDataUpdateRequest();
void sendAgentUserInfoRequest();
// IM to Email and Online visibility
// IM to Email and Online visibility
void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility);
private:
void requestAgentUserInfoCoro(const LLCoroResponder& responder);
void updateAgentUserInfoCoro(const LLCoroResponder& responder);
// DEPRECATED: may be removed when User Info cap propagates
void sendAgentUserInfoRequestMessage();
void sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility);
//--------------------------------------------------------------------
// Receive
//--------------------------------------------------------------------

View File

@@ -47,6 +47,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llimprocessing.h"
#include "llwindow.h"
#include "llviewerstats.h"
#include "llmarketplacefunctions.h"
@@ -430,27 +431,6 @@ static void ui_audio_callback(const LLUUID& uuid)
}
}
void request_initial_instant_messages()
{
static BOOL requested = FALSE;
if (!requested
&& gMessageSystem
&& LLMuteList::getInstance()->isLoaded()
&& isAgentAvatarValid())
{
// Auto-accepted inventory items may require the avatar object
// to build a correct name. Likewise, inventory offers from
// muted avatars require the mute list to properly mute.
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RetrieveInstantMessages);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
requested = TRUE;
}
}
// Use these strictly for things that are constructed at startup,
// or for things that are performance critical. JC
static void settings_to_globals()
@@ -4050,7 +4030,7 @@ void LLAppViewer::idle()
// here.
{
LAZY_FT("request_initial_instant_messages");
request_initial_instant_messages();
LLIMProcessing::requestOfflineMessages();
}
///////////////////////////////////

View File

@@ -333,9 +333,9 @@ void LLPreferenceCore::onTabChanged(LLUICtrl* ctrl)
}
void LLPreferenceCore::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
void LLPreferenceCore::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified)
{
mPrefsIM->setPersonalInfo(visibility, im_via_email, email);
mPrefsIM->setPersonalInfo(visibility, im_via_email, email, is_verified);
}
//////////////////////////////////////////////
@@ -408,15 +408,7 @@ void LLFloaterPreference::show(void*)
sInstance->open(); /* Flawfinder: ignore */
if(!gAgent.getID().isNull())
{
// we're logged in, so we can get this info.
gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
}
gAgent.sendAgentUserInfoRequest();
LLPanelLogin::setAlwaysRefresh(true);
}
@@ -496,11 +488,11 @@ void LLFloaterPreference::onBtnCancel()
// static
void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email)
void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified)
{
if(sInstance && sInstance->mPreferenceCore)
if (sInstance && sInstance->mPreferenceCore)
{
sInstance->mPreferenceCore->setPersonalInfo(visibility, im_via_email, email);
sInstance->mPreferenceCore->setPersonalInfo(visibility, im_via_email, email, is_verified);
}
}

View File

@@ -73,7 +73,7 @@ public:
LLTabContainer* getTabContainer() { return mTabContainer; }
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified);
static void onTabChanged(LLUICtrl* ctrl);
@@ -109,7 +109,7 @@ public:
static void show(void*);
// static data update, called from message handler
static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email);
static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified = false);
static void switchTab(S32 i);

View File

@@ -1656,8 +1656,6 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
S32 name_length = mCompletingRegionName.length();
LLSD match;
S32 num_results = 0;
@@ -1671,7 +1669,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim)
std::string sim_name_lower = info->getName();
LLStringUtil::toLower(sim_name_lower);
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
if (sim_name_lower.substr(0, mCompletingRegionName) != std::string::npos)
{
if (sim_name_lower == mCompletingRegionName)
{

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
/**
* @file LLIMMgr.h
* @brief Container for Instant Messaging
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLIMPROCESSING_H
#define LL_LLIMPROCESSING_H
#include "llinstantmessage.h"
struct LLCoroResponder;
std::string replace_wildcards(std::string input, const LLUUID& id, const std::string& name);
bool handle_obj_auth(const LLUUID& from_id, const std::string& mesg);
class LLIMProcessing
{
public:
// Pre-process message for IM manager
static void processNewMessage(LLUUID from_id,
BOOL from_group,
LLUUID to_id,
U8 offline,
EInstantMessage dialog, // U8
LLUUID session_id,
U32 timestamp,
std::string agentName,
std::string message,
U32 parent_estate_id,
LLUUID region_id,
LLVector3 position,
U8 *binary_bucket,
S32 binary_bucket_size,
LLHost &sender,
LLUUID aux_id = LLUUID::null);
// Either receives list of offline messages from 'ReadOfflineMsgs' capability
// or uses legacy method
static void requestOfflineMessages();
private:
static void requestOfflineMessagesCoro(const LLCoroResponder& responder);
static void requestOfflineMessagesLegacy();
};
#endif // LL_LLLLIMPROCESSING_H

View File

@@ -63,7 +63,7 @@ public:
void apply();
void cancel();
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified);
void enableHistory();
static void onClickLogPath(void* user_data);
@@ -193,13 +193,6 @@ void LLPrefsIMImpl::apply()
if((new_im_via_email != mOriginalIMViaEmail)
||(new_hide_online != mOriginalHideOnlineStatus))
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UpdateUserInfo);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_UserData);
msg->addBOOLFast(_PREHASH_IMViaEMail, new_im_via_email);
// This hack is because we are representing several different
// possible strings with a single checkbox. Since most users
// can only select between 2 values, we represent it as a
@@ -212,8 +205,7 @@ void LLPrefsIMImpl::apply()
//Update showonline value, otherwise multiple applys won't work
mOriginalHideOnlineStatus = new_hide_online;
}
msg->addString("DirectoryVisibility", mDirectoryVisibility);
gAgent.sendReliableMessage();
gAgent.sendAgentUpdateUserInfo(new_im_via_email, mDirectoryVisibility);
}
}
else
@@ -227,7 +219,7 @@ void LLPrefsIMImpl::apply()
}
}
void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified)
{
mGotPersonalInfo = true;
mOriginalIMViaEmail = im_via_email;
@@ -254,8 +246,13 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e
childSetValue("online_visibility", mOriginalHideOnlineStatus);
childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
childEnable("send_im_to_email");
childSetValue("send_im_to_email", im_via_email);
if (auto child = getChildView("send_im_to_email"))
{
child->setValue(im_via_email);
child->setEnabled(is_verified);
if (!is_verified)
child->setToolTip(getString("email_unverified_tooltip"));
}
childEnable("log_instant_messages");
childEnable("log_chat");
childEnable("log_instant_messages_timestamp");
@@ -332,9 +329,9 @@ void LLPrefsIM::cancel()
impl.cancel();
}
void LLPrefsIM::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
void LLPrefsIM::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified)
{
impl.setPersonalInfo(visibility, im_via_email, email);
impl.setPersonalInfo(visibility, im_via_email, email, is_verified);
}
LLPanel* LLPrefsIM::getPanel()

View File

@@ -45,7 +45,7 @@ public:
void apply();
void cancel();
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email, bool is_verified);
LLPanel* getPanel();

File diff suppressed because it is too large Load Diff

View File

@@ -70,6 +70,11 @@ enum InventoryOfferResponse
BOOL can_afford_transaction(S32 cost);
void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE,
S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null);
void send_join_group_response(const LLUUID& group_id,
const LLUUID& transaction_id,
bool accept_invite,
S32 fee,
bool use_offline_cap);
void process_logout_reply(LLMessageSystem* msg, void**);
void process_layer_data(LLMessageSystem *mesgsys, void **user_data);
@@ -205,7 +210,6 @@ void process_decline_callingcard(LLMessageSystem* msg, void**);
// Message system exception prototypes
void invalid_message_callback(LLMessageSystem*, void*, EMessageException);
void process_initiate_download(LLMessageSystem* msg, void**);
void start_new_inventory_observer();
void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name);

View File

@@ -1972,6 +1972,8 @@ void LLViewerRegion::unpackRegionHandshake()
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
{
capabilityNames.append("AbuseCategories");
capabilityNames.append("AcceptFriendship");
capabilityNames.append("AcceptGroupInvite"); // ReadOfflineMsgs recieved messages only!!!
capabilityNames.append("AgentPreferences");
capabilityNames.append("AgentState");
capabilityNames.append("AttachmentResources");
@@ -1982,6 +1984,8 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("CopyInventoryFromNotecard");
capabilityNames.append("CreateInventoryCategory");
capabilityNames.append("CustomMenuAction");
capabilityNames.append("DeclineFriendship");
capabilityNames.append("DeclineGroupInvite"); // ReadOfflineMsgs recieved messages only!!!
capabilityNames.append("DispatchRegionInfo");
capabilityNames.append("DirectDelivery");
capabilityNames.append("EnvironmentSettings");
@@ -2065,6 +2069,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("UpdateScriptAgent");
capabilityNames.append("UpdateScriptTask");
capabilityNames.append("UploadBakedTexture");
capabilityNames.append("UserInfo");
capabilityNames.append("ViewerAsset");
capabilityNames.append("ViewerMetrics");
capabilityNames.append("ViewerStartAuction");

View File

@@ -7742,10 +7742,6 @@ An object named [OBJECTFROMNAME] owned by [NAME] has given you a [OBJECTTYPE] na
index="1"
name="Cancel"
text="Cancel"/>
<button
index="3"
name="Profile"
text="Profile"/>
</form>
</notification>
@@ -7778,10 +7774,6 @@ Offer a teleport?
index="1"
name="No"
text="No"/>
<button
index="3"
name="Profile"
text="Profile"/>
</form>
</notification>
@@ -7811,7 +7803,7 @@ Offer a teleport?
type="notify">
<tag>friendship</tag>
<tag>confirm</tag>
[NAME] is offering friendship.
[NAME_SLURL] is offering friendship.
[MESSAGE]
@@ -7829,7 +7821,6 @@ Offer a teleport?
index="2"
name="Ignore"
text="Ignore"/>
<button index="3" name="Profile" text="Profile"/>
</form>
</notification>
@@ -7848,7 +7839,7 @@ Offer a teleport?
persist="true"
type="notify">
<tag>friendship</tag>
[NAME] is offering friendship.
[NAME_SLURL] is offering friendship.
(By default, you will be able to see each other&apos;s online status.)
<form name="form">
@@ -7864,7 +7855,6 @@ Offer a teleport?
index="2"
name="Ignore"
text="Ignore"/>
<button index="3" name="Profile" text="Profile"/>
</form>
</notification>
@@ -7887,6 +7877,24 @@ Offer a teleport?
[NAME] declined your friendship offer.
</notification>
<notification
icon="notify.tga"
name="FriendshipAcceptedByMe"
log_to_im="true"
type="notifytip">
<tag>friendship</tag>
Accepted friendship offer from [NAME_SLURL]. [MESSAGE]
</notification>
<notification
icon="notify.tga"
name="FriendshipDeclinedByMe"
log_to_im="true"
type="notifytip">
<tag>friendship</tag>
Declined friendship offer from [NAME_SLURL]. [MESSAGE]
</notification>
<notification
icon="alertmodal.tga"
name="FriendshipDissolved"

View File

@@ -4,10 +4,11 @@
<check_box bottom="-25" height="16" initial_value="false" label="Only my Friends and Groups can see when I am online" left="148" name="online_visibility"/>
<text bottom="-40" height="10" left="12" name="text_box2">IM Options:</text>
<string name="log_in_to_change">log in to change</string>
<check_box bottom="-45" height="16" initial_value="false" label="Send IM to Email ([EMAIL])" left="148" name="send_im_to_email"/>
<check_box bottom="-65" height="16" initial_value="false" label="Include IM in chat console" name="include_im_in_chat_console"/>
<check_box bottom="-85" height="16" initial_value="false" label="Show timestamps in IM" name="show_timestamps_check"/>
<check_box bottom="-105" height="16" initial_value="false" label="Show online Friend notifications" name="friends_online_notify_checkbox"/>
<string name="email_unverified_tooltip">Please verify your email to enable IM to Email. You can do so on the grid's website.</string>
<check_box bottom_delta="-5" follows="top|left" height="16" label="Send IM to Email ([EMAIL])" left="148" name="send_im_to_email"/>
<check_box bottom_delta="-20" follows="top|left" height="16" label="Include IM in chat console" name="include_im_in_chat_console"/>
<check_box bottom_delta="-20" follows="top|left" height="16" label="Show timestamps in IM" name="show_timestamps_check"/>
<check_box bottom_delta="-20" follows="top|left" height="16" label="Show online Friend notifications" name="friends_online_notify_checkbox"/>
<text bottom_delta="-15" follows="top|left" left_delta="4" name="conference_block_text">Incoming conferences:</text>
<radio_group follows="top|left" bottom_delta="-6" left_delta="120" height="16" width="204" draw_border="true" control_name="LiruBlockConferences" name="block_conferences_radio">
<radio_item bottom_delta="0" name="accept" width="30" value="0">Accept</radio_item>