We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 1bfbf928 authored by Evan Prodromou's avatar Evan Prodromou

Incorrect arguments for ActivityPlugin::onEndJoin/LeaveGroup()

parent 4f05205f
......@@ -203,14 +203,18 @@ class ActivityPlugin extends Plugin
return true;
}
function onEndJoinGroup($group, $user)
function onEndJoinGroup($group, $profile)
{
// Only do this if config is enabled
if(!$this->JoinGroup) return true;
$profile = $user->getProfile();
$user = $profile->getUser();
if (empty($user)) {
return true;
}
$rendered = sprintf(_m('<em><a href="%s">%s</a> joined the group &quot;<a href="%s">%s</a>&quot;</em>.'),
$rendered = sprintf(_m('<em><a href="%s">%s</a> joined the group <a href="%s">%s</a></em>.'),
$profile->profileurl,
$profile->getBestName(),
$group->homeUrl(),
......@@ -221,8 +225,8 @@ class ActivityPlugin extends Plugin
$group->getBestName(),
$group->homeUrl());
$mem = Group_member::staticGet(array('group_id' => $group->id,
'profile_id' => $profile->id));
$mem = Group_member::pkeyGet(array('group_id' => $group->id,
'profile_id' => $profile->id));
$notice = Notice::saveNew($user->id,
$content,
......@@ -234,14 +238,18 @@ class ActivityPlugin extends Plugin
return true;
}
function onEndLeaveGroup($group, $user)
function onEndLeaveGroup($group, $profile)
{
// Only do this if config is enabled
if(!$this->LeaveGroup) return true;
$profile = $user->getProfile();
$user = $profile->getUser();
if (empty($user)) {
return true;
}
$rendered = sprintf(_m('<em><a href="%s">%s</a> left the group &quot;<a href="%s">%s</a>&quot;</em>.'),
$rendered = sprintf(_m('<em><a href="%s">%s</a> left the group <a href="%s">%s</a></em>.'),
$profile->profileurl,
$profile->getBestName(),
$group->homeUrl(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment