aboutsummaryrefslogtreecommitdiffstats
path: root/mod/message.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-06 19:15:42 -0800
committerfriendica <info@friendica.com>2011-12-06 19:15:42 -0800
commit7eba8adbf7ce1656b9c85f02b21fe46303b219e7 (patch)
treeb9f197666b827add55798b48c07aef8034642d86 /mod/message.php
parent0c24784f5e92e0c8269f255e962312574871f2f0 (diff)
downloadvolse-hubzilla-7eba8adbf7ce1656b9c85f02b21fe46303b219e7.tar.gz
volse-hubzilla-7eba8adbf7ce1656b9c85f02b21fe46303b219e7.tar.bz2
volse-hubzilla-7eba8adbf7ce1656b9c85f02b21fe46303b219e7.zip
pm replies
Diffstat (limited to 'mod/message.php')
-rw-r--r--mod/message.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/mod/message.php b/mod/message.php
index 172a1ca98..7a3b870b3 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -217,11 +217,19 @@ function message_content(&$a) {
);
if(count($r)) {
$contact_id = $r[0]['contact-id'];
+ $convid = $r[0]['convid'];
+
+ $sql_extra = sprintf(" and `mail`.`parent-uri` = '%s' ", dbesc($r[0]['parent-uri']));
+ if($convid)
+ $sql_extra = sprintf(" and ( `mail`.`parent-uri` = '%s' OR `mail`.`convid` = '%d' ) ",
+ dbesc($r[0]['parent-uri']),
+ intval($convid)
+ );
+
$messages = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`
FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
- WHERE `mail`.`uid` = %d AND `mail`.`parent-uri` = '%s' ORDER BY `mail`.`created` ASC",
- intval(local_user()),
- dbesc($r[0]['parent-uri'])
+ WHERE `mail`.`uid` = %d $sql_extra ORDER BY `mail`.`created` ASC",
+ intval(local_user())
);
}
if(! count($messages)) {