fixed EXT-5910 “Offers logging”,

fixed IM message counter when received interactive notification(offer);
corrected logging to file of offer notification;
enabled logging for FRIENDSHIP_ACCEPTED notification;

--HG--
branch : product-engine
master
Alexei Arabadji 2010-03-05 17:53:32 +02:00
parent 27283c1de7
commit 2f9cc80c2e
5 changed files with 22 additions and 7 deletions

View File

@ -61,6 +61,7 @@ const char EMPTY_BINARY_BUCKET[] = "";
const S32 EMPTY_BINARY_BUCKET_SIZE = 1;
const U32 NO_TIMESTAMP = 0;
const std::string SYSTEM_FROM("Second Life");
const std::string INTERACTIVE_SYSTEM_FROM("F387446C-37C4-45f2-A438-D99CBDBB563B");
const S32 IM_TTL = 1;

View File

@ -226,6 +226,7 @@ extern const S32 EMPTY_BINARY_BUCKET_SIZE;
extern const U32 NO_TIMESTAMP;
extern const std::string SYSTEM_FROM;
extern const std::string INTERACTIVE_SYSTEM_FROM;
// Number of retry attempts on sending the im.
extern const S32 IM_TTL;

View File

@ -723,7 +723,9 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id,
session->mNumUnread++;
//update count of unread messages from real participant
if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from))
if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from)
// we should increment counter for interactive system messages()
|| INTERACTIVE_SYSTEM_FROM == from)
{
++(session->mParticipantUnreadMessageCount);
}

View File

@ -139,6 +139,7 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
|| PAYMENT_RECIVED == notification->getName()
|| OFFER_FRIENDSHIP == notification->getName()
|| FRIENDSHIP_OFFERED == notification->getName()
|| FRIENDSHIP_ACCEPTED == notification->getName()
|| FRIENDSHIP_ACCEPTED_BYME == notification->getName()
|| FRIENDSHIP_DECLINED_BYME == notification->getName()
|| SERVER_OBJECT_MESSAGE == notification->getName()
@ -274,12 +275,12 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
if(to_file_only)
{
logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(),
LLUUID(), LLUUID());
logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(),
from_id, LLUUID());
}
else
{
logToIM(IM_NOTHING_SPECIAL, session_name, "", notification->getMessage(),
logToIM(IM_NOTHING_SPECIAL, session_name, INTERACTIVE_SYSTEM_FROM, notification->getMessage(),
from_id, LLUUID());
}
}

View File

@ -156,7 +156,14 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
if (LLHandlerUtil::canLogToIM(notification))
{
LLHandlerUtil::logToIMP2P(notification);
if (LLHandlerUtil::isIMFloaterOpened(notification))
{
LLHandlerUtil::logToIMP2P(notification, true);
}
else
{
LLHandlerUtil::logToIMP2P(notification);
}
}
// update IM floater messages if need
@ -192,8 +199,11 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
void LLOfferHandler::onDeleteToast(LLToast* toast)
{
// send a signal to the counter manager
mDelNotificationSignal();
if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification()))
{
// send a signal to the counter manager
mDelNotificationSignal();
}
// send a signal to a listener to let him perform some action
// in this case listener is a SysWellWindow and it will remove a corresponding item from its list