Reworked the ActivityContext->attention structure

Removing Evan's obscure attentionType solution and directly using the attention array
This commit is contained in:
Mikael Nordfeldth
2013-10-28 22:21:14 +01:00
parent f99c4b7f07
commit 23a6b4595f
12 changed files with 63 additions and 76 deletions

View File

@@ -450,19 +450,19 @@ class BookmarkPlugin extends MicroAppPlugin
}
}
$replies = $activity->context->attention;
$options['groups'] = array();
$options['replies'] = array();
$options['replies'] = array(); // TODO: context->attention
foreach ($replies as $replyURI) {
$other = Profile::fromURI($replyURI);
if (!empty($other)) {
$options['replies'][] = $replyURI;
foreach ($activity->context->attention as $attnUrl=>$type) {
$other = Profile::fromURI($attnUrl);
if ($other instanceof Profile) {
$options['replies'][] = $attnUrl;
} else {
$group = User_group::getKV('uri', $replyURI);
if (!empty($group)) {
$options['groups'][] = $replyURI;
// Maybe we can get rid of this since every User_group got a Profile?
// TODO: Make sure the above replies get sorted properly for groups (or handled afterwards)
$group = User_group::getKV('uri', $attnUrl);
if ($group instanceof User_group) {
$options['groups'][] = $attnUrl;
}
}
}