aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorjeroenpraat <jeroenpraat@xs4all.nl>2014-06-04 14:00:08 +0000
committerjeroenpraat <jeroenpraat@xs4all.nl>2014-06-04 14:00:08 +0000
commitd9688e5ab3bb1c33e432a14ac3455ecb7ca3a6b2 (patch)
treecd0a06052eb398d0401ca61314d9db8a6ce91599 /include
parent5869836180d8721363294c5d8dbe64d6b54571c6 (diff)
parentd84f03d59b4b3f625b36852211698f5606b6b37c (diff)
downloadvolse-hubzilla-d9688e5ab3bb1c33e432a14ac3455ecb7ca3a6b2.tar.gz
volse-hubzilla-d9688e5ab3bb1c33e432a14ac3455ecb7ca3a6b2.tar.bz2
volse-hubzilla-d9688e5ab3bb1c33e432a14ac3455ecb7ca3a6b2.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include')
-rw-r--r--include/apps.php4
-rw-r--r--include/datetime.php5
-rw-r--r--include/event.php19
-rw-r--r--include/widgets.php4
4 files changed, 27 insertions, 5 deletions
diff --git a/include/apps.php b/include/apps.php
index a24d8e503..f7b09c7b6 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -131,7 +131,9 @@ function translate_system_apps(&$arr) {
'Mood' => t('Mood'),
'Poke' => t('Poke'),
'Chat' => t('Chat'),
- 'Search' => t('Search')
+ 'Search' => t('Search'),
+ 'Probe' => t('Probe'),
+ 'Suggest' => t('Suggest')
);
if(array_key_exists($arr['name'],$apps))
diff --git a/include/datetime.php b/include/datetime.php
index 4884cda11..0214b9e4c 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -484,11 +484,16 @@ function z_birthday($dob,$tz,$format="Y-m-d H:i:s") {
function update_birthdays() {
require_once('include/event.php');
+ require_once('include/permissions.php');
$r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_dob > utc_timestamp() + interval 7 day and abook_dob < utc_timestamp() + interval 14 day");
if($r) {
foreach($r as $rr) {
+
+ if(! perm_is_allowed($rr['abook_channel'],$rr['xchan_hash'],'send_stream'))
+ continue;
+
$ev = array();
$ev['uid'] = $rr['abook_channel'];
$ev['account'] = $rr['abook_account'];
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'])
diff --git a/include/widgets.php b/include/widgets.php
index c7a4da6a0..96bced87f 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -196,7 +196,7 @@ function widget_savedsearch($arr) {
$a = get_app();
$search = ((x($_GET,'search')) ? $_GET['search'] : '');
-
+
if(x($_GET,'searchsave') && $search) {
$r = q("select * from `term` where `uid` = %d and `type` = %d and `term` = '%s' limit 1",
intval(local_user()),
@@ -264,7 +264,7 @@ function widget_savedsearch($arr) {
$o = replace_macros($tpl, array(
'$title' => t('Saved Searches'),
'$add' => t('add'),
- '$searchbox' => searchbox('','netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true),
+ '$searchbox' => searchbox($search,'netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true),
'$saved' => $saved,
));