Jump to content

Extension:SocialProfile/Hooks/NewFoeAccepted

From mediawiki.org
NewFoeAccepted
Available from version ???
Called when a new foe 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 onNewFoeAccepted( $userFrom, $user ) { ... }
Attach hook:
$wgHooks['NewFoeAccepted'][] = 'MyExtensionHooks::onNewFoeAccepted';
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:NewFoeAccepted extensions.

The NewFoeAccepted 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 friend, the NewFriendAccepted 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.