Browse Source

don't update an event that hasn't changed.

pull/1/head
Friendika 10 years ago
parent
commit
a15bd91d17
3 changed files with 18 additions and 0 deletions
  1. +16
    -0
      include/event.php
  2. +1
    -0
      include/items.php
  3. +1
    -0
      mod/dfrn_notify.php

+ 16
- 0
include/event.php View File

@ -213,6 +213,22 @@ function event_store($arr) {
if($arr['id']) {
// has the event actually changed?
$r = q("SELECT * FROM `event` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($arr['id']),
intval($arr['uid'])
);
if((! count($r)) || ($r[0]['edited'] === $arr['edited'])) {
$r = q("SELECT * FROM `item` WHERE `event-id` = %d AND `uid` = %d LIMIT 1",
intval($arr['id']),
intval($arr['uid'])
);
return((count($r)) ? $r[0]['id'] : 0);
}
$r = q("UPDATE `event` SET
`edited` = '%s',
`start` = '%s',


+ 1
- 0
include/items.php View File

@ -1347,6 +1347,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee
if(x($ev,'desc') && x($ev,'start')) {
$ev['uid'] = $importer['uid'];
$ev['uri'] = $item_id;
$ev['edited'] = $datarray['edited'];
if(is_array($contact))
$ev['cid'] = $contact['id'];


+ 1
- 0
mod/dfrn_notify.php View File

@ -676,6 +676,7 @@ function dfrn_notify_post(&$a) {
$ev['cid'] = $importer['id'];
$ev['uid'] = $importer['uid'];
$ev['uri'] = $item_id;
$ev['edited'] = $datarray['edited'];
$r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($item_id),


Loading…
Cancel
Save