diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-07-29 22:04:07 +0200 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-07-29 22:04:07 +0200 |
commit | 98fa996b3f5125b60e2653bca2218b08041ad6a4 (patch) | |
tree | 685c3909ac49f7a25cd39877f74ed56ada9b15e0 /include/network.php | |
parent | 07e890a79a5c506b2e32272edf86ad4aba3b8fba (diff) | |
parent | cbb6d37b6ca7e5d9e476fd3e7bea3ba56d3271e1 (diff) | |
download | volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.gz volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.tar.bz2 volse-hubzilla-98fa996b3f5125b60e2653bca2218b08041ad6a4.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php index f331da488..5d01b7eba 100644 --- a/include/network.php +++ b/include/network.php @@ -531,7 +531,7 @@ function avatar_img($email) { $avatar = array(); $a = get_app(); - $avatar['size'] = 175; + $avatar['size'] = 300; $avatar['email'] = $email; $avatar['url'] = ''; $avatar['success'] = false; @@ -1135,9 +1135,27 @@ function discover_by_webbie($webbie) { } $r = q("select * from xchan where xchan_hash = '%s' limit 1", - dbesc($webbie) + dbesc($addr) ); - if(! $r) { + + /** + * + * Diaspora communications are notoriously unreliable and receiving profile update messages (indeed any messages) + * are pretty much random luck. We'll check the timestamp of the xchan_name_date at a higher level and refresh + * this record once a month; because if you miss a profile update message and they update their profile photo or name + * you're otherwise stuck with stale info until they change their profile again - which could be years from now. + * + */ + + if($r) { + $r = q("update xchan set xchan_name = '%s', xchan_network = '%s', xchan_name_date = '%s' where xchan_hash = '%s' limit 1", + dbesc($vcard['fn']), + dbesc($network), + dbesc(datetime_convert()), + dbesc($addr) + ); + } + else { $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_pubkey, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_instance_url, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", dbesc($addr), |