aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-18 04:49:15 -0700
committerfriendica <info@friendica.com>2012-07-18 04:49:15 -0700
commitd683df17bd530739bc64c79f152957ab229b6a02 (patch)
tree80d8a9e92d764aeacbb7bc09551ca1e501456ace /mod
parent22cf19e174bcee88b44968f2773d1bad2da2b54d (diff)
downloadvolse-hubzilla-d683df17bd530739bc64c79f152957ab229b6a02.tar.gz
volse-hubzilla-d683df17bd530739bc64c79f152957ab229b6a02.tar.bz2
volse-hubzilla-d683df17bd530739bc64c79f152957ab229b6a02.zip
Removing connectors we won't be needing - this is probably going to break some shit.
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_confirm.php16
-rw-r--r--mod/dfrn_request.php18
-rw-r--r--mod/item.php41
-rwxr-xr-xmod/like.php138
-rw-r--r--mod/message.php11
-rw-r--r--mod/profile_photo.php2
-rw-r--r--mod/profiles.php3
-rw-r--r--mod/receive.php68
-rw-r--r--mod/settings.php57
-rw-r--r--mod/xrd.php11
10 files changed, 4 insertions, 361 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 8e39f5fd0..716168a55 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -368,16 +368,6 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$new_relation = $contact['rel'];
$writable = $contact['writable'];
- if($network === NETWORK_DIASPORA) {
- if($duplex)
- $new_relation = CONTACT_IS_FRIEND;
- else
- $new_relation = CONTACT_IS_SHARING;
-
- if($new_relation != CONTACT_IS_FOLLOWER)
- $writable = 1;
- }
-
$r = q("DELETE FROM `intro` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($intro_id),
intval($uid)
@@ -432,12 +422,6 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
- if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
- require_once('include/diaspora.php');
- $ret = diaspora_share($user[0],$r[0]);
- logger('mod_follow: diaspora_share returns: ' . $ret);
- }
-
// Send a new friend post if we are allowed to...
$r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index eabde30b9..e6c38a772 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -802,26 +802,10 @@ function dfrn_request_content(&$a) {
else
$tpl = get_markup_template('auto_request.tpl');
- # $page_desc = sprintf( t('Diaspora members: Please do not use this form. Instead, enter "%s" into your Diaspora search bar.'),
- # $target_addr) . EOL . EOL;
-
$page_desc .= t("Please enter your 'Identity Address' from one of the following supported communications networks:");
- // see if we are allowed to have NETWORK_MAIL2 contacts
-
- $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
- if(get_config('system','dfrn_only'))
- $mail_disabled = 1;
-
- if(! $mail_disabled) {
- $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
- intval($a->profile['uid'])
- );
- if(! count($r))
- $mail_disabled = 1;
- }
- $emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
+ $emailnet = '';
$invite_desc = t('If you are not yet a member of the free social web, <a href="http://dir.friendica.com/siteinfo">follow this link to find a public Friendica site and join us today</a>.');
diff --git a/mod/item.php b/mod/item.php
index 3bfa3ebe7..1053bb8ca 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -775,10 +775,6 @@ function item_post(&$a) {
}
-
- // Store the comment signature information in case we need to relay to Diaspora
- store_diaspora_comment_sig($datarray, $author, ($self ? $a->user['prvkey'] : false), $parent_item, $post_id);
-
}
else {
$parent = $post_id;
@@ -1064,40 +1060,3 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
}
-function store_diaspora_comment_sig($datarray, $author, $uprvkey, $parent_item, $post_id) {
- // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key
-
- $enabled = intval(get_config('system','diaspora_enabled'));
- if(! $enabled) {
- logger('mod_item: diaspora support disabled, not storing comment signature', LOGGER_DEBUG);
- return;
- }
-
-
- logger('mod_item: storing diaspora comment signature');
-
- require_once('include/bb2diaspora.php');
- $signed_body = html_entity_decode(bb2diaspora($datarray['body']));
-
- // Only works for NETWORK_DFRN
- $contact_baseurl_start = strpos($author['url'],'://') + 3;
- $contact_baseurl_length = strpos($author['url'],'/profile') - $contact_baseurl_start;
- $contact_baseurl = substr($author['url'], $contact_baseurl_start, $contact_baseurl_length);
- $diaspora_handle = $author['nick'] . '@' . $contact_baseurl;
-
- $signed_text = $datarray['guid'] . ';' . $parent_item['guid'] . ';' . $signed_body . ';' . $diaspora_handle;
-
- if( $uprvkey !== false )
- $authorsig = base64_encode(rsa_sign($signed_text,$uprvkey,'sha256'));
- else
- $authorsig = '';
-
- q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
- intval($post_id),
- dbesc($signed_text),
- dbesc(base64_encode($authorsig)),
- dbesc($diaspora_handle)
- );
-
- return;
-}
diff --git a/mod/like.php b/mod/like.php
index aaa85928c..9c57d9842 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -122,19 +122,6 @@ function like_content(&$a) {
intval($like_item['id'])
);
-
- // Clean up the Diaspora signatures for this like
- // Go ahead and do it even if Diaspora support is disabled. We still want to clean up
- // if it had been enabled in the past
- $r = q("DELETE FROM `sign` WHERE `iid` = %d",
- intval($like_item['id'])
- );
-
- // Save the author information for the unlike in case we need to relay to Diaspora
- store_diaspora_like_retract_sig($activity, $item, $like_item, $contact);
-
-
-// proc_run('php',"include/notifier.php","like","$post_id"); // $post_id isn't defined here!
$like_item_id = $like_item['id'];
proc_run('php',"include/notifier.php","like","$like_item_id");
return;
@@ -211,10 +198,6 @@ EOT;
}
- // Save the author information for the like in case we need to relay to Diaspora
- store_diaspora_like_sig($activity, $post_type, $contact, $post_id);
-
-
$arr['id'] = $post_id;
call_hooks('post_local_end', $arr);
@@ -222,126 +205,7 @@ EOT;
proc_run('php',"include/notifier.php","like","$post_id");
killme();
-// return; // NOTREACHED
+ return; // NOTREACHED
}
-function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) {
- // Note that we can only create a signature for a user of the local server. We don't have
- // a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
- // means we are the relay, and for relayable_retractions, Diaspora
- // only checks the parent_author_signature if it doesn't have to relay further
- //
- // If $item['resource-id'] exists, it means the item is a photo. Diaspora doesn't support
- // likes on photos, so don't bother.
-
- $enabled = intval(get_config('system','diaspora_enabled'));
- if(! $enabled) {
- logger('mod_like: diaspora support disabled, not storing like retraction signature', LOGGER_DEBUG);
- return;
- }
-
- logger('mod_like: storing diaspora like retraction signature');
-
- if(($activity === ACTIVITY_LIKE) && (! $item['resource-id'])) {
- $signed_text = $like_item['guid'] . ';' . 'Like';
-
- // Only works for NETWORK_DFRN
- $contact_baseurl_start = strpos($contact['url'],'://') + 3;
- $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
- $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length);
- $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl;
-
- // Get contact's private key if he's a user of the local Friendica server
- $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1",
- dbesc($contact['url'])
- );
-
- if( $r) {
- $contact_uid = $r['uid'];
- $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1",
- intval($contact_uid)
- );
-
- if( $r)
- $authorsig = base64_encode(rsa_sign($signed_text,$r['prvkey'],'sha256'));
- }
-
- if(! isset($authorsig))
- $authorsig = '';
-
- q("insert into sign (`retract_iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
- intval($like_item['id']),
- dbesc($signed_text),
- dbesc($authorsig),
- dbesc($diaspora_handle)
- );
- }
-
- return;
-}
-
-function store_diaspora_like_sig($activity, $post_type, $contact, $post_id) {
- // Note that we can only create a signature for a user of the local server. We don't have
- // a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
- // means we are the relay, and for relayable_retractions, Diaspora
- // only checks the parent_author_signature if it doesn't have to relay further
-
- $enabled = intval(get_config('system','diaspora_enabled'));
- if(! $enabled) {
- logger('mod_like: diaspora support disabled, not storing like signature', LOGGER_DEBUG);
- return;
- }
-
- logger('mod_like: storing diaspora like signature');
-
- if(($activity === ACTIVITY_LIKE) && ($post_type === t('status'))) {
- // Only works for NETWORK_DFRN
- $contact_baseurl_start = strpos($contact['url'],'://') + 3;
- $contact_baseurl_length = strpos($contact['url'],'/profile') - $contact_baseurl_start;
- $contact_baseurl = substr($contact['url'], $contact_baseurl_start, $contact_baseurl_length);
- $diaspora_handle = $contact['nick'] . '@' . $contact_baseurl;
-
- // Get contact's private key if he's a user of the local Friendica server
- $r = q("SELECT `contact`.`uid` FROM `contact` WHERE `url` = '%s' AND `self` = 1 LIMIT 1",
- dbesc($contact['url'])
- );
-
- if( $r) {
- $contact_uid = $r['uid'];
- $r = q("SELECT prvkey FROM user WHERE uid = %d LIMIT 1",
- intval($contact_uid)
- );
-
- if( $r)
- $contact_uprvkey = $r['prvkey'];
- }
-
- $r = q("SELECT guid, parent FROM `item` WHERE id = %d LIMIT 1",
- intval($post_id)
- );
- if( $r) {
- $p = q("SELECT guid FROM `item` WHERE id = %d AND parent = %d LIMIT 1",
- intval($r[0]['parent']),
- intval($r[0]['parent'])
- );
- if( $p) {
- $signed_text = $r[0]['guid'] . ';Post;' . $p[0]['guid'] . ';true;' . $diaspora_handle;
-
- if(isset($contact_uprvkey))
- $authorsig = base64_encode(rsa_sign($signed_text,$contact_uprvkey,'sha256'));
- else
- $authorsig = '';
-
- q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
- intval($post_id),
- dbesc($signed_text),
- dbesc($authorsig),
- dbesc($diaspora_handle)
- );
- }
- }
- }
-
- return;
-}
diff --git a/mod/message.php b/mod/message.php
index 1e9d731a4..0be0c7055 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -213,17 +213,6 @@ function message_content(&$a) {
intval(local_user())
);
- // remove diaspora conversation pointer
- // Actually if we do this, we can never receive another reply to that conversation,
- // as we will never again have the info we need to re-create it.
- // We'll just have to orphan it.
-
- //if($convid) {
- // q("delete from conv where id = %d limit 1",
- // intval($convid)
- // );
- //}
-
if($r)
info( t('Conversation removed.') . EOL );
}
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index a60a6d73c..97e861bdd 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -121,8 +121,6 @@ function profile_photo_post(&$a) {
if($url && strlen(get_config('system','directory_submit_url')))
proc_run('php',"include/directory.php","$url");
- require_once('include/profile_update.php');
- profile_change();
}
else
notice( t('Unable to process image') . EOL);
diff --git a/mod/profiles.php b/mod/profiles.php
index 61f525e0f..8ccf4a79b 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -300,9 +300,6 @@ function profiles_post(&$a) {
$url = $_SESSION['my_url'];
if($url && strlen(get_config('system','directory_submit_url')))
proc_run('php',"include/directory.php","$url");
-
- require_once('include/profile_update.php');
- profile_change();
}
}
}
diff --git a/mod/receive.php b/mod/receive.php
deleted file mode 100644
index 2bd3cc65b..000000000
--- a/mod/receive.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/**
- * Diaspora endpoint
- */
-
-
-require_once('include/salmon.php');
-require_once('include/crypto.php');
-require_once('include/diaspora.php');
-
-
-function receive_post(&$a) {
-
-
- $enabled = intval(get_config('system','diaspora_enabled'));
- if(! $enabled) {
- logger('mod-diaspora: disabled');
- http_status_exit(500);
- }
-
- $public = false;
-
- if(($a->argc == 2) && ($a->argv[1] === 'public')) {
- $public = true;
- }
- else {
-
- if($a->argc != 3 || $a->argv[1] !== 'users')
- http_status_exit(500);
-
- $guid = $a->argv[2];
-
- $r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 LIMIT 1",
- dbesc($guid)
- );
- if(! count($r))
- http_status_exit(500);
-
- $importer = $r[0];
- }
-
- // It is an application/x-www-form-urlencoded
-
- $xml = urldecode($_POST['xml']);
-
- logger('mod-diaspora: new salmon ' . $xml, LOGGER_DATA);
-
- if(! $xml)
- http_status_exit(500);
-
- $msg = diaspora_decode($importer,$xml);
-
- logger('mod-diaspora: decoded msg: ' . print_r($msg,true), LOGGER_DATA);
-
- if(! is_array($msg))
- http_status_exit(500);
-
- $ret = 0;
- if($public)
- diaspora_dispatch_public($msg);
- else
- $ret = diaspora_dispatch($importer,$msg);
-
- http_status_exit(($ret) ? $ret : 200);
- // NOTREACHED
-}
-
diff --git a/mod/settings.php b/mod/settings.php
index 9c580f3bc..ab63fa177 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -511,10 +511,6 @@ function settings_post(&$a) {
}
-
- require_once('include/profile_update.php');
- profile_change();
-
$_SESSION['theme'] = $theme;
if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
@@ -649,65 +645,14 @@ function settings_content(&$a) {
call_hooks('connector_settings', $settings_connectors);
- $diasp_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('Diaspora'), ((get_config('system','diaspora_enabled')) ? t('enabled') : t('disabled')));
- $ostat_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('StatusNet'), ((get_config('system','ostatus_disabled')) ? t('disabled') : t('enabled')));
-
- $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
- if(get_config('system','dfrn_only'))
- $mail_disabled = 1;
-
- if(! $mail_disabled) {
- $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
- local_user()
- );
- }
- else {
- $r = null;
- }
-
- $mail_server = ((count($r)) ? $r[0]['server'] : '');
- $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
- $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : '');
- $mail_user = ((count($r)) ? $r[0]['user'] : '');
- $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
- $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
- $mail_action = ((count($r)) ? $r[0]['action'] : 0);
- $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : '');
- $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
-
+ $r = null;
$tpl = get_markup_template("settings_connectors.tpl");
- if(! service_class_allows(local_user(),'email_connect')) {
- $mail_disabled_message = upgrade_bool_message();
- }
- else {
- $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
- }
-
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_connectors"),
-
'$title' => t('Connector Settings'),
-
- '$diasp_enabled' => $diasp_enabled,
- '$ostat_enabled' => $ostat_enabled,
-
- '$h_imap' => t('Email/Mailbox Setup'),
- '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
- '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''),
- '$mail_disabled' => $mail_disabled_message,
- '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
- '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
- '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
- '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''),
- '$mail_pass' => array('mail_pass', t('Email password:'), '', ''),
- '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
- '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
- '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))),
- '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''),
'$submit' => t('Submit'),
-
'$settings_connectors' => $settings_connectors
));
diff --git a/mod/xrd.php b/mod/xrd.php
index 623c34b4e..49db2fac8 100644
--- a/mod/xrd.php
+++ b/mod/xrd.php
@@ -27,16 +27,7 @@ function xrd_init(&$a) {
header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml");
- if(get_config('system','diaspora_enabled')) {
- $tpl = file_get_contents('view/xrd_diaspora.tpl');
- $dspr = replace_macros($tpl,array(
- '$baseurl' => $a->get_baseurl(),
- '$dspr_guid' => $r[0]['guid'],
- '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey']))
- ));
- }
- else
- $dspr = '';
+ $dspr = '';
$tpl = file_get_contents('view/xrd_person.tpl');