forked from GNUsocial/gnu-social
groups in backup output
This commit is contained in:
parent
0a5aa95746
commit
960ddd9704
@ -34,6 +34,15 @@ END_OF_EXPORTACTIVITYSTREAM_HELP;
|
|||||||
|
|
||||||
require_once INSTALLDIR.'/scripts/commandline.inc';
|
require_once INSTALLDIR.'/scripts/commandline.inc';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class for activity streams
|
||||||
|
*
|
||||||
|
* Includes faves, notices, and subscriptions.
|
||||||
|
*
|
||||||
|
* We extend atomusernoticefeed since it does some nice setup for us.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
class UserActivityStream extends AtomUserNoticeFeed
|
class UserActivityStream extends AtomUserNoticeFeed
|
||||||
{
|
{
|
||||||
function __construct($user, $indent = true)
|
function __construct($user, $indent = true)
|
||||||
@ -42,10 +51,11 @@ class UserActivityStream extends AtomUserNoticeFeed
|
|||||||
|
|
||||||
$subscriptions = $this->getSubscriptions();
|
$subscriptions = $this->getSubscriptions();
|
||||||
$subscribers = $this->getSubscribers();
|
$subscribers = $this->getSubscribers();
|
||||||
|
$groups = $this->getGroups();
|
||||||
$faves = $this->getFaves();
|
$faves = $this->getFaves();
|
||||||
$notices = $this->getNotices();
|
$notices = $this->getNotices();
|
||||||
|
|
||||||
$objs = array_merge($subscriptions, $subscribers, $faves, $notices);
|
$objs = array_merge($subscriptions, $subscribers, $groups, $faves, $notices);
|
||||||
|
|
||||||
// Sort by create date
|
// Sort by create date
|
||||||
|
|
||||||
@ -53,7 +63,9 @@ class UserActivityStream extends AtomUserNoticeFeed
|
|||||||
|
|
||||||
foreach ($objs as $obj) {
|
foreach ($objs as $obj) {
|
||||||
$act = $obj->asActivity();
|
$act = $obj->asActivity();
|
||||||
$this->addEntryRaw($act->asString(false));
|
// Only show the author sub-element if it's different from default user
|
||||||
|
$str = $act->asString(false, ($act->actor->id != $this->user->uri));
|
||||||
|
$this->addEntryRaw($str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +148,23 @@ class UserActivityStream extends AtomUserNoticeFeed
|
|||||||
|
|
||||||
return $notices;
|
return $notices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getGroups()
|
||||||
|
{
|
||||||
|
$groups = array();
|
||||||
|
|
||||||
|
$gm = new Group_member();
|
||||||
|
|
||||||
|
$gm->profile_id = $this->user->id;
|
||||||
|
|
||||||
|
if ($gm->find()) {
|
||||||
|
while ($gm->fetch()) {
|
||||||
|
$groups[] = clone($gm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $groups;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUser()
|
function getUser()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user