provide a hook for importing a channel photo at channel creation time

This commit is contained in:
zotlabs
2017-09-14 18:48:55 -07:00
parent cf120b2351
commit 1c0ece8411
2 changed files with 42 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ require_once('include/zot.php');
require_once('include/crypto.php');
require_once('include/menu.php');
require_once('include/perm_upgrade.php');
require_once('include/photo/photo_driver.php');
/**
* @brief Called when creating a new channel.
@@ -273,6 +274,17 @@ function create_identity($arr) {
return $ret;
}
$a = q("select * from account where account_id = %d",
intval($arr['account_id'])
);
$z = [ 'account' => $a[0], 'channel' = $r[0], 'photo_url' => '' ];
call_hooks('create_channel_photo',$z);
if($z['photo_url']) {
import_channel_photo_from_url($z['photo_url'],$arr['account_id'],$r[0]['channel_id']);
}
if($role_permissions && array_key_exists('limits',$role_permissions))
$perm_limits = $role_permissions['limits'];
else