diff options
author | friendica <info@friendica.com> | 2014-07-29 19:52:19 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-07-29 19:52:19 -0700 |
commit | c8829e72434c4d5342d9b2c4a4f22b33e8ea1887 (patch) | |
tree | 7203099d8588bfec55908bfeb0431557ed9b56e1 /mod/connedit.php | |
parent | 60e7837f00070508f9ea9672f4812e95d644f70b (diff) | |
download | volse-hubzilla-c8829e72434c4d5342d9b2c4a4f22b33e8ea1887.tar.gz volse-hubzilla-c8829e72434c4d5342d9b2c4a4f22b33e8ea1887.tar.bz2 volse-hubzilla-c8829e72434c4d5342d9b2c4a4f22b33e8ea1887.zip |
we didn't need the extra query - everything we require is already in memory
Diffstat (limited to 'mod/connedit.php')
-rw-r--r-- | mod/connedit.php | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/mod/connedit.php b/mod/connedit.php index 64b707433..30780180e 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -157,43 +157,32 @@ function connedit_post(&$a) { ); if(($pr) && (! ($abook_flags & ABOOK_FLAG_HIDDEN)) && (intval(get_pconfig($channel['channel_id'],'system','post_newfriend')))) { - $objtype = ACTIVITY_OBJ_PERSON; - $t = q("select * from abook left join xchan on xchan_hash = abook_xchan where abook_id = %d and abook_channel = %d limit 1", - intval($a->poi['abook_id']), - intval($channel['channel_id']) - ); - if($t) { - $xarr = array(); - $xarr['verb'] = ACTIVITY_FRIEND; - $xarr['item_flags'] = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; - $xarr['owner_xchan'] = $xarr['author_xchan'] = $channel['channel_hash']; - $xarr['allow_cid'] = $channel['channel_allow_cid']; - $xarr['allow_gid'] = $channel['channel_allow_gid']; - $xarr['deny_cid'] = $channel['channel_deny_cid']; - $xarr['deny_gid'] = $channel['channel_deny_gid']; - $xarr['item_private'] = (($xarr['allow_cid']||$xarr['allow_gid']||$xarr['deny_cid']||$xarr['deny_gid']) ? 1 : 0); - - - $obj = array( - 'type' => ACTIVITY_OBJ_PERSON, - 'title' => $t[0]['xchan_name'], - 'id' => $t[0]['xchan_hash'], - 'link' => array( - array('rel' => 'alternate', 'type' => 'text/html', 'href' => $t[0]['xchan_url']), - array('rel' => 'photo', 'type' => $t[0]['xchan_photo_mimetype'], 'href' => $t[0]['xchan_photo_l']) - ), - ); - $xarr['object'] = json_encode($obj); - $xarr['obj_type'] = ACTIVITY_OBJ_PERSON; - - - $xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . $t[0]['xchan_url'] . ']' . $t[0]['xchan_name'] . '[/zrl]'; - - $xarr['body'] .= "\n\n\n" . '[zrl=' . $t[0]['xchan_url'] . '][zmg=80x80]' . $t[0]['xchan_photo_m'] . '[/zmg][/zrl]'; - - post_activity_item($xarr); - - } + $xarr = array(); + $xarr['verb'] = ACTIVITY_FRIEND; + $xarr['item_flags'] = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; + $xarr['owner_xchan'] = $xarr['author_xchan'] = $channel['channel_hash']; + $xarr['allow_cid'] = $channel['channel_allow_cid']; + $xarr['allow_gid'] = $channel['channel_allow_gid']; + $xarr['deny_cid'] = $channel['channel_deny_cid']; + $xarr['deny_gid'] = $channel['channel_deny_gid']; + $xarr['item_private'] = (($xarr['allow_cid']||$xarr['allow_gid']||$xarr['deny_cid']||$xarr['deny_gid']) ? 1 : 0); + $obj = array( + 'type' => ACTIVITY_OBJ_PERSON, + 'title' => $a->poi['xchan_name'], + 'id' => $a->poi['xchan_hash'], + 'link' => array( + array('rel' => 'alternate', 'type' => 'text/html', 'href' => $a->poi['xchan_url']), + array('rel' => 'photo', 'type' => $a->poi['xchan_photo_mimetype'], 'href' => $a->poi['xchan_photo_l']) + ), + ); + $xarr['object'] = json_encode($obj); + $xarr['obj_type'] = ACTIVITY_OBJ_PERSON; + + $xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . $a->poi['xchan_url'] . ']' . $a->poi['xchan_name'] . '[/zrl]'; + + $xarr['body'] .= "\n\n\n" . '[zrl=' . $a->poi['xchan_url'] . '][zmg=80x80]' . $a->poi['xchan_photo_m'] . '[/zmg][/zrl]'; + + post_activity_item($xarr); } |