Mention Users with @ Download 1.9.1

This component/theme doesn't work with the latest OSSN version.
5.0
us bryce alvord 4 years ago

OSSN MENTION USERS COMPONENT

This component enables a user to mention other users in posts and comments by using the syntax @Full Name or conditionally @username and that will send the mentioned user a notification telling them that they were mentioned in a post or comment with a link to that item.

This can be used in conjunction with the Display Username component as of v1.2 if you want to display usernames and mention @username instead of display Full Name and mention @Full Name. It will dynamically switch based whether or not the Display Username component is installed and turned on. You can find more info on it here: https://www.opensource-socialnetwork.org/component/view/3065/display-username

  • When mentioning usernames using the Display Username component the exact casing must be used to match the user.

  • When mentioning user full names the casing DOES matter as that can help find uniqueness.

  • Mentions are not limited to the friends of the user, the entire user base can be mentioned

  • Multiple mentions can be done in a post or comment.

CHANGE LOG
-------------------1.9.1------------------

  • Added ability to parse off trailing '(apostrophe) and 's for use in plurals and ownership

  • Added recommended method and hooks from Z-Man

-------------------1.9--------------------

  • Added 'ossn:notifications:mention:post:created' to en locale

  • Added 'ossn:notifications:mention:comment:created' to en locale

  • Renamed init method from basic name to prevent potential collision with other components

POSSIBLE ENHANCEMENTS

  • No UI based on prototype having significant cons

  • ?

Comments
us Bryce alvord Replied 4 years ago

Go ahead and add that same thing for comments ossn:notifications:mention:comment:created well using

us Allon Prooit Replied 4 years ago

Yes! I did that and now it works just fine. Thanks!

us Bryce alvord Replied 4 years ago

Hey Allon, I think you would add ossn:notifications:mention:post:created to your locale file for your email component for the language you are using with a message you want it to translate to. Something like %s has mentioned you in a post. Or something along those lines. I'm terribly sorry, I don't have access to that component or I would tell you for certain what to do. Let me know if adding another entry to your sites locale language file within that component does not work.

us Allon Prooit Replied 4 years ago

Installed the component and it works great! Many thanks!!! One thing though, because I have the email notifications component it sends an email but the email only shows the following... ossn:notifications:mention:post:created
Do you have any suggestions as to how I can get the email notification to be more informative? Thanks!

us Bryce alvord Replied 4 years ago

Hey Nikita,

Care to elaborate? I need to know what the comment or post was exactly as well as the username or full name exactly of the user that you thought it should hit and if the Display Username component was on or off. BTW, It wont send notifications to yourself if you were trying that, thats an OSSN thing.

Thanks!

pk Nikita Prusmoisi Replied 4 years ago

don't work

German Michael Zülsdorff Replied 4 years ago

Actually, I ran into another issue that needs to be fixed with the next Ossn release.
As I said, the post delete callback takes care of deleting accompanying comments automatically, so your component doesn't have to take extra care, as annotation delete will be executed as a child process.
But having a closer look it turned out that this child process is only taking care of annotations of type 'comment:post' and not of type 'comment:entity'
Thus, if you mention someone in a comment attached to a post of type 'Bryce Alvord changed profile cover', and delete that post afterwards, your mention notification record stays in place.

In fact not a problem of your component, we simply need to wait until the next Ossn release and accept some orphans.

us Bryce alvord Replied 4 years ago

Uploaded v1.8 with new deletes after doing some testing and all looks good so far

German Michael Zülsdorff Replied 4 years ago

Yep, I had a hard time debugging yesterday night until I finally found out that line #259 of ossn.libs.system will end the loop of calling further callbacks if a callback returns false. ;)

Long term untouched code, and this issue never popped up before I was trying to register the annotation delete callback in your component to no avail. :)

us Bryce alvord Replied 4 years ago

Oh nice find man! Thats great that it will be fixed! My OSSN installation got corrupted somehow in the users table so Im probably going to reinstall real quick and test it.

Component

Developer: bryce
License GPL v2
Type: Communication
Requires Ossn Version : 5.x
Latest Version: 1.9.1
Last Updated 4 years ago
Repository Url View Repository

Versions