mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 04:45:16 +02:00
Issue-3412 related: Don't send connection posts anymore
This commit is contained in:
parent
139f7cdc41
commit
c70ebadd7d
12 changed files with 0 additions and 298 deletions
|
@ -83,14 +83,12 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$duplex = $handsfree['duplex'];
|
||||
$cid = 0;
|
||||
$hidden = intval(defaults($handsfree, 'hidden' , 0));
|
||||
$activity = intval(defaults($handsfree, 'activity', 0));
|
||||
} else {
|
||||
$dfrn_id = notags(trim(defaults($_POST, 'dfrn_id' , '')));
|
||||
$intro_id = intval(defaults($_POST, 'intro_id' , 0));
|
||||
$duplex = intval(defaults($_POST, 'duplex' , 0));
|
||||
$cid = intval(defaults($_POST, 'contact_id', 0));
|
||||
$hidden = intval(defaults($_POST, 'hidden' , 0));
|
||||
$activity = intval(defaults($_POST, 'activity' , 0));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -401,50 +399,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$ret = Diaspora::sendShare($user, $contact);
|
||||
logger('share returns: ' . $ret);
|
||||
}
|
||||
|
||||
// Send a new friend post if we are allowed to...
|
||||
$profile = dba::selectFirst('profile', ['hide-friends'], ['is-default' => true, 'uid' => $uid]);
|
||||
if (x($profile, 'hide-friends') === 0 && $activity && !$hidden) {
|
||||
$self = dba::selectFirst('contact', [], ['self' => true, 'uid' => $uid]);
|
||||
if (DBM::is_result($self)) {
|
||||
$arr = [];
|
||||
$arr['guid'] = get_guid(32);
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $uid);
|
||||
$arr['uid'] = $uid;
|
||||
$arr['contact-id'] = $self['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self['thumb'];
|
||||
|
||||
$A = '[url=' . $self['url'] . ']' . $self['name'] . '[/url]';
|
||||
$B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||
$BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
|
||||
|
||||
$arr['verb'] = ACTIVITY_FRIEND;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
|
||||
$arr['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
|
||||
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $user['allow_cid'];
|
||||
$arr['allow_gid'] = $user['allow_gid'];
|
||||
$arr['deny_cid'] = $user['deny_cid'];
|
||||
$arr['deny_gid'] = $user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact['id']);
|
||||
|
@ -665,49 +619,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
}
|
||||
}
|
||||
|
||||
// Send a new friend post if we are allowed to...
|
||||
if ($page && intval(PConfig::get($local_uid, 'system', 'post_joingroup'))) {
|
||||
$profile = dba::selectFirst('profile', ['hide-friends'], ['is-default' => true, 'uid' => $local_uid]);
|
||||
if (x($profile, 'hide-friends') === 0) {
|
||||
$self = dba::selectFirst('contact', [], ['self' => true, 'uid' => $local_uid]);
|
||||
if (DBM::is_result($self)) {
|
||||
$arr = [];
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $local_uid);
|
||||
$arr['uid'] = $local_uid;
|
||||
$arr['contact-id'] = $self['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self['thumb'];
|
||||
|
||||
$A = '[url=' . $self['url'] . ']' . $self['name'] . '[/url]';
|
||||
$B = '[url=' . $combined['url'] . ']' . $combined['name'] . '[/url]';
|
||||
$BPhoto = '[url=' . $combined['url'] . ']' . '[img]' . $combined['thumb'] . '[/img][/url]';
|
||||
|
||||
$arr['verb'] = ACTIVITY_JOIN;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_GROUP;
|
||||
$arr['body'] = L10n::t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
|
||||
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $combined['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $user['allow_cid'];
|
||||
$arr['allow_gid'] = $user['allow_gid'];
|
||||
$arr['deny_cid'] = $user['deny_cid'];
|
||||
$arr['deny_gid'] = $user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System::xmlExit(0); // Success
|
||||
return; // NOTREACHED
|
||||
////////////////////// End of this scenario ///////////////////////////////////////////////
|
||||
|
|
|
@ -577,7 +577,6 @@ function dfrn_request_content(App $a)
|
|||
'dfrn_id' => $r[0]['issued-id'],
|
||||
'intro_id' => $intro[0]['id'],
|
||||
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
|
||||
'activity' => intval(PConfig::get($r[0]['uid'], 'system', 'post_newfriend'))
|
||||
];
|
||||
dfrn_confirm_post($a, $handsfree);
|
||||
}
|
||||
|
|
|
@ -173,7 +173,6 @@ function notifications_content(App $a) {
|
|||
'$fullname' => $it['name'],
|
||||
'$url' => $it['url'],
|
||||
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
|
||||
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
|
||||
|
||||
'$knowyou' => $it['knowyou'],
|
||||
'$approve' => L10n::t('Approve'),
|
||||
|
@ -252,7 +251,6 @@ function notifications_content(App $a) {
|
|||
'$gender' => $it['gender'],
|
||||
'$lbl_gender' => L10n::t('Gender:'),
|
||||
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
|
||||
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
|
||||
'$url' => $it['url'],
|
||||
'$zrl' => $it['zrl'],
|
||||
'$lbl_url' => L10n::t('Profile URL'),
|
||||
|
|
|
@ -403,9 +403,6 @@ function profiles_post(App $a) {
|
|||
$comma2 = (($region && $country_name) ? ', ' : '');
|
||||
$value = $locality . $comma1 . $region . $comma2 . $country_name;
|
||||
}
|
||||
|
||||
profile_activity($changes,$value);
|
||||
|
||||
}
|
||||
|
||||
$r = q("UPDATE `profile`
|
||||
|
@ -510,96 +507,6 @@ function profiles_post(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function profile_activity($changed, $value) {
|
||||
$a = get_app();
|
||||
|
||||
if (! local_user() || ! is_array($changed) || ! count($changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($a->user['hidewall'] || Config::get('system', 'block_public')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! PConfig::get(local_user(), 'system', 'post_profilechange')) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'include/items.php';
|
||||
|
||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
if (! DBM::is_result($self)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
$arr['guid'] = get_guid(32);
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
|
||||
$arr['uid'] = local_user();
|
||||
$arr['contact-id'] = $self[0]['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
|
||||
$arr['verb'] = ACTIVITY_UPDATE;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PROFILE;
|
||||
|
||||
$A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
|
||||
|
||||
|
||||
$changes = '';
|
||||
$t = count($changed);
|
||||
$z = 0;
|
||||
foreach ($changed as $ch) {
|
||||
if (strlen($changes)) {
|
||||
if ($z == ($t - 1)) {
|
||||
$changes .= L10n::t(' and ');
|
||||
} else {
|
||||
$changes .= ', ';
|
||||
}
|
||||
}
|
||||
$z ++;
|
||||
$changes .= $ch;
|
||||
}
|
||||
|
||||
$prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . L10n::t('public profile') . '[/url]';
|
||||
|
||||
if ($t == 1 && strlen($value)) {
|
||||
$message = L10n::t('%1$s changed %2$s to “%3$s”', $A, $changes, $value);
|
||||
$message .= "\n\n" . L10n::t(' - Visit %1$s\'s %2$s', $A, $prof);
|
||||
} else {
|
||||
$message = L10n::t('%1$s has an updated %2$s, changing %3$s.', $A, $prof, $changes);
|
||||
}
|
||||
|
||||
|
||||
$arr['body'] = $message;
|
||||
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
|
||||
. '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $a->user['allow_cid'];
|
||||
$arr['allow_gid'] = $a->user['allow_gid'];
|
||||
$arr['deny_cid'] = $a->user['deny_cid'];
|
||||
$arr['deny_gid'] = $a->user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function profiles_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
|
|
|
@ -442,9 +442,6 @@ function settings_post(App $a)
|
|||
$suggestme = ((x($_POST, 'suggestme')) ? intval($_POST['suggestme']) : 0);
|
||||
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
|
||||
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
|
||||
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
|
||||
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
|
||||
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
|
||||
|
||||
$email_textonly = (($_POST['email_textonly'] == 1) ? 1 : 0);
|
||||
$detailed_notif = (($_POST['detailed_notif'] == 1) ? 1 : 0);
|
||||
|
@ -558,9 +555,6 @@ function settings_post(App $a)
|
|||
PConfig::set(local_user(), 'expire', 'network_only', $expire_network_only);
|
||||
|
||||
PConfig::set(local_user(), 'system', 'suggestme', $suggestme);
|
||||
PConfig::set(local_user(), 'system', 'post_newfriend', $post_newfriend);
|
||||
PConfig::set(local_user(), 'system', 'post_joingroup', $post_joingroup);
|
||||
PConfig::set(local_user(), 'system', 'post_profilechange', $post_profilechange);
|
||||
|
||||
PConfig::set(local_user(), 'system', 'email_textonly', $email_textonly);
|
||||
PConfig::set(local_user(), 'system', 'detailed_notif', $detailed_notif);
|
||||
|
@ -1020,9 +1014,6 @@ function settings_content(App $a)
|
|||
$expire_photos = PConfig::get(local_user(), 'expire', 'photos', false);
|
||||
$expire_network_only = PConfig::get(local_user(), 'expire', 'network_only', false);
|
||||
$suggestme = PConfig::get(local_user(), 'system', 'suggestme', false);
|
||||
$post_newfriend = PConfig::get(local_user(), 'system', 'post_newfriend', false);
|
||||
$post_joingroup = PConfig::get(local_user(), 'system', 'post_joingroup', false);
|
||||
$post_profilechange = PConfig::get(local_user(), 'system', 'post_profilechange', false);
|
||||
|
||||
// nowarn_insecure
|
||||
|
||||
|
@ -1247,10 +1238,6 @@ function settings_content(App $a)
|
|||
|
||||
|
||||
'$h_not' => L10n::t('Notification Settings'),
|
||||
'$activity_options' => L10n::t('By default post a status message when:'),
|
||||
'$post_newfriend' => ['post_newfriend', L10n::t('accepting a friend request'), $post_newfriend, ''],
|
||||
'$post_joingroup' => ['post_joingroup', L10n::t('joining a forum/community'), $post_joingroup, ''],
|
||||
'$post_profilechange' => ['post_profilechange', L10n::t('making an <em>interesting</em> profile change'), $post_profilechange, ''],
|
||||
'$lbl_not' => L10n::t('Send a notification email when:'),
|
||||
'$notify1' => ['notify1', L10n::t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
|
||||
'$notify2' => ['notify2', L10n::t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue