summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-06-01 13:51:41 -0700
committerEvan Prodromou <evan@status.net>2010-06-01 13:51:41 -0700
commita5de2152672f49ad95f114033ef6bf00ece9a0ab (patch)
treec31d031fb8ffb20b8497a80a7cf13958c50f5ad5 /classes/Notice.php
parent6d8e01ad13dd9bc9e149f43a1eb88671d4737f4d (diff)
parent634752f0d262b4fb02456889250378fca084cd2e (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index e173a2469..3d7d21533 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -97,15 +97,20 @@ class Notice extends Memcached_DataObject
// For auditing purposes, save a record that the notice
// was deleted.
- $deleted = new Deleted_notice();
+ // @fixme we have some cases where things get re-run and so the
+ // insert fails.
+ $deleted = Deleted_notice::staticGet('id', $this->id);
+ if (!$deleted) {
+ $deleted = new Deleted_notice();
- $deleted->id = $this->id;
- $deleted->profile_id = $this->profile_id;
- $deleted->uri = $this->uri;
- $deleted->created = $this->created;
- $deleted->deleted = common_sql_now();
+ $deleted->id = $this->id;
+ $deleted->profile_id = $this->profile_id;
+ $deleted->uri = $this->uri;
+ $deleted->created = $this->created;
+ $deleted->deleted = common_sql_now();
- $deleted->insert();
+ $deleted->insert();
+ }
// Clear related records
@@ -1235,7 +1240,7 @@ class Notice extends Memcached_DataObject
$noticeInfoAttr = array(
'local_id' => $this->id, // local notice ID (useful to clients for ordering)
- 'source' => $this->source // the client name (source attribution)
+ 'source' => $this->source, // the client name (source attribution)
);
$ns = $this->getSource();
@@ -1246,7 +1251,11 @@ class Notice extends Memcached_DataObject
}
if (!empty($cur)) {
- $noticeInfoAttr['favorited'] = ($cur->hasFave($this)) ? 'true' : 'false';
+ $noticeInfoAttr['favorite'] = ($cur->hasFave($this)) ? "true" : "false";
+ }
+
+ if (!empty($this->repeat_of)) {
+ $noticeInfoAttr['repeat_of'] = $this->repeat_of;
}
$xs->element('statusnet:notice_info', $noticeInfoAttr, null);