summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-27 14:57:32 -0700
committerBrion Vibber <brion@pobox.com>2010-05-27 14:57:32 -0700
commit696aeea113b88fd0f6b7c4c88eebc2f4f369d245 (patch)
treec16f91a270c2989f8e6b3799b2dfa3e39698f565 /classes/Notice.php
parentcc25ec175530a691686087db4c23a1a28ffd1b62 (diff)
parent2f2fa100715f9c09b2b91a2d1afddacf7b7f16db (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: lib/language.php plugins/OpenID/finishaddopenid.php
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 7c3b5b519..2613b1737 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
@@ -1236,7 +1241,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();
@@ -1247,7 +1252,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);