Jump to content

Extension:SocialProfile/Hooks/NewFriendAccepted

From mediawiki.org
NewFriendAccepted
Available from version ???
Called when a new friendship has been successfully registered and all caches etc. are purged, right before returning true from the addRelationship function to signal that everything went OK
Define function:
public static function onNewFriendAccepted( $userFrom, $user ) { ... }
Attach hook:
$wgHooks['NewFriendAccepted'][] = 'MyExtensionHooks::onNewFriendAccepted';
Called from:
File(s): SocialProfile / UserRelationship/includes/UserRelationshipClass.php
Function(s): addRelationship

For more information about attaching hooks, see Manual:Hooks .
For examples of other extensions using this hook, see Category:NewFriendAccepted extensions.

The NewFriendAccepted hook is called at the end of addRelationship in UserRelationshipClass.php, right before purging UserProfile caches and returning. It has access to the User objects representing both the person who originally sent the relationship request ($userFrom) and the person who accepted it ($user).

When adding a foe, the NewFoeAccepted hook is instead run.

This hook was originally added in April 2011 for interoperability with the long-bitrotten and subsequently archived Sematic Social Profile extension.