summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-01-20 08:59:37 +0200
committerPaul ProductEngine <pguslisty@productengine.com>2012-01-20 08:59:37 +0200
commit82e90a6af580890eb685fc6b684d79ca905e6279 (patch)
tree63d9cb49ecf720c538afd7cfed491f27b8df0216 /indra/newview
parent0062c053ed59e05400312efc0f9b6fcf29590733 (diff)
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.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp11
-rw-r--r--indra/newview/llimview.h12
-rwxr-xr-xindra/newview/llviewermessage.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml1
4 files changed, 32 insertions, 1 deletions
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<LLUUID>& 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 <LLIMSessionObserver *> 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<LLUUID> 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].
<string name="IM_to_label">To</string>
<string name="IM_moderator_label">(Moderator)</string>
<string name="Saved_message">(Saved [LONG_TIMESTAMP])</string>
+ <string name="IM_unblock_only_groups_friends">To see this message, you must uncheck &apos;Only friends and groups can call or IM me&apos; in Preferences/Privacy.</string>
<!-- voice calls -->
<string name="answered_call">Your call has been answered</string>