function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) {
-
- require_once "include/bbcode.php";
-
$a = get_app();
$o = '';
$search = $_REQUEST['query'];
}
- logger("Searching for ".$search." - type ".$type, LOGGER_DEBUG);
+ logger("Searching for ".$search." - type ".$type." conversation ".$conv_id, LOGGER_DEBUG);
if ($search != '') {
$sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
$items = array_merge($groups, $contacts);
+ // At multi threaded posts the conv_id is not the parent of the whole thread
+ if ($conv_id > 0) {
+ $parent_item = dba::selectFirst('item', ['parent'], ['id' => $conv_id]);
+ if (DBM::is_result($parent_item)) {
+ $conv_id = $parent_item['parent'];
+ }
+ }
+
if ($conv_id) {
/*
* if $conv_id is set, get unknown contacts in thread