removed "SESSION_NAME" in favor of doing a gCacheName lookup

reviewed by James
meow-7.2.2
Leyla Farazha 2010-06-02 16:31:05 -07:00
parent a282ffedf4
commit 0789897d61
3 changed files with 13 additions and 16 deletions

View File

@ -719,7 +719,6 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri
LLSD payload;
payload["from_id"] = target_id;
payload["SESSION_NAME"] = target_name;
payload["SUPPRESS_TOAST"] = true;
LLNotificationsUtil::add("FriendshipOffered", args, payload);
}

View File

@ -321,34 +321,35 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
logToIMP2P(notification, false);
}
void log_name_callback(const std::string& full_name, const std::string& from_name,
const std::string& message, const LLUUID& from_id)
{
LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, full_name, from_name, message,
from_id, LLUUID());
}
// static
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
{
const std::string name = LLHandlerUtil::getSubstitutionName(notification);
const std::string& session_name = notification->getPayload().has(
"SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name;
// don't create IM p2p session with objects, it's necessary condition to log
if (notification->getName() != OBJECT_GIVE_ITEM)
{
LLUUID from_id = notification->getPayload()["from_id"];
//there still appears a log history file with weird name " .txt"
if (" " == session_name || "{waiting}" == session_name || "{nobody}" == session_name)
if (from_id.isNull())
{
llwarning("Weird session name (" + session_name + ") for notification " + notification->getName(), 666)
llwarns << " from_id for notification " << notification->getName() << " is null " << llendl;
return;
}
if(to_file_only)
{
logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(),
LLUUID(), LLUUID());
gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID()));
}
else
{
logToIM(IM_NOTHING_SPECIAL, session_name, INTERACTIVE_SYSTEM_FROM, notification->getMessage(),
from_id, LLUUID());
gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
}
}
}

View File

@ -1909,7 +1909,6 @@ protected:
void modifyNotificationParams()
{
LLSD payload = mParams.payload;
payload["SESSION_NAME"] = mName;
mParams.payload = payload;
}
};
@ -2142,7 +2141,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
case IM_CONSOLE_AND_CHAT_HISTORY:
// *TODO: Translate
args["MESSAGE"] = message;
payload["SESSION_NAME"] = name;
payload["from_id"] = from_id;
LLNotificationsUtil::add("IMSystemMessageTip",args, payload);
break;
@ -6096,7 +6094,6 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
//*TODO please rewrite all keys to the same case, lower or upper
payload["from_id"] = target_id;
payload["SESSION_NAME"] = target_name;
payload["SUPPRESS_TOAST"] = true;
LLNotificationsUtil::add("TeleportOfferSent", args, payload);
}