static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name, bool web) { if (gSavedSettings.getString("WebProfileURL").empty() || !(web || gSavedSettings.getBOOL("UseWebProfiles"))) { LLFloaterAvatarInfo* floater = LLFloaterAvatarInfo::getInstance(agent_id); if(!floater) { floater = new LLFloaterAvatarInfo(av_name.getCompleteName()+" - "+LLTrans::getString("Command_Profile_Label"), agent_id); floater->center(); } // ...bring that window to front floater->open(); /*Flawfinder: ignore*/ } else { std::string username = av_name.mUsername; if (username.empty()) { username = LLCacheName::buildUsername(av_name.mDisplayName); } llinfos << "opening web profile for " << username << llendl; std::string url = getProfileURL(username); // PROFILES: open in webkit window LLFloaterWebContent::Params p; p.url(url). id(agent_id.asString()); LLFloaterWebProfile::showInstance(get_profile_floater_name(agent_id), p); } }
bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { if (params.size() < 1) return false; std::string agent_name = params[0]; LL_INFOS() << "Profile, agent_name " << agent_name << LL_ENDL; std::string url = getProfileURL(agent_name); LLWeb::loadURLInternal(url); return true; }
// static void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location) { // Get upload configuration data. std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config"); config_url += "?caption=" + LLURI::escape(caption); config_url += "&add_loc=" + std::string(add_location ? "1" : "0"); LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); headers["Cookie"] = getAuthCookie(); LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); }
// static void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location) { // Get upload configuration data. std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config"); config_url += "?caption=" + LLURI::escape(caption); config_url += "&add_loc=" + std::string(add_location ? "1" : "0"); LL_DEBUGS("Snapshots") << "Requesting " << config_url << LL_ENDL; AIHTTPHeaders headers; headers.addHeader("Accept", "*/*"); headers.addHeader("Cookie", LLWebProfile::getAuthCookie()); headers.addHeader("User-Agent", LLViewerMedia::getCurrentUserAgent()); LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); }