// static
void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
{
	LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
	send_improved_im(target_id,
					 target_name,
					 message,
					 IM_ONLINE,
					 IM_FRIENDSHIP_OFFERED,
					 calling_card_folder_id);
}
Esempio n. 2
0
// static
void LLFloaterFriends::requestFriendship(const LLUUID& target_id, const LLString& target_name)
{
	// HACK: folder id stored as "message"
	LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
	std::string message = calling_card_folder_id.asString();
	send_improved_im(target_id,
					 target_name.c_str(),
					 message.c_str(),
					 IM_ONLINE,
					 IM_FRIENDSHIP_OFFERED);
}
// static
void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
{
	const LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
	send_improved_im(target_id,
					 target_name,
					 message,
					 IM_ONLINE,
					 IM_FRIENDSHIP_OFFERED,
					 calling_card_folder_id);

	LLSD args;
	args["TO_NAME"] = target_name;

	LLSD payload;
	payload["from_id"] = target_id;
	LLNotificationsUtil::add("FriendshipOffered", args, payload);
}
void LLFloaterTopObjects::onLagWarning(void* data)
{
    LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
    if (!list) return;
    LLScrollListItem* first_selected = list->getFirstSelected();
    if (!first_selected) return;
    LLUUID taskid = first_selected->getUUID();

    std::string name = first_selected->getColumn(1)->getValue().asString();
    std::string score = first_selected->getColumn(0)->getValue().asString();

    std::istringstream stm;
    stm.str(score);
    F32 f_score;
    stm >> f_score;
    F32 percentage = 100.f * (f_score / 22);

    std::string message = llformat(
                              "Hello %s, you are receiving this automated message because you are wearing heavily scripted attachments/HUDs, "
                              "causing excessive script lag (%5.2f ms, that's ca. %5.2f%% of the region's resources.)\n\n"
                              "Please remove resizer scripts or attachments to reduce your script time, thank you.",
                              name.c_str(),
                              (F32)f_score,
                              (F32)percentage
                          );

    std::string my_name;
    gAgent.buildFullname(my_name);

    cmdline_printchat(llformat("Script time warning sent to %s: (%5.2f ms)",
                               name.c_str(),(F32)f_score));

    send_improved_im(LLUUID(taskid),
                     my_name,
                     message,
                     IM_ONLINE,
                     IM_NOTHING_SPECIAL,
                     LLUUID::null,
                     NO_TIMESTAMP,
                     (U8*)EMPTY_BINARY_BUCKET,
                     EMPTY_BINARY_BUCKET_SIZE);
}