mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 18:08:49 +00:00
Some more replaced item SQL queries
This commit is contained in:
parent
9f74e96c93
commit
8e24de90ba
3 changed files with 26 additions and 39 deletions
|
@ -213,17 +213,17 @@ function mailstream_subject($item) {
|
|||
$parent = $item['thr-parent'];
|
||||
// Don't look more than 100 levels deep for a subject, in case of loops
|
||||
for ($i = 0; ($i < 100) && $parent; $i++) {
|
||||
$r = q("SELECT `thr-parent`, `title` FROM `item` WHERE `uri` = '%s'", dbesc($parent));
|
||||
if (!DBM::is_result($r)) {
|
||||
$parent_item = Item::selectFirst(['thr-parent', 'title'], ['uri' => $parent]);
|
||||
if (!DBM::is_result($parent_item)) {
|
||||
break;
|
||||
}
|
||||
if ($r[0]['thr-parent'] === $parent) {
|
||||
if ($parent_item['thr-parent'] === $parent) {
|
||||
break;
|
||||
}
|
||||
if ($r[0]['title']) {
|
||||
return L10n::t('Re:') . ' ' . mailstream_decode_subject($r[0]['title']);
|
||||
if ($parent_item['title']) {
|
||||
return L10n::t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']);
|
||||
}
|
||||
$parent = $r[0]['thr-parent'];
|
||||
$parent = $parent_item['thr-parent'];
|
||||
}
|
||||
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d",
|
||||
intval($item['contact-id']), intval($item['uid']));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue