more heavy lifting on API - though need to re-visit events and give them all message_ids from the origination site.

This commit is contained in:
friendica
2013-01-19 22:21:00 -08:00
parent 994f322d47
commit 45be26dd81
7 changed files with 78 additions and 50 deletions

View File

@@ -291,7 +291,7 @@ function event_store($arr) {
$private = (($arr['allow_cid'] || $arr['allow_gid'] || $arr['deny_cid'] || $arr['deny_gid']) ? 1 : 0);
q("UPDATE item SET title = '%s', body = '%s', object = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', edited = '%s', item_flags = %d WHERE id = %d AND uid = %d LIMIT 1",
q("UPDATE item SET title = '%s', body = '%s', object = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', edited = '%s', item_flags = %d, item_private = %d WHERE id = %d AND uid = %d LIMIT 1",
dbesc($arr['summary']),
dbesc(format_event_bbcode($arr)),
dbesc($object),
@@ -300,7 +300,8 @@ function event_store($arr) {
dbesc($arr['deny_cid']),
dbesc($arr['deny_gid']),
dbesc($arr['edited']),
intval(($private && ($r[0]['item_flags'] & ITEM_PRIVATE)) ? $r[0]['item_flags'] : $r[0]['item_flags'] ^ ITEM_PRIVATE),
intval($r[0]['item_flags']),
intval($private),
intval($r[0]['id']),
intval($arr['uid'])
);
@@ -368,8 +369,6 @@ function event_store($arr) {
$uri = item_message_id();
$private = (($arr['allow_cid'] || $arr['allow_gid'] || $arr['deny_cid'] || $arr['deny_gid']) ? 1 : 0);
if($private)
$item_flags |= ITEM_PRIVATE;
$item_arr = array();
@@ -387,6 +386,7 @@ function event_store($arr) {
$item_arr['allow_gid'] = $arr['allow_gid'];
$item_arr['deny_cid'] = $arr['deny_cid'];
$item_arr['deny_gid'] = $arr['deny_gid'];
$item_arr['private'] = (($arr['private'] || $private) ? 1 : 0);
$item_arr['verb'] = ACTIVITY_POST;
$item_arr['resource_type'] = 'event';