summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 4c7e6ab4b..f7194e339 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -119,6 +119,9 @@ class Notice extends Memcached_DataObject
// NOTE: we don't clear queue items
$result = parent::delete();
+
+ $this->blowOnDelete();
+ return $result;
}
/**
@@ -421,6 +424,18 @@ class Notice extends Memcached_DataObject
$profile->blowNoticeCount();
}
+ /**
+ * Clear cache entries related to this notice at delete time.
+ * Necessary to avoid breaking paging on public, profile timelines.
+ */
+ function blowOnDelete()
+ {
+ $this->blowOnInsert();
+
+ self::blow('profile:notice_ids:%d;last', $this->profile_id);
+ self::blow('public;last');
+ }
+
/** save all urls in the notice to the db
*
* follow redirects and save all available file information
@@ -589,7 +604,6 @@ class Notice extends Memcached_DataObject
array(),
'public',
$offset, $limit, $since_id, $max_id);
-
return Notice::getStreamByIds($ids);
}
@@ -1128,6 +1142,7 @@ class Notice extends Memcached_DataObject
if ($source) {
$xs->elementStart('source');
+ $xs->element('id', null, $profile->profileurl);
$xs->element('title', null, $profile->nickname . " - " . common_config('site', 'name'));
$xs->element('link', array('href' => $profile->profileurl));
$user = User::staticGet('id', $profile->id);
@@ -1143,13 +1158,14 @@ class Notice extends Memcached_DataObject
}
$xs->element('icon', null, $profile->avatarUrl(AVATAR_PROFILE_SIZE));
+ $xs->element('updated', null, common_date_w3dtf($this->created));
}
if ($source) {
$xs->elementEnd('source');
}
- $xs->element('title', null, $this->content);
+ $xs->element('title', null, common_xml_safe_str($this->content));
if ($author) {
$xs->raw($profile->asAtomAuthor());
@@ -1225,7 +1241,11 @@ class Notice extends Memcached_DataObject
}
}
- $xs->element('content', array('type' => 'html'), $this->rendered);
+ $xs->element(
+ 'content',
+ array('type' => 'html'),
+ common_xml_safe_str($this->rendered)
+ );
$tag = new Notice_tag();
$tag->notice_id = $this->id;