// virtual void LLPanelDirPeople::performQuery() { if (childGetValue("name").asString().length() < mMinSearchChars) { return; } // filter short words out of the query string // and indidate if we did have to filter it // The shortest username is 2 characters long. // *fix This is no longer true, M Linden is a exception that demonstrates the invalidity of this assumption. std::string query_string = childGetValue("name").asString(); /*const S32 SHORTEST_WORD_LEN = 2; bool query_was_filtered = false; std::string query_string = LLPanelDirBrowser::filterShortWords( childGetValue("name").asString(), SHORTEST_WORD_LEN, query_was_filtered ); // possible we threw away all the short words in the query so check length if ( query_string.length() < mMinSearchChars ) { LLNotifications::instance().add("SeachFilteredOnShortWordsEmpty"); return; }; // if we filtered something out, display a popup if ( query_was_filtered ) { LLSD args; args["FINALQUERY"] = query_string; LLNotifications::instance().add("SeachFilteredOnShortWords", args); };*/ setupNewSearch(); U32 scope = DFQ_PEOPLE; // send the message sendDirFindQuery( gMessageSystem, mSearchID, query_string, scope, mSearchStart); }
// virtual void LLPanelDirGroups::performQuery() { if (childGetValue("name").asString().length() < mMinSearchChars) { return; } BOOL inc_pg = childGetValue("incpg").asBoolean(); BOOL inc_mature = childGetValue("incmature").asBoolean(); BOOL inc_adult = childGetValue("incadult").asBoolean(); if (!(inc_pg || inc_mature || inc_adult)) { LLNotifyBox::showXml("NoContentToSearch"); return; } setupNewSearch(); // groups U32 scope = DFQ_GROUPS; if (inc_pg) { scope |= DFQ_INC_PG; } if (inc_mature) { scope |= DFQ_INC_MATURE; } if (inc_adult) { scope |= DFQ_INC_ADULT; } mCurrentSortColumn = "score"; mCurrentSortAscending = FALSE; // send the message sendDirFindQuery( gMessageSystem, mSearchID, childGetValue("name").asString(), scope, mSearchStart); }
void LLPanelDirEvents::performQueryOrDelete(U32 event_id) { S32 relative_day = mDay; // Update the date field to show the date IN THE SERVER'S // TIME ZONE, as that is what will be displayed in each event // Get time UTC time_t utc_time = time_corrected(); // Correct for offset utc_time += relative_day * 24 * 60 * 60; // There's only one internal tm buffer. struct tm* internal_time; // Convert to Pacific, based on server's opinion of whether // it's daylight savings time there. internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); std::string date; timeStructToFormattedString(internal_time, "%m-%d", date); childSetValue("date_text", date); // Record the relative day so back and forward buttons // offset from this day. mDay = relative_day; mDoneQuery = TRUE; U32 scope = DFQ_DATE_EVENTS; if ( gAgent.wantsPGOnly()) scope |= DFQ_PG_SIMS_ONLY; if ( childGetValue("incpg").asBoolean() ) scope |= DFQ_INC_PG; if ( childGetValue("incmature").asBoolean() ) scope |= DFQ_INC_MATURE; if ( childGetValue("incadult").asBoolean() ) scope |= DFQ_INC_ADULT; if (childGetValue("filter_gaming").asBoolean()) scope |= DFQ_FILTER_GAMING; // Add old query flags in case we are talking to an old server if ( childGetValue("incpg").asBoolean() && !childGetValue("incmature").asBoolean()) { scope |= DFQ_PG_EVENTS_ONLY; } if ( !( scope & (DFQ_INC_PG | DFQ_INC_MATURE | DFQ_INC_ADULT ))) { LLNotificationsUtil::add("NoContentToSearch"); return; } setupNewSearch(); std::ostringstream params; // Date mode for the search if ("current" == childGetValue("date_mode").asString()) { params << "u|"; } else { params << mDay << "|"; } // Categories are stored in the database in table indra.event_category // XML must match. U32 cat_id = childGetValue("category combo").asInteger(); params << cat_id << "|"; params << childGetValue("event_search_text").asString(); // send the message if (0 == event_id) { sendDirFindQuery(gMessageSystem, mSearchID, params.str(), scope, mSearchStart); } else { // This delete will also perform a query. LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_EventGodDelete); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_EventData); msg->addU32Fast(_PREHASH_EventID, event_id); msg->nextBlockFast(_PREHASH_QueryData); msg->addUUIDFast(_PREHASH_QueryID, mSearchID); msg->addStringFast(_PREHASH_QueryText, params.str()); msg->addU32Fast(_PREHASH_QueryFlags, scope); msg->addS32Fast(_PREHASH_QueryStart, mSearchStart); gAgent.sendReliableMessage(); } }
// virtual void LLPanelDirGroups::performQuery() { std::string group_name = childGetValue("name").asString(); if (group_name.length() < mMinSearchChars) { return; } // "hi " is three chars but not a long-enough search std::string query_string = group_name; LLStringUtil::trim( query_string ); bool query_was_filtered = (query_string != group_name); // possible we threw away all the short words in the query so check length if ( query_string.length() < mMinSearchChars ) { LLNotifications::instance().add("SeachFilteredOnShortWordsEmpty"); return; }; BOOL inc_pg = childGetValue("incpg").asBoolean(); BOOL inc_mature = childGetValue("incmature").asBoolean(); BOOL inc_adult = childGetValue("incadult").asBoolean(); if (!(inc_pg || inc_mature || inc_adult)) { LLNotifications::instance().add("NoContentToSearch"); return; } // if we filtered something out, display a popup if ( query_was_filtered ) { LLSD args; args["[FINALQUERY]"] = query_string; LLNotifications::instance().add("SeachFilteredOnShortWords", args); }; setupNewSearch(); // groups U32 scope = DFQ_GROUPS; if (inc_pg) { scope |= DFQ_INC_PG; } if (inc_mature) { scope |= DFQ_INC_MATURE; } if (inc_adult) { scope |= DFQ_INC_ADULT; } mCurrentSortColumn = "score"; mCurrentSortAscending = FALSE; // send the message sendDirFindQuery( gMessageSystem, mSearchID, query_string, scope, mSearchStart); }
// static void LLPanelDirFindAllOld::onClickSearch(void *userdata) { LLPanelDirFindAllOld *self = (LLPanelDirFindAllOld *)userdata; if (self->childGetValue("name").asString().length() < self->mMinSearchChars) { return; }; BOOL inc_pg = self->childGetValue("incpg").asBoolean(); BOOL inc_mature = self->childGetValue("incmature").asBoolean(); BOOL inc_adult = self->childGetValue("incadult").asBoolean(); if (!(inc_pg || inc_mature || inc_adult)) { LLNotificationsUtil::add("NoContentToSearch"); return; } self->setupNewSearch(); // Figure out scope U32 scope = 0x0; scope |= DFQ_PEOPLE; // people (not just online = 0x01 | 0x02) // places handled below scope |= DFQ_EVENTS; // events scope |= DFQ_GROUPS; // groups if (inc_pg) { scope |= DFQ_INC_PG; } if (inc_mature) { scope |= DFQ_INC_MATURE; } if (inc_adult) { scope |= DFQ_INC_ADULT; } if (self->childGetValue("filter_gaming").asBoolean()) { scope |= DFQ_FILTER_GAMING; } // send the message LLMessageSystem *msg = gMessageSystem; S32 start_row = 0; sendDirFindQuery(msg, self->mSearchID, self->childGetValue("name").asString(), scope, start_row); // Also look up classified ads. JC 12/2005 BOOL filter_auto_renew = FALSE; U32 classified_flags = pack_classified_flags_request(filter_auto_renew, inc_pg, inc_mature, inc_adult); msg->newMessage("DirClassifiedQuery"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("QueryData"); msg->addUUID("QueryID", self->mSearchID); msg->addString("QueryText", self->childGetValue("name").asString()); msg->addU32("QueryFlags", classified_flags); msg->addU32("Category", 0); // all categories msg->addS32("QueryStart", 0); gAgent.sendReliableMessage(); // Need to use separate find places query because places are // sent using the more compact DirPlacesReply message. U32 query_flags = DFQ_DWELL_SORT; if (inc_pg) { query_flags |= DFQ_INC_PG; } if (inc_mature) { query_flags |= DFQ_INC_MATURE; } if (inc_adult) { query_flags |= DFQ_INC_ADULT; } msg->newMessage("DirPlacesQuery"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID() ); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("QueryData"); msg->addUUID("QueryID", self->mSearchID ); msg->addString("QueryText", self->childGetValue("name").asString()); msg->addU32("QueryFlags", query_flags ); msg->addS32("QueryStart", 0 ); // Always get the first 100 when using find ALL msg->addS8("Category", LLParcel::C_ANY); msg->addString("SimName", NULL); gAgent.sendReliableMessage(); }
void LLPanelDirEvents::performQueryOrDelete(U32 event_id) { S32 relative_day = mDay; // Update the date field to show the date IN THE SERVER'S // TIME ZONE, as that is what will be displayed in each event // Get time UTC time_t utc_time = time_corrected(); // Correct for offset utc_time += relative_day * 24 * 60 * 60; // There's only one internal tm buffer. struct tm* internal_time; // Convert to Pacific, based on server's opinion of whether // it's daylight savings time there. internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); std::string buffer = llformat("%d/%d", 1 + internal_time->tm_mon, // Jan = 0 internal_time->tm_mday); // 2001 = 101 childSetValue("date_text", buffer); // Record the relative day so back and forward buttons // offset from this day. mDay = relative_day; mDoneQuery = TRUE; setupNewSearch(); U32 scope = DFQ_DATE_EVENTS; if ( !childGetValue("incmature").asBoolean() ) scope |= DFQ_PG_EVENTS_ONLY; std::ostringstream params; // Date mode for the search if ("current" == childGetValue("date_mode").asString()) { params << "u|"; } else { params << mDay << "|"; } // Categories are stored in the database in table indra.event_category // XML must match. U32 cat_id = childGetValue("category combo").asInteger(); params << cat_id << "|"; params << childGetValue("event_search_text").asString(); // send the message if (0 == event_id) { sendDirFindQuery(gMessageSystem, mSearchID, params.str(), scope, mSearchStart); } else { // This delete will also perform a query. LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_EventGodDelete); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_EventData); msg->addU32Fast(_PREHASH_EventID, event_id); msg->nextBlockFast(_PREHASH_QueryData); msg->addUUIDFast(_PREHASH_QueryID, mSearchID); msg->addStringFast(_PREHASH_QueryText, params.str()); msg->addU32Fast(_PREHASH_QueryFlags, scope); msg->addS32Fast(_PREHASH_QueryStart, mSearchStart); gAgent.sendReliableMessage(); } }