We should return a return value when we say that we have a return value.
This commit is contained in:
parent
7240b2198b
commit
9900d28c4b
2 changed files with 8 additions and 4 deletions
|
@ -776,7 +776,7 @@ class dba {
|
||||||
$params[] = $value;
|
$params[] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::e($sql, $params);
|
return self::e($sql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -719,11 +719,15 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
|
||||||
$conv = dba::fetch_first("SELECT `protocol` FROM `conversation` WHERE `item-uri` = ?", $conversation['item-uri']);
|
$conv = dba::fetch_first("SELECT `protocol` FROM `conversation` WHERE `item-uri` = ?", $conversation['item-uri']);
|
||||||
if (dbm::is_result($conv)) {
|
if (dbm::is_result($conv)) {
|
||||||
// Replace the conversation entry when the new one is better
|
// Replace the conversation entry when the new one is better
|
||||||
if (($conv['protocol'] == 0) OR ($conv['protocol'] > $conversation['protocol'])) {
|
if ((($conv['protocol'] == 0) OR ($conv['protocol'] > $conversation['protocol'])) AND ($conversation['protocol'] > 0)) {
|
||||||
dba::update('conversation', $conversation, array('item-uri' => $conversation['item-uri']));
|
if (!dba::update('conversation', $conversation, array('item-uri' => $conversation['item-uri']))) {
|
||||||
|
logger('Conversation: update for '.$conversation['item-uri'].' from '.$conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dba::insert('conversation', $conversation);
|
if (!dba::insert('conversation', $conversation)) {
|
||||||
|
logger('Conversation: insert for '.$conversation['item-uri'].' (protocol '.$conversation['protocol'].') failed', LOGGER_DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue