Where is the Friend code located? Friend Request, Remove Friend request and notifications for this?

Jon Potz Posted in Component Development 10 months ago

I know the core files have /actions/friend/add.php but I'm trying to create a onesignal push component for Friends notifications. All my other notifications work fine but I can't figure out how to hook into the friend adding. With the current code, are people notified by email if there is a friend request? Or does the friend notification just show up on the friend panel?

Will I need to add a callback trigger in the add.php for friend notifications? I hate to edit the core files but I'm not seeing a way to trigger friend notification for my push notification app.

Thanks in advance.

Replies
us Jon Potz Replied 10 months ago

Thank you! Very appreciative for your response.

German Michael Zülsdorff Replied 10 months ago

Why don't you simply search for the functions being called step by step?

See https://www.opensource-socialnetwork.org/wiki/view/1137/how-to-find-something-a-word-pattern-in-the-source-code

Starting with actions/friend/add.php this would lead you to libraries/ossn.lib.users.php, then classes/OssnUser.php and finally libraries/ossn.lib.relations.php which comes with the callback trigger you're looking for inside of ossn_add_relation()