summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-08-10 13:36:38 -0700
committerBrion Vibber <brion@status.net>2010-08-10 13:49:11 -0700
commit08fc6053ec55e911b842fd05dafc5e0c99c4e992 (patch)
tree7db0277c84f0f6a7e75b5fb63d8b21dad95c6488 /classes/Notice.php
parent4fdfc6b1ce7e5ffa50b24bdddca55cc73d54a09f (diff)
Fix for regression with OStatus mention processing (duplicated new and old style lead to trying to save a reply entry twice).
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 4646fc6ab..0eeebfadf 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -485,7 +485,7 @@ class Notice extends Memcached_DataObject
function saveKnownUrls($urls)
{
// @fixme validation?
- foreach ($urls as $url) {
+ foreach (array_unique($urls) as $url) {
File::processNew($url, $this->id);
}
}
@@ -893,7 +893,7 @@ class Notice extends Memcached_DataObject
}
$groups = array();
- foreach ($group_ids as $id) {
+ foreach (array_unique($group_ids) as $id) {
$group = User_group::staticGet('id', $id);
if ($group) {
common_log(LOG_ERR, "Local delivery to group id $id, $group->nickname");
@@ -1016,7 +1016,7 @@ class Notice extends Memcached_DataObject
}
$sender = Profile::staticGet($this->profile_id);
- foreach ($uris as $uri) {
+ foreach (array_unique($uris) as $uri) {
$user = User::staticGet('uri', $uri);
@@ -1029,6 +1029,7 @@ class Notice extends Memcached_DataObject
$reply->notice_id = $this->id;
$reply->profile_id = $user->id;
+ common_log(LOG_INFO, __METHOD__ . ": saving reply: notice $this->id to profile $user->id");
$id = $reply->insert();
}