diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index cce26284e..143f18da7 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -54,6 +54,9 @@ #include "rlvhandler.h" // [/RLVa:KB] +#include "llviewerwindow.h" +#include "llwindow.h" + extern const S32 TRANS_GIFT; 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 handle_lure(const uuid_vec_t& ids); @@ -803,3 +806,24 @@ bool LLAvatarActions::canBlock(const LLUUID& id) bool is_self = id == gAgentID; return !is_self && !is_linden; } + +// static +void LLAvatarActions::copyUUIDs(const uuid_vec_t& ids) +{ + std::string ids_string; + const std::string& separator = LLTrans::getString("words_separator"); + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + const LLUUID& id = *it; + if (id.isNull()) + continue; + + if (!ids_string.empty()) + ids_string.append(separator); + + ids_string.append(id.asString()); + } + + if (!ids_string.empty()) + gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(ids_string)); +} diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 5e52e71d8..fcd5d6a70 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -198,6 +198,11 @@ public: */ static void buildResidentsString(const uuid_vec_t& avatar_uuids, std::string& residents_string); + /** + * Copy the selected avatar's UUID to clipboard + */ + static void copyUUIDs(const uuid_vec_t& id); + private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response);