aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Contactedit.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Contactedit.php')
-rw-r--r--Zotlabs/Module/Contactedit.php48
1 files changed, 16 insertions, 32 deletions
diff --git a/Zotlabs/Module/Contactedit.php b/Zotlabs/Module/Contactedit.php
index 58c3380a1..3527e9380 100644
--- a/Zotlabs/Module/Contactedit.php
+++ b/Zotlabs/Module/Contactedit.php
@@ -177,22 +177,8 @@ class Contactedit extends Controller {
intval($channel['channel_id'])
);
if (($pr) && (!intval($contact['abook_hidden'])) && (intval(get_pconfig($channel['channel_id'], 'system', 'post_newfriend')))) {
- $xarr = [];
-
- $xarr['item_wall'] = 1;
- $xarr['item_origin'] = 1;
- $xarr['item_thread_top'] = 1;
- $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);
-
$xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . $contact['xchan_url'] . ']' . $contact['xchan_name'] . '[/zrl]';
-
- $xarr['body'] .= "\n\n\n" . '[zrl=' . $contact['xchan_url'] . '][zmg=80x80]' . $contact['xchan_photo_m'] . '[/zmg][/zrl]';
-
+ $xarr['body'] .= "\n\n\n" . '[zrl=' . $contact['xchan_url'] . '][zmg=' . $contact['xchan_photo_m'] . ']' . $contact['xchan_name'] . '[/zmg][/zrl]';
post_activity_item($xarr);
}
@@ -494,28 +480,32 @@ class Contactedit extends Controller {
'message' => ''
];
- if ($cmd === 'resetphoto') {
- q("update xchan set xchan_photo_date = '2001-01-01 00:00:00' where xchan_hash = '%s'",
+ if ($cmd === 'refresh') {
+ q("update xchan set xchan_photo_date = '0001-01-01 00:00:00', xchan_name_date = '0001-01-01 00:00:00' where xchan_hash = '%s'",
dbesc($contact['xchan_hash'])
);
- $cmd = 'refresh';
- }
- if ($cmd === 'refresh') {
if ($contact['xchan_network'] === 'zot6') {
if (Libzot::refresh($contact, App::get_channel())) {
$ret['success'] = true;
$ret['message'] = t('Refresh succeeded');
}
else {
- $ret['message'] = t('Refresh failed - channel is currently unavailable');
+ $ret['message'] = t('Refresh failed');
}
}
else {
// if you are on a different network we'll force a refresh of the connection basic info
- Master::Summon(['Notifier', 'permission_update', $contact['abook_id']]);
- $ret['success'] = true;
- $ret['message'] = t('Refresh succeeded');
+ $hookinfo = [
+ 'contact' => $contact,
+ 'success' => false,
+ 'message' => ''
+ ];
+
+ call_hooks('actor_refetch', $hookinfo);
+
+ $ret['success'] = $hookinfo['success'];
+ $ret['message'] = $hookinfo['message'];
}
return $ret;
@@ -625,16 +615,10 @@ class Contactedit extends Controller {
return [
'refresh' => [
- 'label' => t('Refresh Permissions'),
- 'title' => t('Fetch updated permissions'),
+ 'label' => t('Refresh'),
+ 'title' => t('Refetch contact info'),
],
- 'rephoto' => [
- 'label' => t('Refresh Photo'),
- 'title' => t('Fetch updated photo'),
- ],
-
-
'block' => [
'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')),
'sel' => (intval($contact['abook_blocked']) ? 'active' : ''),