diff options
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/SuperCurl.php | 2 | ||||
-rw-r--r-- | include/channel.php | 12 | ||||
-rw-r--r-- | include/dir_fns.php | 4 | ||||
-rwxr-xr-x | include/items.php | 2 | ||||
-rw-r--r-- | include/message.php | 2 | ||||
-rw-r--r-- | include/network.php | 4 | ||||
-rw-r--r-- | include/security.php | 2 | ||||
-rw-r--r-- | include/zot.php | 8 |
9 files changed, 19 insertions, 19 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 683e91b52..92b9fddbd 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -465,7 +465,7 @@ class Enotify { // use $_SESSION['zid_override'] to force zid() to use // the recipient address instead of the current observer - $_SESSION['zid_override'] = $recip['channel_address'] . '@' . \App::get_hostname(); + $_SESSION['zid_override'] = channel_reddress($recip); $_SESSION['zrl_override'] = z_root() . '/channel/' . $recip['channel_address']; $textversion = zidify_links($textversion); diff --git a/Zotlabs/Lib/SuperCurl.php b/Zotlabs/Lib/SuperCurl.php index 1c8583ff5..462a62b36 100644 --- a/Zotlabs/Lib/SuperCurl.php +++ b/Zotlabs/Lib/SuperCurl.php @@ -105,7 +105,7 @@ class SuperCurl { $opts['cookie'] = 'PHPSESSID=' . trim(file_get_contents('store/[data]/cookien_' . $this->magicauth)); $c = channelx_by_n($this->magicauth); if($c) - $url = zid($this->url,$c['channel_address'] . '@' . \App::get_hostname()); + $url = zid($this->url,channel_reddress($c)); } if($this->custom) $opts['custom'] = $this->custom; diff --git a/include/channel.php b/include/channel.php index ce515c917..5beb4a53c 100644 --- a/include/channel.php +++ b/include/channel.php @@ -297,7 +297,7 @@ function create_identity($arr) { dbesc($guid), dbesc($sig), dbesc($hash), - dbesc($ret['channel']['channel_address'] . '@' . App::get_hostname()), + dbesc(channel_reddress($ret['channel'])), intval($primary), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey']))), @@ -319,7 +319,7 @@ function create_identity($arr) { dbesc(z_root() . "/photo/profile/l/{$newuid}"), dbesc(z_root() . "/photo/profile/m/{$newuid}"), dbesc(z_root() . "/photo/profile/s/{$newuid}"), - dbesc($ret['channel']['channel_address'] . '@' . App::get_hostname()), + dbesc(channel_reddress($ret['channel'])), dbesc(z_root() . '/channel/' . $ret['channel']['channel_address']), dbesc(z_root() . '/follow?f=&url=%s'), dbesc(z_root() . '/poco/' . $ret['channel']['channel_address']), @@ -918,7 +918,7 @@ function profile_load($nickname, $profile = '') { App::$profile = $p[0]; App::$profile_uid = $p[0]['profile_uid']; - App::$page['title'] = App::$profile['channel_name'] . " - " . App::$profile['channel_address'] . "@" . App::get_hostname(); + App::$page['title'] = App::$profile['channel_name'] . " - " . channel_reddress(App::$profile); App::$profile['permission_to_view'] = $can_view_profile; @@ -1033,7 +1033,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $connect_url = rconnect_url($profile['uid'],get_observer_hash()); $connect = (($connect_url) ? t('Connect') : ''); if($connect_url) - $connect_url = sprintf($connect_url,urlencode($profile['channel_address'] . '@' . App::get_hostname())); + $connect_url = sprintf($connect_url,urlencode(channel_reddress($profile))); // premium channel - over-ride @@ -1779,7 +1779,7 @@ function get_zcard($channel,$observer_hash = '',$args = array()) { // $translate = intval(($scale / 1.0) * 100); - $channel['channel_addr'] = $channel['channel_address'] . '@' . App::get_hostname(); + $channel['channel_addr'] = channel_reddress($channel); $zcard = array('chan' => $channel); $r = q("select height, width, resource_id, imgscale, mimetype from photo where uid = %d and imgscale = %d and photo_usage = %d", @@ -1841,7 +1841,7 @@ function get_zcard_embed($channel,$observer_hash = '',$args = array()) { $pphoto = array('mimetype' => $channel['xchan_photo_mimetype'], 'width' => 300 , 'height' => 300, 'href' => $channel['xchan_photo_l']); } - $channel['channel_addr'] = $channel['channel_address'] . '@' . App::get_hostname(); + $channel['channel_addr'] = channel_reddress($channel); $zcard = array('chan' => $channel); $r = q("select height, width, resource_id, imgscale, mimetype from photo where uid = %d and imgscale = %d and photo_usage = %d", diff --git a/include/dir_fns.php b/include/dir_fns.php index 9f1be1a42..53a81b242 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -423,7 +423,7 @@ function local_dir_update($uid, $force) { $arr = array('channel_id' => $uid, 'hash' => $hash, 'profile' => $profile); call_hooks('local_dir_update', $arr); - $address = $p[0]['channel_address'] . '@' . App::get_hostname(); + $address = channel_reddress($p[0]); if (perm_is_allowed($uid, '', 'view_profile')) { import_directory_profile($hash, $arr['profile'], $address, 0); @@ -439,5 +439,5 @@ function local_dir_update($uid, $force) { } $ud_hash = random_string() . '@' . App::get_hostname(); - update_modtime($hash, $ud_hash, $p[0]['channel_address'] . '@' . App::get_hostname(),(($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED)); + update_modtime($hash, $ud_hash, channel_reddress($p[0]),(($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED)); } diff --git a/include/items.php b/include/items.php index c3d2e2676..ba39fd7ac 100755 --- a/include/items.php +++ b/include/items.php @@ -2262,7 +2262,7 @@ function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id, logger('storing diaspora comment signature',LOGGER_DEBUG); - $diaspora_handle = $channel['channel_address'] . '@' . App::get_hostname(); + $diaspora_handle = channel_reddress($channel); $signed_text = $datarray['mid'] . ';' . $parent_item['mid'] . ';' . $signed_body . ';' . $diaspora_handle; diff --git a/include/message.php b/include/message.php index d3d8181ae..0ba1978f0 100644 --- a/include/message.php +++ b/include/message.php @@ -75,7 +75,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' if($recip) $recip_handle = $recip[0]['xchan_addr']; - $sender_handle = $channel['channel_address'] . '@' . App::get_hostname(); + $sender_handle = channel_reddress($channel); $handles = $recip_handle . ';' . $sender_handle; diff --git a/include/network.php b/include/network.php index de10f1e0e..c23005935 100644 --- a/include/network.php +++ b/include/network.php @@ -2010,11 +2010,11 @@ function get_site_info() { $admin = array(); foreach($r as $rr) { if($rr['channel_pageflags'] & PAGE_HUBADMIN) - $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . App::get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + $admin[] = array( 'name' => $rr['channel_name'], 'address' => channel_reddress($rr), 'channel' => z_root() . '/channel/' . $rr['channel_address']); } if(! $admin) { foreach($r as $rr) { - $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . App::get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + $admin[] = array( 'name' => $rr['channel_name'], 'address' => channel_reddress($rr), 'channel' => z_root() . '/channel/' . $rr['channel_address']); } } } diff --git a/include/security.php b/include/security.php index 83bf51bc0..9b508d339 100644 --- a/include/security.php +++ b/include/security.php @@ -265,7 +265,7 @@ function change_channel($change_channel) { ); if($x) { $_SESSION['my_url'] = $x[0]['xchan_url']; - $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . App::get_hostname(); + $_SESSION['my_address'] = channel_reddress($r[0]); App::set_observer($x[0]); App::set_perms(get_all_perms(local_channel(), $hash)); diff --git a/include/zot.php b/include/zot.php index 8771495ff..49b66bc62 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1593,7 +1593,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ } $channel = $r[0]; - $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . App::get_hostname() . '>'); + $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); /* blacklisted channels get a permission denied, no special message to tip them off */ @@ -2082,7 +2082,7 @@ function process_mail_delivery($sender, $arr, $deliveries) { } $channel = $r[0]; - $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . App::get_hostname() . '>'); + $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); /* blacklisted channels get a permission denied, no special message to tip them off */ @@ -3532,7 +3532,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('item',$arr) && is_array($arr['item'][0])) { $DR = new Zotlabs\Zot\DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed'); - $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . App::get_hostname() . '>'); + $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); } else $DR = new Zotlabs\Zot\DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered'); @@ -4032,7 +4032,7 @@ function check_zotinfo($channel,$locations,&$ret) { dbesc($channel['channel_guid']), dbesc($channel['channel_guid_sig']), dbesc($channel['channel_hash']), - dbesc($channel['channel_address'] . '@' . App::get_hostname()), + dbesc(channel_reddress($channel)), intval(1), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), |