aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-05 16:13:26 -0800
committerfriendica <info@friendica.com>2015-02-05 16:13:26 -0800
commit153719a20a88b8d4e9c562b185f94e1af72de1de (patch)
treeda3c63d088c86f4a59d32753c4ddf56ad23e1b7a /include/diaspora.php
parentb1eebaaedb58d8f4055eed1580ad29f029095195 (diff)
downloadvolse-hubzilla-153719a20a88b8d4e9c562b185f94e1af72de1de.tar.gz
volse-hubzilla-153719a20a88b8d4e9c562b185f94e1af72de1de.tar.bz2
volse-hubzilla-153719a20a88b8d4e9c562b185f94e1af72de1de.zip
another issue with diaspora postings to sys channel - sys has no connections, hence no abook records.
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 8047d0e64..0e275a079 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -272,8 +272,6 @@ function diaspora_process_outbound($arr) {
}
-
-
function diaspora_handle_from_contact($contact_hash) {
logger("diaspora_handle_from_contact: contact id is " . $contact_hash, LOGGER_DEBUG);
@@ -291,11 +289,21 @@ function diaspora_get_contact_by_handle($uid,$handle) {
if(diaspora_is_blacklisted($handle))
return false;
+ require_once('include/identity.php');
+
+ $sys = get_sys_channel();
+ if(($sys) && ($sys['channel_id'] == $uid)) {
+ $r = q("SELECT * FROM xchan where xchan_addr = '%s' limit 1",
+ dbesc($handle)
+ );
+ }
+ else {
+ $r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where xchan_addr = '%s' and abook_channel = %d limit 1",
+ dbesc($handle),
+ intval($uid)
+ );
+ }
- $r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan where xchan_addr = '%s' and abook_channel = %d limit 1",
- dbesc($handle),
- intval($uid)
- );
return (($r) ? $r[0] : false);
}