// static void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids) { if(ids.size() == 0) return; LLSD args; std::string msgType; if(ids.size() == 1) { LLUUID agent_id = ids[0]; std::string av_name; if(LLAvatarNameCache::getPNSName(agent_id, av_name)) { args["NAME"] = av_name; } msgType = "RemoveFromFriends"; } else { msgType = "RemoveMultipleFromFriends"; } LLSD payload; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { payload["ids"].append(*it); } LLNotificationsUtil::add(msgType, args, payload, &handleRemove); }
// static void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids) { if(ids.size() == 0) return; LLSD args; std::string msgType; if(ids.size() == 1) { LLUUID agent_id = ids[0]; std::string first, last; if(gCacheName->getName(agent_id, first, last)) { args["FIRST_NAME"] = first; args["LAST_NAME"] = last; } msgType = "RemoveFromFriends"; } else { msgType = "RemoveMultipleFromFriends"; } LLSD payload; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { payload["ids"].append(*it); } LLNotificationsUtil::add(msgType, args, payload, &handleRemove); }
// static void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids, const LLUUID& floater_id) { if (ids.size() == 0) { return; } // convert vector into std::vector for addSession std::vector<LLUUID> id_array; id_array.reserve(ids.size()); for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { id_array.push_back(*it); } // create the new ad hoc voice session const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array, true, floater_id); if (session_id == LLUUID::null) { return; } gIMMgr->autoStartCallOnStartup(session_id); make_ui_sound("UISndStartIM"); }
// static void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids) { if (ids.size() == 0) { return; } for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { // [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0) const LLUUID& idAgent = *it; if (!RlvActions::canStartIM(idAgent)) { make_ui_sound("UISndInvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF); return; } // [/RLVa:KB] // id_array.push_back(*it); } // create the new ad hoc voice session const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], ids); if (session_id.isNull()) { return; } gIMMgr->autoStartCallOnStartup(session_id); make_ui_sound("UISndStartIM"); }
void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items) { for (uuid_vec_t::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) { const LLUUID& item_id = (*item_iter); if(!highlight_offered_object(item_id)) { continue; } LLInventoryItem* item = gInventory.getItem(item_id); llassert(item); if (item && (LLAssetType::AT_LANDMARK == item->getType()) ) { // Created landmark is passed to Places panel to allow its editing. // If the panel is closed we don't reopen it until created landmark is loaded. if("create_landmark" == getPlaceInfoType() && !getItem()) { setItem(item); } } } }
// static void LLListContextMenu::handleMultiple(functor_t functor, const uuid_vec_t& ids) { uuid_vec_t::const_iterator it; for (it = ids.begin(); it != ids.end(); ++it) { functor(*it); } }
void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { std::string fullname; LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); if(dest && dest->isAvatar()) { LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { fullname = LLCacheName::buildFullName( nvfirst->getString(), nvlast->getString()); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl; names.push_back("(Unknown)"); } } else { //looks like user try to invite offline friend //for offline avatar_id gObjectList.findObject() will return null //so we need to do this additional search in avatar tracker, see EXT-4732 //if (LLAvatarTracker::instance().isBuddy(agent_id)) // Singu Note: We may be using this from another avatar list like group profile, disregard friendship status. { LLAvatarName av_name; if (!LLAvatarNameCache::get(agent_id, &av_name)) { // actually it should happen, just in case LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2)); // for this special case! //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence // removed id will be added in callback agent_ids.erase(agent_ids.begin() + i); } else { std::string name; LLAvatarNameCache::getPNSName(av_name, name); names.push_back(name); } } } } mImplementation->mListFullNotificationSent = false; mImplementation->addUsers(names, agent_ids); }
// static void LLPanelFriends::onClickPay(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); if(!ids.empty()) { LLAvatarActions::pay(ids[0]); } }
// static void LLPanelFriends::onClickProfile(void* user_data) { LLPanelFriends* panelp = (LLPanelFriends*)user_data; //llinfos << "LLPanelFriends::onClickProfile()" << llendl; const uuid_vec_t ids = panelp->mFriendsList->getSelectedIDs(); if(!ids.empty()) { LLAvatarActions::showProfile(ids[0]); } }
// Checked: 2010-11-30 (RLVa-1.3.0b) | Modified: RLVa-1.3.0b bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems, bool fClear) { if (fClear) idItems.clear(); uuid_vec_t::size_type cntItemsPrev = idItems.size(); for (S32 idxWearable = 0, cntWearable = gAgentWearables.getWearableCount(wtType); idxWearable < cntWearable; idxWearable++) { idItems.push_back(gAgentWearables.getWearableItemID(wtType, idxWearable)); } return (cntItemsPrev != idItems.size()); }
void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLUUID agent_id = agent_ids[i]; LLViewerObject* dest = gObjectList.findObject(agent_id); std::string fullname; if(dest && dest->isAvatar()) { LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); } if (!fullname.empty()) { names.push_back(fullname); } else { llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; names.push_back("(Unknown)"); } } else { //looks like user try to invite offline friend //for offline avatar_id gObjectList.findObject() will return null //so we need to do this additional search in avatar tracker, see EXT-4732 if (LLAvatarTracker::instance().isBuddy(agent_id)) { if (!gCacheName->getFullName(agent_id, fullname)) { // actually it should happen, just in case gCacheName->get(LLUUID(agent_id), false, boost::bind( &LLPanelGroupInvite::addUserCallback, this, _1, _2, _3)); // for this special case! //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence // removed id will be added in callback agent_ids.erase(agent_ids.begin() + i); } else { names.push_back(fullname); } } } } mImplementation->addUsers(names, agent_ids); }
// static bool LLAvatarActions::canOfferTeleport(const uuid_vec_t& ids) { bool result = true; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { if(!canOfferTeleport(*it)) { result = false; break; } } return result; }
// Checked: 2010-11-30 (RLVa-1.3.0b) | Modified: RLVa-1.3.0b bool RlvCommandOptionGetPath::getItemIDs(const LLViewerJointAttachment* pAttachPt, uuid_vec_t& idItems, bool fClear) { if (fClear) idItems.clear(); uuid_vec_t::size_type cntItemsPrev = idItems.size(); if (pAttachPt) { for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator itAttachObj = pAttachPt->mAttachedObjects.begin(); itAttachObj != pAttachPt->mAttachedObjects.end(); ++itAttachObj) { idItems.push_back((*itAttachObj)->getAttachmentItemID()); } } return (cntItemsPrev != idItems.size()); }
bool LLPanelPeople::isItemsFreeOfFriends(const uuid_vec_t& uuids) { const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); for ( uuid_vec_t::const_iterator id = uuids.begin(), id_end = uuids.end(); id != id_end; ++id ) { if (av_tracker.isBuddy (*id)) { return false; } } return true; }
void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const { // Collect selected items from all selected lists. for (wearables_lists_map_t::const_iterator iter = mSelectedListsMap.begin(); iter != mSelectedListsMap.end(); ++iter) { uuid_vec_t uuids; (*iter).second->getSelectedUUIDs(uuids); S32 prev_size = selected_uuids.size(); selected_uuids.resize(prev_size + uuids.size()); std::copy(uuids.begin(), uuids.end(), selected_uuids.begin() + prev_size); } }
// Checked: 2013-10-12 (RLVa-1.4.9) bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems) { uuid_vec_t::size_type cntItemsPrev = idItems.size(); LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items; LLFindWearablesOfType f(wtType); gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), folders, items, false, f); for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem) { const LLViewerInventoryItem* pItem = *itItem; if (pItem) idItems.push_back(pItem->getLinkedUUID()); } return (cntItemsPrev != idItems.size()); }
// static void LLAvatarActions::startConference(const uuid_vec_t& ids) { // *HACK: Copy into dynamic array LLDynamicArray<LLUUID> id_array; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { id_array.push_back(*it); } const std::string title = LLTrans::getString("conference-title"); LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array); if (session_id != LLUUID::null) { LLIMFloater::show(session_id); } make_ui_sound("UISndStartIM"); }
static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector<LLAvatarName>& avatar_names) { std::vector<LLScrollListItem*> items = from->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter) { LLScrollListItem* item = *iter; if (item->getUUID().notNull()) { avatar_ids.push_back(item->getUUID()); std::map<LLUUID, LLAvatarName>::iterator iter = sAvatarNameMap.find(item->getUUID()); if (iter != sAvatarNameMap.end()) { avatar_names.push_back(iter->second); } else { // the only case where it isn't in the name map is friends // but it should be in the name cache LLAvatarName av_name; LLAvatarNameCache::get(item->getUUID(), &av_name); avatar_names.push_back(av_name); } } } }
// static void LLPanelFriends::onPickAvatar( const uuid_vec_t& ids, const std::vector<LLAvatarName>& names ) { if (names.empty()) return; if (ids.empty()) return; LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName()); }
//static void LLPanelGroupInvite::impl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data) { std::vector<std::string> names; for (S32 i = 0; i < (S32)agent_ids.size(); i++) { LLAvatarName av_name; if (LLAvatarNameCache::get(agent_ids[i], &av_name)) { LLPanelGroupInvite::impl::onAvatarNameCache(agent_ids[i], av_name, user_data); } else { impl* selfp = (impl*) user_data; if (selfp) { if (selfp->mAvatarNameCacheConnection.connected()) { selfp->mAvatarNameCacheConnection.disconnect(); } // *TODO : Add a callback per avatar name being fetched. selfp->mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_ids[i],boost::bind(&LLPanelGroupInvite::impl::onAvatarNameCache, _1, _2, user_data)); } } } }
void LLPanelBlockedList::callbackBlockPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (names.empty() || ids.empty()) return; LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT); LLMuteList::getInstance()->add(mute); showPanelAndSelect(mute.mID); }
/** * Performs "give inventory" operations for provided avatars. * * Sends one requests to give all selected inventory items for each passed avatar. * Avatars are represent by two vectors: names and UUIDs which must be sychronized with each other. * * @param avatar_names - avatar names request to be sent. * @param avatar_uuids - avatar names request to be sent. */ static void give_inventory(const std::vector<std::string>& avatar_names, const uuid_vec_t& avatar_uuids) { llassert(avatar_names.size() == avatar_uuids.size()); LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (!active_panel) { active_panel = get_outfit_editor_inventory_panel(); if (!active_panel) return; } const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); if (inventory_selected_uuids.empty()) { return; } std::string residents; build_residents_string(avatar_names, residents); std::string items; build_items_string(inventory_selected_uuids, items); LLSD substitutions; substitutions["RESIDENTS"] = residents; substitutions["ITEMS"] = items; LLShareInfo::instance().mAvatarNames = avatar_names; LLShareInfo::instance().mAvatarUuids = avatar_uuids; LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, LLSD(), &give_inventory_cb); }
void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids) { if (names.empty() || ids.empty()) return; LLMute mute(ids[0], names[0], LLMute::AGENT); LLMuteList::getInstance()->add(mute); showPanelAndSelect(mute.mID); }
// static void LLAvatarActions::offerTeleport(const uuid_vec_t& ids) { if (ids.size() == 0) return; handle_lure(ids); }
void LLPanelObjectTools::callbackAvatarID(const uuid_vec_t& ids, const std::vector<LLAvatarName> names) { if (ids.empty() || names.empty()) return; mTargetAvatar = ids[0]; getChild<LLUICtrl>("target_avatar_name")->setValue(names[0].getCompleteName()); refresh(); }
bool LLCOFWearables::getSelectedUUIDs(uuid_vec_t& selected_ids) { if (!mLastSelectedList) return false; mLastSelectedList->getSelectedUUIDs(selected_ids); return selected_ids.size() != 0; }
//----------------------------------------------------------------------------- // onPickUser() //----------------------------------------------------------------------------- void LLFloaterMute::onPickUser(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names) { if (names.empty() || ids.empty()) return; LLMute mute(ids[0], names[0].getLegacyName(), LLMute::AGENT); LLMuteList::getInstance()->add(mute); updateButtons(); }
// static bool LLAvatarActions::canOfferTeleport(const uuid_vec_t& ids) { // We can't send more than 250 lures in a single message, so disable this // button when there are too many id's selected. if(ids.size() > 250) return false; bool result = true; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { if(!canOfferTeleport(*it)) { result = false; break; } } return result; }
void LLFloaterGesture::getSelectedIds(uuid_vec_t& ids) { std::vector<LLScrollListItem*> items = mGestureList->getAllSelected(); for(std::vector<LLScrollListItem*>::const_iterator it = items.begin(); it != items.end(); it++) { ids.push_back((*it)->getUUID()); } }
void LLPanelFriends::updateFriends(U32 changed_mask) { LLUUID selected_id; LLCtrlListInterface *friends_list = childGetListInterface("friend_list"); if (!friends_list) return; LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list"); if (!friends_scroll) return; // We kill the selection warning, otherwise we'll spam with warning popups // if the maximum amount of friends are selected mShowMaxSelectWarning = false; const uuid_vec_t selected_friends = mFriendsList->getSelectedIDs(); if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) { refreshNames(changed_mask); } else if(changed_mask & LLFriendObserver::POWERS) { --mNumRightsChanged; if(mNumRightsChanged > 0) { mPeriod = RIGHTS_CHANGE_TIMEOUT; mEventTimer.start(); mAllowRightsChange = FALSE; } else { tick(); } } if(!selected_friends.empty()) { // only non-null if friends was already found. This may fail, // but we don't really care here, because refreshUI() will // clean up the interface. friends_list->setCurrentByID(selected_id); for(uuid_vec_t::const_iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr) { friends_list->setSelectedByValue(*itr, true); } } refreshUI(); mShowMaxSelectWarning = true; }