{
const VERSION = '0.1';
+ // Flags to switch off certain activity notices
+ public $StartFollowUser = true;
+ public $StopFollowUser = true;
+ public $JoinGroup = true;
+ public $LeaveGroup = true;
+ public $StartLike = true;
+ public $StopLike = true;
+
/**
* Database schema setup
*
function onEndSubscribe($subscriber, $other)
{
+ // Only do this if config is enabled
+ if(!$this->StartFollowUser) return true;
$user = User::staticGet('id', $subscriber->id);
if (!empty($user)) {
$rendered = sprintf(_m('<em>Started following <a href="%s">%s</a></em>.'),
function onEndUnsubscribe($subscriber, $other)
{
+ // Only do this if config is enabled
+ if(!$this->StopFollowUser) return true;
$user = User::staticGet('id', $subscriber->id);
if (!empty($user)) {
$rendered = sprintf(_m('<em>Stopped following <a href="%s">%s</a></em>.'),
function onEndFavorNotice($profile, $notice)
{
+ // Only do this if config is enabled
+ if(!$this->StartLike) return true;
$user = User::staticGet('id', $profile->id);
if (!empty($user)) {
function onEndDisfavorNotice($profile, $notice)
{
+ // Only do this if config is enabled
+ if(!$this->StopLike) return true;
$user = User::staticGet('id', $profile->id);
if (!empty($user)) {
function onEndJoinGroup($group, $user)
{
+ // Only do this if config is enabled
+ if(!$this->JoinGroup) return true;
$rendered = sprintf(_m('<em>Joined the group "<a href="%s">%s</a>"</em>.'),
$group->homeUrl(),
$group->getBestName());
function onEndLeaveGroup($group, $user)
{
+ // Only do this if config is enabled
+ if(!$this->LeaveGroup) return true;
$rendered = sprintf(_m('<em>Left the group "<a href="%s">%s</a>"</em>.'),
$group->homeUrl(),
$group->getBestName());