*
* @return boolean hook flag
*/
- function onEndShowStatusNetScripts($action) {
+ public function onEndShowStatusNetScripts(Action $action) {
$name = $action->arg('action');
if ($name == 'invite') {
$action->script($this->getPath() . '/js/whitelistinvite.js');
return true;
}
- function onRequireValidatedEmailPlugin_Override($user, &$knownGood)
+ public function onRequireValidatedEmailPlugin_Override(User $user, &$knownGood)
{
$knownGood = (!empty($user->email) && $this->matchesWhitelist($user->email));
return true;
}
- function onEndValidateUserEmail($user, $email, &$valid)
+ // @TODO Most callers are given NULL as first argument
+ public function onEndValidateUserEmail($user, $email, &$valid)
{
if ($valid) { // it's otherwise valid
if (!$this->matchesWhitelist($email)) {
return true;
}
- function onStartAddEmailAddress($user, $email)
+ public function onStartAddEmailAddress(User $user, $email)
{
if (!$this->matchesWhitelist($email)) {
// TRANS: Exception thrown when an e-mail address does not match the site's domain whitelist.
return true;
}
- function onStartTagProfileAction($action, $profile)
+ function onStartTagProfileAction(Action $action, Profile $profile)
{
$err = null;
$uri = $action->trimmed('uri');
/*
* If the field being looked for is URI look for the profile
*/
- function onStartProfileCompletionSearch($action, $profile, $search_engine) {
+ public function onStartProfileCompletionSearch(Action $action, Profile $profile, $search_engine) {
if ($action->field == 'uri') {
$profile->joinAdd(array('id', 'user:id'));
$profile->whereAdd('uri LIKE "%' . $profile->escape($q) . '%"');
* @param array &$mention in/out param: set of found mentions
* @return boolean hook return value
*/
- function onEndFindMentions($sender, $text, &$mentions)
+ function onEndFindMentions(Profile $sender, $text, array &$mentions)
{
$matches = array();
* @param Profile &$profile
* @return hook return code
*/
- function onStartCommandGetProfile($command, $arg, &$profile)
+ public function onStartCommandGetProfile(Command $command, $arg, Profile &$profile = null)
{
$oprofile = $this->pullRemoteProfile($arg);
if ($oprofile instanceof Ostatus_profile && !$oprofile->isGroup()) {
* @param User_group &$group
* @return hook return code
*/
- function onStartCommandGetGroup($command, $arg, &$group)
+ function onStartCommandGetGroup(Command $command, $arg, User_group &$group = null)
{
$oprofile = $this->pullRemoteProfile($arg);
if ($oprofile instanceof Ostatus_profile && $oprofile->isGroup()) {
return true;
}
- function onEndShowStatusNetScripts($action) {
+ public function onEndShowStatusNetScripts(Action $action) {
$action->script($this->path('js/ostatus.js'));
return true;
}