aboutsummaryrefslogtreecommitdiffstats
path: root/include/event.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-06-03 13:45:35 -0700
committerfriendica <info@friendica.com>2014-06-03 13:45:35 -0700
commitc034cb5d71bec9c6ce789b52147897e8d581a70c (patch)
tree521854b6e22aade24405f5b06de9aea2a9d0d5a2 /include/event.php
parentb4e7d7f7c048c6a4521f286bafc214f235c3c5d1 (diff)
downloadvolse-hubzilla-c034cb5d71bec9c6ce789b52147897e8d581a70c.tar.gz
volse-hubzilla-c034cb5d71bec9c6ce789b52147897e8d581a70c.tar.bz2
volse-hubzilla-c034cb5d71bec9c6ce789b52147897e8d581a70c.zip
make system generated birthday events un-commentable since comments won't go where you think.
Diffstat (limited to 'include/event.php')
-rw-r--r--include/event.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/event.php b/include/event.php
index 861d74f00..e198fe15c 100644
--- a/include/event.php
+++ b/include/event.php
@@ -318,7 +318,22 @@ function event_store_item($arr,$event) {
}
}
- $prefix = (($event['type'] === 'birthday') ? t('This event has been added to your calendar.') . "\n\n" : '');
+ $item_arr = array();
+ $prefix = '';
+ $birthday = false;
+
+ if($event['type'] === 'birthday') {
+ $prefix = t('This event has been added to your calendar.');
+ $birthday = true;
+
+ // The event is created on your own site by the system, but appears to belong
+ // to the birthday person. It also isn't propagated - so we need to prevent
+ // folks from trying to comment on it. If you're looking at this and trying to
+ // fix it, you'll need to completely change the way birthday events are created
+ // and send them out from the source. This has its own issues.
+
+ $item_arr['comment_policy'] = 'none';
+ }
$r = q("SELECT * FROM item left join xchan on author_xchan = xchan_hash WHERE resource_id = '%s' AND resource_type = 'event' and uid = %d LIMIT 1",
dbesc($event['event_hash']),
@@ -373,7 +388,6 @@ function event_store_item($arr,$event) {
$private = (($arr['allow_cid'] || $arr['allow_gid'] || $arr['deny_cid'] || $arr['deny_gid']) ? 1 : 0);
- $item_arr = array();
if($item) {
$item_arr['id'] = $item['id'];
@@ -387,6 +401,7 @@ function event_store_item($arr,$event) {
$item_flags |= ITEM_ORIGIN;
}
$item_arr['item_flags'] = $item_flags;
+
}
if(! $arr['mid'])