Habitica: prevent typing a private message to a player who has blocked you / opted out of PMs

Created on 21 Oct 2017  Â·  16Comments  Â·  Source: HabitRPG/habitica

On the Messages screen (shown below), when the player that you're trying to send a message to has blocked you or has opted out of all private messages, then there should be no "send" button or new message field at the bottom of the screen. Instead, there should be a statement that you can't message that person (use the notAuthorizedToSendMessageToThisUser locale string, which already exists: "You can't send a message to this player because they have chosen to block messages.").

However, mods/staff should always see the send button and the text field, regardless of whether the user has opted out or blocked the mod, because a partial fix for https://github.com/HabitRPG/habitica/issues/8142 allows mods/staff to PM all users regardless of blocking. Moderators and staff can be recognised in the code by anyone with contributor.admin being set to true.

image

_edit:_

I've logged https://github.com/HabitRPG/habitica/issues/9989 for a similar issue: "prevent typing a private message to a player who has deleted their account"
It could be either worked on at the same time as this issue, or after this issue is fixed, https://github.com/HabitRPG/habitica/issues/9989 could be fixed by reusing most of the new code.

Note

Some work towards fixing this issue was already made in https://github.com/HabitRPG/habitica/pull/10878 and can be used as a starting point.

help wanted medium Messages

All 16 comments

@Alys How should this issue affect https://github.com/HabitRPG/habitica/issues/8142?

@MathWhiz ha, great point! Thank you! It depends a lot on which issue is finished first.:) I'll update the top post to include some words about that. I've added a note to your Hall of Heroes entry to recognise your recent large efforts in assessing issues as a partial contribution to Tier 7.

Aww, thanks :D
On Sat, Oct 21, 2017 at 6:02 PM Alys notifications@github.com wrote:

@MathWhiz https://github.com/mathwhiz ha, great point! Thank you! It
depends a lot on which issue is finished first.:) I'll update the top post
to include some words about that. I've added a note to your Hall of Heroes
entry to recognise your recent large efforts in assessing issues as a
partial contribution to Tier 7.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/HabitRPG/habitica/issues/9247#issuecomment-338438332,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALz_8wicbDLzZh2DwZ4Ih7HuFgnN__ovks5sunfugaJpZM4QBhtx
.

@Alys as with #8142, should this be put on hold until designs are made, or is that unnecessary?

I've logged https://github.com/HabitRPG/habitica/issues/9989 for a similar issue: "prevent typing a private message to a player who has deleted their account"
It could be either worked on at the same time as this issue, or after this issue is fixed, https://github.com/HabitRPG/habitica/issues/9989 could be fixed by reusing most of the new code.

We have updated designs on how to handle this usecase.

image

I have a question regarding this issue. When the user opens opens the modal for chat messages, see screenshot below, (e.g. user clicks on the avatar of another user in the party) a request is done to members/:memberId like http://localhost:8080/api/v4/members/789cb00c-3018-4cf2-8d3c-3db667aa57ef.

To fix this issue, I want to know if the other user blocked me. Currently this information, which is located in the array inbox.blocks, is not being sent in the request above. Therefore I would consider adding this field to the variable publicFields of index.js. Would this be the "best" approach?

image

I think that being able to know everyone that a person is blocking would have some concerning uses.

From a moderation point of view, we wouldn't want a player's full block list appearing in the data that anyone can see for that member, so adding the entire inbox.blocks to publicFields isn't the best approach - thanks for asking about it though!

It would certainly be acceptable from a moderation point of view if partial contents of inbox.blocks was in publicFields, if that helps (and if the staff don't veto it for technical reasons). For example, if my account contains this:

    "inbox": {
        "newMessages": 0,
        "blocks": [
            "11111111-3d8a-4a10-bfe0-111111111111",
            "22222222-ca6d-4c03-8261-222222222222"
        ],
    },

and player 11111111-3d8a-4a10-bfe0-111111111111 went to send me a PM, then it would be okay if the members call for my account included "inbox.blocks": ["11111111-3d8a-4a10-bfe0-111111111111"]

However that might not be the easiest approach.

One important thing is that when you've viewing a player's profile screen, you don't need to know right then whether you can PM a player or not. For example, the fix for this issue shouldn't remove the messages icon from that screen since the player viewing the screen would still need to use the icon to see any prior conversations. The only time you need to know whether you can send a message to a player is when you're in the inbox with a conversation open for that player.

Thank you for your replies!

I think you are right to not unnecessarily reveal too much information. In this case, I would suggest to add a method called e.g. didUserBlockme similar to method blockUser in profile.vue

But this would necessitate extending the API with another endpoint. I think this would be the most transparent solution, but also involve more effort (which is not a problem for me).

Note to myself:
Ok, now I figured out, how I can solve this issue elegantly. Use '/members/:toUserId/objections/:interaction' => Links related to issue is:

Hi @akmaekki! Are you still interested in working on this one? If so, please let me know!

I'll set this back to help wanted since there was no reply. :)

This appears to have been fixed. We can reopen if that's not the case.

I'm reopening this because it's still (or once again?) possible to type a message to a player who has blocked you or who has opted out of PMs.

I've deleted some old comments that were just requests to work on this issue and related conversation (nothing important for solving this issue).

Was this page helpful?
0 / 5 - 0 ratings