From 82e90a6af580890eb685fc6b684d79ca905e6279 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 20 Jan 2012 08:59:37 +0200 Subject: EXP-901 FIXED (Can see "typing" messages from users who are not allowed to IM you) - If "Only friends and groups can IM me" option is ON but the user got message from non-friend, show notification one time per session. --- indra/newview/llimview.cpp | 11 +++++++++++ indra/newview/llimview.h | 12 ++++++++++++ indra/newview/llviewermessage.cpp | 9 ++++++++- indra/newview/skins/default/xui/en/strings.xml | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a856bd0bdc..e69c45de58 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2977,6 +2977,17 @@ bool LLIMMgr::isVoiceCall(const LLUUID& session_id) return im_session->mStartedAsIMCall; } +void LLIMMgr::addNotifiedNonFriendSessionID(const LLUUID& session_id) +{ + mNotifiedNonFriendSessions.insert(session_id); +} + +bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id) +{ + return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id); + +} + void LLIMMgr::noteOfflineUsers( const LLUUID& session_id, const LLDynamicArray& ids) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index b1be26a169..f07a78e2f7 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -438,6 +438,10 @@ public: bool isVoiceCall(const LLUUID& session_id); + void addNotifiedNonFriendSessionID(const LLUUID& session_id); + + bool isNonFriendSessionNotified(const LLUUID& session_id); + private: /** @@ -465,6 +469,14 @@ private: typedef std::list session_observers_list_t; session_observers_list_t mSessionObservers; + // EXP-901 + // If "Only friends and groups can IM me" option is ON but the user got message from non-friend, + // the user should be notified that to be able to see this message the option should be OFF. + // This set stores session IDs in which user was notified. Need to store this IDs so that the user + // be notified only one time per session with non-friend. + typedef std::set notified_non_friend_sessions_t; + notified_non_friend_sessions_t mNotifiedNonFriendSessions; + LLSD mPendingInvitations; LLSD mPendingAgentListUpdates; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c6770df43..6bb13bb8d7 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2360,8 +2360,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; bool mute_im = is_muted; - if(accept_im_from_only_friend&&!is_friend) + if (accept_im_from_only_friend && !is_friend) { + if (!gIMMgr->isNonFriendSessionNotified(session_id)) + { + std::string message = LLTrans::getString("IM_unblock_only_groups_friends"); + gIMMgr->addMessage(session_id, from_id, name, message); + gIMMgr->addNotifiedNonFriendSessionID(session_id); + } + mute_im = true; } if (!mute_im || is_linden) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3351ffe00f..54d5559efc 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3238,6 +3238,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. To (Moderator) (Saved [LONG_TIMESTAMP]) + To see this message, you must uncheck 'Only friends and groups can call or IM me' in Preferences/Privacy. Your call has been answered -- cgit v1.2.3