Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I disable @mentions written by non-friends?


  • godavid33
    Participant

    @godavid33

    Let’s say we have Users X, Y, and Z. User’s x and y are friends, and users x and z are friends, but users y and z are not friends. User y decides to at-mention user Z. How can I make it so that that mention is not filtered into HTML EVER. That is, if user X were to see the at-mention written by user Y, it would still not be a clickable link. From what I can tell, at-mentions are formatted using filters.

Viewing 3 replies - 1 through 3 (of 3 total)

  • Henry Wright
    Moderator

    @henrywright

    friends_check_friendship_status() will handle the ‘friend check’ for you. bp_activity_at_name_filter is the @-mention filter you speak of. It’s hooked to various stuff such as bp_activity_comment_content and pre_comment_content. Hope this helps. If you need anything else just shout.


    ayushpratap
    Participant

    @ayushpratap

    @henrywright

    Is there a way for a user to “unmention” themselves from an update/post or to delete any post in its entirety which exclusively mentions them, something like untag/remove tag facility in facebook ? I am talking about more control for a user to manage their mentions so far in the community. I think it would be very useful to have such an option as a community user.

    Case example: A buddypress community with Friend connections disabled. Any user could mention another out of the blue. A user “foo” mentioned user “bar” in a post, now “bar” wants out of that post so “bar” could either delete that post or could unmention (@ link turns into plain text or disappears.)himself/herself out of this post from his/her Mentions tab or using an unmention button which he/she could see beneath every activity entry he/she is mentioned in.


    godavid33
    Participant

    @godavid33

    My guess to doing this would be something like the following:

    1.) Set up somewhere where they can see all their mentions and put a button on each item that allows them to unmention themselves
    2.) This button would set a value somewhere in the db that specifically points to the id of where they are mentioned
    3.) The filter that sets the link would check this value before adding the link

    hope that helps a bit.

    @mercime is this about right?

    P.S. Mentioning someone in a thread about mentions; how meta am I 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I disable @mentions written by non-friends?’ is closed to new replies.
Skip to toolbar