From eb2ef6dec43391631e2989b55bc4d762336680ca Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 22 Aug 2011 18:52:02 -0700 Subject: diaspora admin toggle, update install guide --- mod/admin.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 1a926443f..7799e64ab 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -197,6 +197,7 @@ function admin_page_site_post(&$a){ $timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60); $dfrn_only = ((x($_POST,'dfrn_only')) ? True : False); $ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False); + $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); set_config('config','sitename',$sitename); @@ -241,6 +242,7 @@ function admin_page_site_post(&$a){ set_config('system','curl_timeout', $timeout); set_config('system','dfrn_only', $dfrn_only); set_config('system','ostatus_disabled', $ostatus_disabled); + set_config('system','diaspora_enabled', $diaspora_enabled); info( t('Site settings updated.') . EOL); goaway($a->get_baseurl() . '/admin/site' ); @@ -325,6 +327,7 @@ function admin_page_site(&$a) { '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), "Use PHP UTF8 regular expressions"), '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), "Display a Community page showing all recent public postings on this site."), '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), "Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed."), + '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), "Provide built-in Diaspora network compatibility."), '$dfrn_only' => array('dfrn_only', t('Only allow Friendika contacts'), get_config('system','dfrn_only'), "All contacts must use Friendika protocols. All other built-in communication protocols disabled."), '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), "If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites."), '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), -- cgit v1.2.3 From b9e4668f68321bd767dfffb626be940e0b1be460 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 22 Aug 2011 20:35:34 -0700 Subject: d* retractions --- mod/contacts.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index efb0dc75b..4d9385026 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -163,9 +163,9 @@ function contacts_content(&$a) { if($cmd === 'block') { $blocked = (($orig_record[0]['blocked']) ? 0 : 1); $r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($blocked), - intval($contact_id), - intval(local_user()) + intval($blocked), + intval($contact_id), + intval(local_user()) ); if($r) { //notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL ); @@ -178,9 +178,9 @@ function contacts_content(&$a) { if($cmd === 'ignore') { $readonly = (($orig_record[0]['readonly']) ? 0 : 1); $r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($readonly), - intval($contact_id), - intval(local_user()) + intval($readonly), + intval($contact_id), + intval(local_user()) ); if($r) { info( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL ); @@ -193,7 +193,7 @@ function contacts_content(&$a) { // create an unfollow slap - if($orig_record[0]['network'] === 'stat') { + if($orig_record[0]['network'] === NETWORK_OSTATUS) { $tpl = get_markup_template('follow_slap.tpl'); $slap = replace_macros($tpl, array( '$name' => $a->user['username'], @@ -215,13 +215,15 @@ function contacts_content(&$a) { slapper($a->user,$orig_record[0]['notify'],$slap); } } - - if($orig_record[0]['network'] === 'dfrn') { + elseif($orig_record[0]['network'] === NETWORK_DIASPORA) { + require_once('include/diaspora.php'); + diaspora_unshare($a->user,$orig_record[0]); + } + elseif($orig_record[0]['network'] === NETWORK_DFRN) { require_once('include/items.php'); dfrn_deliver($a->user,$orig_record[0],'placeholder', 1); } - contact_remove($orig_record[0]['id']); info( t('Contact has been removed.') . EOL ); goaway($a->get_baseurl() . '/contacts'); -- cgit v1.2.3 From 56d64316f457c85141e35356a61a4d352ed9f24c Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 23 Aug 2011 18:17:35 -0700 Subject: diaspora photos ? --- mod/receive.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod') diff --git a/mod/receive.php b/mod/receive.php index c3738c143..b50774933 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -63,6 +63,9 @@ function receive_post(&$a) { elseif($xmlbase->retraction) { diaspora_retraction($importer,$xmlbase->retraction,$msg); } + elseif($xmlbase->photo) { + diaspora_photo($importer,$xmlbase->photo,$msg); + } else { logger('mod-diaspora: unknown message type: ' . print_r($xmlbase,true)); } -- cgit v1.2.3 From 2aa23843e401e7f448c3d12f844934da6c27f8ef Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 24 Aug 2011 01:21:24 -0700 Subject: D* queue --- mod/receive.php | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'mod') diff --git a/mod/receive.php b/mod/receive.php index b50774933..34128518b 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -15,8 +15,6 @@ function receive_post(&$a) { if($a->argc != 3 || $a->argv[1] !== 'users') http_status_exit(500); - logger('receive: raw input: ' . file_get_contents('php://input'), LOGGER_DATA); - $guid = $a->argv[2]; $r = q("SELECT * FROM `user` WHERE `guid` = '%s' LIMIT 1", @@ -43,32 +41,7 @@ function receive_post(&$a) { if(! is_array($msg)) http_status_exit(500); - - $parsed_xml = parse_xml_string($msg['message'],false); - - $xmlbase = $parsed_xml->post; - - if($xmlbase->request) { - diaspora_request($importer,$xmlbase->request); - } - elseif($xmlbase->status_message) { - diaspora_post($importer,$xmlbase->status_message); - } - elseif($xmlbase->comment) { - diaspora_comment($importer,$xmlbase->comment,$msg); - } - elseif($xmlbase->like) { - diaspora_like($importer,$xmlbase->like,$msg); - } - elseif($xmlbase->retraction) { - diaspora_retraction($importer,$xmlbase->retraction,$msg); - } - elseif($xmlbase->photo) { - diaspora_photo($importer,$xmlbase->photo,$msg); - } - else { - logger('mod-diaspora: unknown message type: ' . print_r($xmlbase,true)); - } + diaspora_dispatch($importer,$msg); http_status_exit(200); // NOTREACHED -- cgit v1.2.3 From 0883a614a288a85b973174a03c9498289e6383dc Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 24 Aug 2011 01:41:27 -0700 Subject: don't accept pubsub from diaspora --- mod/pubsub.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod') diff --git a/mod/pubsub.php b/mod/pubsub.php index d6e3d378f..4dff5d531 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -122,6 +122,12 @@ function pubsub_post(&$a) { $contact = $r[0]; + // we have no way to match Diaspora guid's with atom post id's and could get duplicates. + // we'll assume that direct delivery is robust (and this is a bad assumption, but the duplicates are messy). + + if($r[0]['network'] === NETWORK_DIASPORA) + hub_post_return(); + $feedhub = ''; require_once('include/items.php'); -- cgit v1.2.3 From 8f6ae2b66044a36996ac92a8db1a540db9c71fe3 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 24 Aug 2011 20:40:08 -0700 Subject: missing salmon key? report it. --- mod/openid.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/openid.php b/mod/openid.php index 6fbd013b8..3c3293147 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -55,7 +55,8 @@ function openid_content(&$a) { } - $r = q("SELECT * FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1", + $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` + FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1", dbesc($_SESSION['openid']) ); if(! count($r)) { -- cgit v1.2.3 From 74d61ed00b9ff6fe768d4a0f4a27da246020c270 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 24 Aug 2011 22:40:26 -0700 Subject: contact menu beginnings --- mod/contacts.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index 4d9385026..6863bd737 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -422,6 +422,7 @@ function contacts_content(&$a) { $o .= replace_macros($tpl, array( '$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']), '$edit_hover' => t('Edit contact'), + '$contact_photo_menu' => contact_photo_menu($rr), '$id' => $rr['id'], '$alt_text' => $alt_text, '$dir_icon' => $dir_icon, -- cgit v1.2.3 From 83605cf3dc03be7c2ddad48d04aede90d68069e3 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 25 Aug 2011 05:15:05 -0700 Subject: theme settings for contact photo menu --- mod/contacts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index 6863bd737..8f851e9e0 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -427,7 +427,7 @@ function contacts_content(&$a) { '$alt_text' => $alt_text, '$dir_icon' => $dir_icon, '$thumb' => $rr['thumb'], - '$name' => substr($rr['name'],0,20), + '$name' => $rr['name'], '$username' => $rr['name'], '$sparkle' => $sparkle, '$url' => $url -- cgit v1.2.3 From 99ea045723b89a312db5227f0036c76d481e58a1 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 25 Aug 2011 18:12:42 -0700 Subject: some minor work on contact edit page --- mod/contacts.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/contacts.php b/mod/contacts.php index 8f851e9e0..5d72cff88 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -292,6 +292,9 @@ function contacts_content(&$a) { $lblsuggest = (($r[0]['network'] === NETWORK_DFRN) ? '' : ''); + $poll_enabled = (($r[0]['network'] !== NETWORK_DIASPORA) ? true : false); + + $nettype = '
' . sprintf( t('Network type: %s'),network_to_name($r[0]['network'])) . '
'; $o .= replace_macros($tpl,array( '$header' => t('Contact Editor'), @@ -312,7 +315,9 @@ function contacts_content(&$a) { '$lblsuggest' => $lblsuggest, '$grps' => $grps, '$delete' => t('Delete contact'), - '$poll_interval' => contact_poll_interval($r[0]['priority']), + '$nettype' => $nettype, + '$poll_interval' => contact_poll_interval($r[0]['priority'],(! $poll_enabled)), + '$poll_enabled' => $poll_enabled, '$lastupdtext' => t('Last updated: '), '$updpub' => t('Update public posts: '), '$last_update' => $last_update, -- cgit v1.2.3