}
else {
- // TODO: We really should send a notification to the owner after 2-3 weeks
- // so they won't be surprised when the contact vanishes and can take
- // remedial action if this was a serious mistake or glitch
+ /// @todo
+ /// We really should send a notification to the owner after 2-3 weeks
+ /// so they won't be surprised when the contact vanishes and can take
+ /// remedial action if this was a serious mistake or glitch
$expiry = $contact['term-date'] . ' + 32 days ';
if(datetime_convert() > datetime_convert('UTC','UTC',$expiry)) {
$page_owner_nick = $r[0]['nickname'];
-// To-Do:
-// $default_cid = $r[0]['id'];
-// $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
+ /// @TODO
+ /// $default_cid = $r[0]['id'];
+ /// $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
if ((strlen($imagedata) == 0) AND ($url == "")) {
logger("No image data and no url provided", LOGGER_DEBUG);
<?php
-/* To-Do:
- - Automatically detect if incoming data is HTML or BBCode
-*/
+/**
+ * @file include/api.php
+ *
+ * @todo Automatically detect if incoming data is HTML or BBCode
+ */
/* Contact details:
Gerhard Seeber Mail: gerhard@seeber.at Friendica: http://mozartweg.dyndns.org/friendica/gerhard
}
function api_error(&$a, $type, $error) {
- # TODO: https://dev.twitter.com/overview/api/response-codes
+ /// @TODO https://dev.twitter.com/overview/api/response-codes
$r = "<status><error>".$error."</error><request>".$a->query_string."</request></status>";
switch($type){
case "xml":
$_REQUEST['body'] .= "\n\n".$media;
}
- // To-Do: Multiple IDs
+ /// @TODO Multiple IDs
if (requestdata('media_ids')) {
$r = q("SELECT `resource-id`, `scale`, `nickname`, `type` FROM `photo` INNER JOIN `user` ON `user`.`uid` = `photo`.`uid` WHERE `resource-id` IN (SELECT `resource-id` FROM `photo` WHERE `id` = %d) AND `scale` > 0 AND `photo`.`uid` = %d ORDER BY `photo`.`width` DESC LIMIT 1",
intval(requestdata('media_ids')), api_user());
*
* http://developer.twitter.com/doc/get/statuses/home_timeline
*
- * TODO: Optional parameters
- * TODO: Add reply info
+ * @TODO Optional parameters
+ * @TODO Add reply info
*/
function api_statuses_home_timeline(&$a, $type){
if (api_user()===false) return false;
function api_favorites_create_destroy(&$a, $type){
if (api_user()===false) return false;
- # for versioned api.
- # TODO: we need a better global soluton
+ // for versioned api.
+ /// @TODO We need a better global soluton
$action_argv_id=2;
if ($a->argv[1]=="1.1") $action_argv_id=3;
}
function api_get_entitities(&$text, $bbcode) {
- /*
- To-Do:
- * Links at the first character of the post
- */
+ /// @todo
+ /// Links at the first character of the post
$a = get_app();
}
function api_get_nick($profile) {
-/* To-Do:
- - remove trailing junk from profile url
- - pump.io check has to check the website
-*/
+/// @TODO Remove trailing junk from profile url
+/// @TODO pump.io check has to check the website
$nick = "";
}
}
- // To-Do: look at the page if its really a pumpio site
+ /// @TODO Look at the page if its really a pumpio site
//if (!$nick == "") {
// $pumpio = preg_replace("=https?://(.*)/(.*)/=ism", "$2", $profile."/");
// if ($pumpio != $profile)
// update nodeinfo data
nodeinfo_cron();
- // To-Do: Regenerate usage statistics
+ /// @TODO Regenerate usage statistics
// q("ANALYZE TABLE `item`");
// once daily run birthday_updates and then expire in background
// Months count from 1.
-// TODO: provide (prev,next) links, define class variations for different size calendars
+/// @TODO Provide (prev,next) links, define class variations for different size calendars
if(! function_exists('cal')) {
require_once('include/datetime.php');
/**
- *
- * MySQL database class
+ * @class MySQL database class
*
* For debugging, insert 'dbg(1);' anywhere in the program flow.
* dbg(0); will turn it off. Logging is performed at LOGGER_DATA level.
<?php
-/*
-To-Do:
-- GET /people/9aed8882b9f64896/stream
-*/
+/**
+ * @file include/diaspora.php
+ *
+ * @todo GET /people/9aed8882b9f64896/stream
+ */
require_once('include/crypto.php');
require_once('include/items.php');
DiasporaFetchGuid($datarray);
$message_id = item_store($datarray);
- // To-Do:
- // Looking if there is some subscribe mechanism in Diaspora to get all comments for this post
+ /// @TODO
+ /// Looking if there is some subscribe mechanism in Diaspora to get all comments for this post
return $message_id;
}
$body = scale_external_images($body);
// Add OEmbed and other information to the body
- // To-Do: It could be a repeated redmatrix item
- // Then we shouldn't add further data to it
+ /// @TODO It could be a repeated redmatrix item
+ /// Then we shouldn't add further data to it
if ($item["object-type"] == ACTIVITY_OBJ_NOTE)
$body = add_page_info_to_body($body, false, true);
if(substr($birthday,5) === substr($contact['bd'],5))
$birthday = $contact['bd'];
- // TODO: update name on item['author-name'] if the name changed. See consume_feed()
- // Not doing this currently because D* protocol is scheduled for revision soon.
+ /// @TODO Update name on item['author-name'] if the name changed. See consume_feed()
+ /// (Not doing this currently because D* protocol is scheduled for revision soon).
$r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s', `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($name),
/**
* email_send is used by NETWORK_EMAIL and NETWORK_EMAIL2 code
- * (not to notify the user, but to send items to email contacts
+ * (not to notify the user, but to send items to email contacts)
*
- * TODO: this could be changed to use the Emailer class
+ * @todo This could be changed to use the Emailer class
*/
function email_send($addr, $subject, $headers, $item) {
//$headers .= 'MIME-Version: 1.0' . "\n";
continue;
}
- // To-Do?
+ /// @TODO ?
// <category>Ausland</category>
// <media:thumbnail width="152" height="76" url="http://www.taz.de/picture/667875/192/14388767.jpg"/>
dbesc($item["uri"]), dbesc($item["network"]));
}
-// Adds a "lang" specification in a "postopts" element of given $arr,
-// if possible and not already present.
-// Expects "body" element to exist in $arr.
-// TODO: add a parameter to request forcing override
+/**
+ * Adds a "lang" specification in a "postopts" element of given $arr,
+ * if possible and not already present.
+ * Expects "body" element to exist in $arr.
+ *
+ * @todo Add a parameter to request forcing override
+ */
function item_add_language_opt(&$arr) {
if (version_compare(PHP_VERSION, '5.3.0', '<')) return; // LanguageDetect.php not available ?
if ( strstr($arr['postopts'], 'lang=') )
{
// do not override
- // TODO: add parameter to request overriding
+ /// @TODO Add parameter to request overriding
return;
}
$postopts = $arr['postopts'];
return 1;
}
- // TODO
- // merge with current record, current contents have priority
- // update record, set url-updated
- // update profile photos
- // schedule a scan?
+ /// @TODO
+ /// merge with current record, current contents have priority
+ /// update record, set url-updated
+ /// update profile photos
+ /// schedule a scan?
return 0;
}
$o .= '<category scheme="X-DFRN:' . xmlify($t[0]) . ':' . xmlify($t[1]) . '" term="' . xmlify($t[2]) . '" />' . "\r\n";
}
- // To-Do:
- // To support these elements, the API needs to be enhanced
- //$o .= '<link rel="ostatus:conversation" href="'.xmlify($a->get_baseurl().'/display/'.$owner['nickname'].'/'.$item['parent']).'"/>'."\r\n";
- //$o .= "\t".'<link rel="self" type="application/atom+xml" href="'.xmlify($a->get_baseurl().'/api/statuses/show/'.$item['id'].'.atom').'"/>'."\r\n";
- //$o .= "\t".'<link rel="edit" type="application/atom+xml" href="'.xmlify($a->get_baseurl().'/api/statuses/show/'.$item['id'].'.atom').'"/>'."\r\n";
+ /// @TODO
+ /// To support these elements, the API needs to be enhanced
+ /// $o .= '<link rel="ostatus:conversation" href="'.xmlify($a->get_baseurl().'/display/'.$owner['nickname'].'/'.$item['parent']).'"/>'."\r\n";
+ /// $o .= "\t".'<link rel="self" type="application/atom+xml" href="'.xmlify($a->get_baseurl().'/api/statuses/show/'.$item['id'].'.atom').'"/>'."\r\n";
+ /// $o .= "\t".'<link rel="edit" type="application/atom+xml" href="'.xmlify($a->get_baseurl().'/api/statuses/show/'.$item['id'].'.atom').'"/>'."\r\n";
// Deactivated since it was meant only for OStatus
//$o .= item_get_attachment($item);
if (($sigpos < $quotepos) and ($sigpos != 0))
return(array('body' => $message, 'sig' => ''));
- // To-Do: Regexp umstellen, so dass auf 1 oder kein Leerzeichen
- // geprueft wird
- //$message = str_replace("\n--\n", "\n-- \n", $message);
+ /// @TODO Regexp umstellen, so dass auf 1 oder kein Leerzeichen
+ /// geprueft wird
+ /// $message = str_replace("\n--\n", "\n-- \n", $message);
$pattern = '/(.*)[\r\n]-- [\r\n](.*)/is';
$lines = explode("\n",$headers);
if(count($lines)) {
foreach($lines as $line) {
- // TODO alter the following regex to support multiple relations (space separated)
+ /// @TODO Alter the following regex to support multiple relations (space separated)
if((stristr($line,'link:')) && preg_match('/<([^>].*)>.*rel\=[\'\"]lrdd[\'\"]/',$line,$matches)) {
$pagelink = $matches[1];
break;
if($url) {
logger('notifier: urldelivery: ' . $url);
$deliver_status = slapper($owner,$url,$slap);
- // TODO: redeliver/queue these items on failure, though there is no contact record
+ /// @TODO Redeliver/queue these items on failure, though there is no contact record
}
}
}
poco_load($contact['id'],$importer_uid,0,$contact['poco']);
}
- // To-Do:
- // - Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?)
- // - Check whether this is possible with Redmatrix
+ /// @TODO Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?)
+ /// @TODO Check whether this is possible with Redmatrix
if ($contact["network"] == NETWORK_DIASPORA) {
if (poco_do_update($contact["created"], $contact["last-item"], $contact["failure_update"], $contact["success_update"])) {
$last_updated = poco_last_updated($contact["url"]);
logger("Mail: Importing ".$msg_uid." for ".$mailconf[0]['user']);
// some mailing lists have the original author as 'from' - add this sender info to msg body.
- // todo: adding a gravatar for the original author would be cool
+ /// @TODO Adding a gravatar for the original author would be cool
if(! stristr($meta->from,$contact['addr'])) {
$from = imap_mime_header_decode($meta->from);
$item["object"] = $xml;
$item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue;
- // To-Do:
- // Delete a message
+ /// @TODO
+ /// Delete a message
if ($item["verb"] == "qvitter-delete-notice") {
// ignore "Delete" messages (by now)
logger("Ignore delete message ".print_r($item, true));
if ($georsspoint)
$item["coord"] = $georsspoint->item(0)->nodeValue;
- // To-Do
- // $item["location"] =
+ /// @TODO
+ /// $item["location"] =
$categories = $xpath->query('atom:category', $entry);
if ($categories) {
$existing_message = $message_exists[0];
// We improved the way we fetch OStatus messages, this shouldn't happen very often now
- // To-Do: we have to change the shadow copies as well. This way here is really ugly.
+ /// @TODO We have to change the shadow copies as well. This way here is really ugly.
if ($existing_message["parent"] != $parent["id"]) {
logger('updating id '.$existing_message["id"].' with parent '.$existing_message["parent"].' to parent '.$parent["id"].' uri '.$parent["uri"].' thread '.$parent_uri, LOGGER_DEBUG);
logger("No contact found for url ".$actor, LOGGER_DEBUG);
// Adding a global contact
- // To-Do: Use this data for the post
+ /// @TODO Use this data for the post
$global_contact_id = get_contact($actor, 0);
logger("Global contact ".$global_contact_id." found for url ".$actor, LOGGER_DEBUG);
$attributes = array("href" => $owner["url"], "rel" => "alternate", "type" => "text/html");
xml_add_element($doc, $root, "link", "", $attributes);
- // To-Do: We have to find out what this is
- //$attributes = array("href" => $a->get_baseurl()."/sup",
- // "rel" => "http://api.friendfeed.com/2008/03#sup",
- // "type" => "application/json");
- //xml_add_element($doc, $root, "link", "", $attributes);
+ /// @TODO We have to find out what this is
+ /// $attributes = array("href" => $a->get_baseurl()."/sup",
+ /// "rel" => "http://api.friendfeed.com/2008/03#sup",
+ /// "type" => "application/json");
+ /// xml_add_element($doc, $root, "link", "", $attributes);
ostatus_hublinks($doc, $root);
return $author;
}
-/*
-To-Do: Picture attachments should look like this:
-
-<a href="https://status.pirati.ca/attachment/572819" title="https://status.pirati.ca/file/heluecht-20151202T222602-rd3u49p.gif"
-class="attachment thumbnail" id="attachment-572819" rel="nofollow external">https://status.pirati.ca/attachment/572819</a>
-
+/**
+ * @TODO Picture attachments should look like this:
+ * <a href="https://status.pirati.ca/attachment/572819" title="https://status.pirati.ca/file/heluecht-20151202T222602-rd3u49p.gif"
+ * class="attachment thumbnail" id="attachment-572819" rel="nofollow external">https://status.pirati.ca/attachment/572819</a>
+ *
*/
function ostatus_entry($doc, $item, $owner, $toplevel = false) {
ostatus_get_attachment($doc, $entry, $item);
- // To-Do:
- // The API call has yet to be implemented
+ /// @TODO
+ /// The API call has yet to be implemented
//$attributes = array("href" => $a->get_baseurl()."/api/statuses/show/".$item["id"].".atom",
// "rel" => "self", "type" => "application/atom+xml");
//xml_add_element($doc, $entry, "link", "", $attributes);
}
function shortenmsg($msg, $limit, $twitter = false) {
- // To-Do:
- // For Twitter URLs aren't shortened, but they have to be calculated as if.
+ /// @TODO
+ /// For Twitter URLs aren't shortened, but they have to be calculated as if.
$lines = explode("\n", $msg);
$msg = "";
q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d",
intval($pid["pid"]));
else {
- // To-Do: Kill long running processes
- // But: Update processes (like the database update) mustn't be killed
+ /// @TODO Kill long running processes
+ /// But: Update processes (like the database update) mustn't be killed
}
} else
<?php
+/**
+ * @file include/socgraph.php
+ *
+ * @todo Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
+ * @todo Fetch profile data from profile page for Redmatrix users
+ * @todo Detect if it is a forum
+ */
require_once('include/datetime.php');
require_once("include/Scrape.php");
require_once("include/html2bbcode.php");
-/*
- To-Do:
- - Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
- - Fetch profile data from profile page for Redmatrix users
- - Detect if it is a forum
-*/
/*
* poco_load
$keywords = implode(", ", $tag);
// If you query a Friendica server for its profiles, the network has to be Friendica
- // To-Do: It could also be a Redmatrix server
+ /// TODO It could also be a Redmatrix server
//if ($uid == 0)
// $network = NETWORK_DFRN;
$done = array();
- // To-Do: Check if it is really neccessary to poll the own server
+ /// TODO Check if it is really neccessary to poll the own server
poco_load(0,0,0,$a->get_baseurl() . '/poco');
$done[] = $a->get_baseurl() . '/poco';
// send relocate message (below)\r
break;\r
case NETWORK_ZOT:\r
- // TODO handle zot network\r
+ /// @TODO handle zot network\r
break;\r
case NETWORK_MAIL2:\r
- // TODO ?\r
+ /// @TODO ?\r
break;\r
case NETWORK_FEED:\r
case NETWORK_MAIL:\r
if(! local_user()) {
- //TODO: we need login form to redirect to this page
+ /// @TODO We need login form to redirect to this page
notice( t('Please login to continue.') . EOL );
return login(false,$request->get_parameters());
}
// show if account is a community account
- // ToDo the other should be also respected, but first we need a good translatiion
- // and systemwide consistency for displaying the page type
+ /// @TODO The other page types should be also respected, but first we need a good
+ /// translatiion and systemwide consistency for displaying the page type
if((intval($rr['page-flags']) == PAGE_COMMUNITY) OR (intval($rr['page-flags']) == PAGE_PRVGROUP))
$community = true;
// have been provided, and run any anti-spam plugins
- // TODO
-
-
-
if((! can_write_wall($a,$profile_uid)) && (! $allow_moderated)) {
notice( t('Permission denied.') . EOL) ;
return login(false);
}
- // TODO:is this really necessary? $a is already available to hooks
+ /// @TODO Is this really necessary? $a is already available to hooks
$arr = array('query' => $a->query_string);
call_hooks('network_content_init', $arr);
$o = '';
// item filter tabs
- // TODO: fix this logic, reduce duplication
- //$a->page['content'] .= '<div class="tabs-wrapper">';
+ /// @TODO fix this logic, reduce duplication
+ /// $a->page['content'] .= '<div class="tabs-wrapper">';
list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a);
// if no tabs are selected, defaults to comments
<?php
-/* To-Do
-https://developers.google.com/+/plugins/snippet/
-
-<meta itemprop="name" content="Toller Titel">
-<meta itemprop="description" content="Eine tolle Beschreibung">
-<meta itemprop="image" content="http://maple.libertreeproject.org/images/tree-icon.png">
-
-<body itemscope itemtype="http://schema.org/Product">
- <h1 itemprop="name">Shiny Trinket</h1>
- <img itemprop="image" src="{image-url}" />
- <p itemprop="description">Shiny trinkets are shiny.</p>
-</body>
+/**
+ * @file mod/parse_url.php
+ *
+ * @todo https://developers.google.com/+/plugins/snippet/
+ *
+ * @verbatim
+ * <meta itemprop="name" content="Toller Titel">
+ * <meta itemprop="description" content="Eine tolle Beschreibung">
+ * <meta itemprop="image" content="http://maple.libertreeproject.org/images/tree-icon.png">
+ *
+ * <body itemscope itemtype="http://schema.org/Product">
+ * <h1 itemprop="name">Shiny Trinket</h1>
+ * <img itemprop="image" src="{image-url}" />
+ * <p itemprop="description">Shiny trinkets are shiny.</p>
+ * </body>
+ * @endverbatim
*/
if(!function_exists('deletenode')) {
}\r
\r
if (x($_FILES,'accountfile')){\r
- // TODO: pass $blocked / $verified, send email to admin on REGISTER_APPROVE\r
+ /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE\r
import_account($a, $_FILES['accountfile']);\r
return;\r
}\r
* @package test.util
*/
class AutonameTest extends PHPUnit_Framework_TestCase {
- /**\r
- *autonames should be random, even length\r
- */\r
- public function testAutonameEven() {\r
- $autoname1=autoname(10);\r
- $autoname2=autoname(10);\r
- \r
- $this->assertNotEquals($autoname1, $autoname2);\r
- }\r
- \r
- /**\r
- *autonames should be random, odd length\r
- */\r
- public function testAutonameOdd() {\r
- $autoname1=autoname(9);\r
- $autoname2=autoname(9);\r
- \r
- $this->assertNotEquals($autoname1, $autoname2);\r
- }\r
- \r
- /**\r
- * try to fail autonames\r
- */\r
- public function testAutonameNoLength() {\r
- $autoname1=autoname(0);\r
- $this->assertEquals(0, strlen($autoname1));\r
- }\r
+ /**
+ *autonames should be random, even length
+ */
+ public function testAutonameEven() {
+ $autoname1=autoname(10);
+ $autoname2=autoname(10);
+
+ $this->assertNotEquals($autoname1, $autoname2);
+ }
+
+ /**
+ *autonames should be random, odd length
+ */
+ public function testAutonameOdd() {
+ $autoname1=autoname(9);
+ $autoname2=autoname(9);
+
+ $this->assertNotEquals($autoname1, $autoname2);
+ }
+
+ /**
+ * try to fail autonames
+ */
+ public function testAutonameNoLength() {
+ $autoname1=autoname(0);
+ $this->assertEquals(0, strlen($autoname1));
+ }
/**
* try to fail it with invalid input
*
* TODO: What's corect behaviour here? An exception?
- */\r
- public function testAutonameNegativeLength() {\r
- $autoname1=autoname(-23);\r
- $this->assertEquals(0, strlen($autoname1));\r
- }\r
- \r
- // public function testAutonameMaxLength() {\r
- // $autoname2=autoname(PHP_INT_MAX);\r
- // $this->assertEquals(PHP_INT_MAX, count($autoname2));\r
- // }\r
+ */
+ public function testAutonameNegativeLength() {
+ $autoname1=autoname(-23);
+ $this->assertEquals(0, strlen($autoname1));
+ }
+
+ // public function testAutonameMaxLength() {
+ // $autoname2=autoname(PHP_INT_MAX);
+ // $this->assertEquals(PHP_INT_MAX, count($autoname2));
+ // }
/**
* test with a length, that may be too short
- */\r
- public function testAutonameLength1() {\r
- $autoname1=autoname(1);\r
+ */
+ public function testAutonameLength1() {
+ $autoname1=autoname(1);
$this->assertEquals(1, count($autoname1));
- $autoname2=autoname(1);\r
+ $autoname2=autoname(1);
$this->assertEquals(1, count($autoname2));
// The following test is problematic, with only 26 possibilities
// generating the same thing twice happens often aka
// birthday paradox
-// $this->assertFalse($autoname1==$autoname2); \r
+// $this->assertFalse($autoname1==$autoname2);
}
}
\ No newline at end of file