- public static function uri($uri, $network = "", $uid = 0, $cache = true) {
+ public static function uri($uri, $network = "", $uid = -1, $cache = true) {
// Only store into the cache if the value seems to be valid
if (!in_array($data['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
// Only store into the cache if the value seems to be valid
if (!in_array($data['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
/// @todo temporary fix - we need a real contact update function that updates only changing fields
/// The biggest problem is the avatar picture that could have a reduced image size.
/// @todo temporary fix - we need a real contact update function that updates only changing fields
/// The biggest problem is the avatar picture that could have a reduced image size.
'confirm' => $data['confirm'],
'poco' => $data['poco'],
'network' => $data['network'],
'confirm' => $data['confirm'],
'poco' => $data['poco'],
'network' => $data['network'],
- if (substr($alias, 0, 5) == 'acct:') {
+ if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
+ $data["alias"] = $alias;
+ } elseif (substr($alias, 0, 5) == 'acct:') {
foreach ($webfinger["aliases"] as $alias) {
if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
$data["alias"] = $alias;
foreach ($webfinger["aliases"] as $alias) {
if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
$data["alias"] = $alias;
// Fetch further information from the hcard
$data = self::pollHcard($hcard_url, $data);
// Fetch further information from the hcard
$data = self::pollHcard($hcard_url, $data);
- if (is_string($webfinger["subject"]) && strstr($webfinger["subject"], "@")) {
+ if (is_string($webfinger["subject"]) && strstr($webfinger["subject"], "@") &&
+ !strstr(normalise_link($webfinger["subject"]), "http://")) {
- if (dbm::is_result($x) && dbm::is_result($r)) {
- $mailbox = construct_mailbox_name($r[0]);
- $password = '';
- openssl_private_decrypt(hex2bin($r[0]['pass']), $password, $x[0]['prvkey']);
- $mbox = email_connect($mailbox, $r[0]['user'], $password);
- if (!mbox) {
- return false;
+ if (DBM::is_result($x) && DBM::is_result($r)) {
+ $mailbox = construct_mailbox_name($r[0]);
+ $password = '';
+ openssl_private_decrypt(hex2bin($r[0]['pass']), $password, $x[0]['prvkey']);
+ $mbox = email_connect($mailbox, $r[0]['user'], $password);
+ if (!mbox) {
+ return false;
+ }
- $msgs = email_poll($mbox, $uri);
- logger('searching '.$uri.', '.count($msgs).' messages found.', LOGGER_DEBUG);
+ $msgs = email_poll($mbox, $uri);
+ logger('searching '.$uri.', '.count($msgs).' messages found.', LOGGER_DEBUG);
$data["name"] = substr($uri, 0, strpos($uri, '@'));
$data["nick"] = $data["name"];
$data["photo"] = avatar_img($uri);
$data["name"] = substr($uri, 0, strpos($uri, '@'));
$data["nick"] = $data["name"];
$data["photo"] = avatar_img($uri);