diff options
author | friendica <info@friendica.com> | 2012-12-05 16:44:07 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-05 16:44:07 -0800 |
commit | 1c6f301d8faf2e6a5939e47c7a83655615bfc762 (patch) | |
tree | 42705f96df9dde72f25b66ce8031cfaf14a2af31 /include/text.php | |
parent | e17ba14696d6ee7532bacce6b5519594e001f13f (diff) | |
download | volse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.tar.gz volse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.tar.bz2 volse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.zip |
y'all got mail
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index ee95646b7..b97b21981 100644 --- a/include/text.php +++ b/include/text.php @@ -1722,6 +1722,27 @@ function xchan_query(&$items) { } +function xchan_mail_query(&$item) { + $arr = array(); + $chans = null; + if($item) { + if($item['from_xchan'] && (! in_array($item['from_xchan'],$arr))) + $arr[] = "'" . dbesc($item['from_xchan']) . "'"; + if($item['to_xchan'] && (! in_array($item['to_xchan'],$arr))) + $arr[] = "'" . dbesc($item['to_xchan']) . "'"; + } + + if(count($arr)) { + $chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash + where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )"); + } + if($chans) { + $item['from'] = find_xchan_in_array($item['from_xchan'],$chans); + $item['to'] = find_xchan_in_array($item['to_xchan'],$chans); + } +} + + function find_xchan_in_array($xchan,$arr) { if(count($arr)) { foreach($arr as $x) { |