diff options
-rw-r--r-- | boot.php | 8 | ||||
-rw-r--r-- | database.sql | 17 | ||||
-rw-r--r-- | images/smiley-Oo.gif | bin | 0 -> 1045 bytes | |||
-rw-r--r-- | include/diaspora.php | 55 | ||||
-rw-r--r-- | include/items.php | 23 | ||||
-rw-r--r-- | include/text.php | 4 | ||||
-rw-r--r-- | mod/dfrn_request.php | 4 | ||||
-rw-r--r-- | mod/item.php | 8 | ||||
-rw-r--r-- | update.php | 20 | ||||
-rw-r--r-- | view/en/cmnt_received_eml.tpl | 18 | ||||
-rw-r--r-- | view/en/cmnt_received_html_body_eml.tpl | 25 | ||||
-rw-r--r-- | view/en/cmnt_received_text_body_eml.tpl | 14 | ||||
-rw-r--r-- | view/en/mail_received_html_body_eml.tpl | 26 | ||||
-rw-r--r-- | view/en/mail_received_text_body_eml.tpl | 10 | ||||
-rw-r--r-- | view/en/wall_received_eml.tpl | 18 | ||||
-rw-r--r-- | view/en/wall_received_html_body_eml.tpl | 24 | ||||
-rw-r--r-- | view/en/wall_received_text_body_eml.tpl | 18 | ||||
-rw-r--r-- | view/jot-header.tpl | 1 | ||||
-rw-r--r-- | view/jot.tpl | 4 |
19 files changed, 127 insertions, 170 deletions
@@ -4,14 +4,14 @@ require_once('include/config.php'); require_once('include/network.php'); require_once('include/plugin.php'); require_once('include/text.php'); -require_once("include/pgettext.php"); +require_once('include/pgettext.php'); require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1215' ); +define ( 'FRIENDICA_VERSION', '2.3.1216' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1114 ); +define ( 'DB_UPDATE_VERSION', 1115 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -103,7 +103,7 @@ define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API define ( 'NETWORK_LINKEDIN', 'lnkd'); // LinkedIn define ( 'NETWORK_XMPP', 'xmpp'); // XMPP - +define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace /** * Maximum number of "people who like (or don't like) this" that we will list by name diff --git a/database.sql b/database.sql index 4dc1973ed..6826aa6f8 100644 --- a/database.sql +++ b/database.sql @@ -751,3 +751,20 @@ INDEX ( `uid` ), INDEX ( `seen` ), INDEX ( `date` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `item_id` ( +`iid` INT NOT NULL , +`uid` INT NOT NULL , +`face` CHAR( 255 ) NOT NULL , +`dspr` CHAR( 255 ) NOT NULL , +`twit` CHAR( 255 ) NOT NULL , +`stat` CHAR( 255 ) NOT NULL , +PRIMARY KEY ( `iid` ), +INDEX ( `uid` ), +INDEX ( `face` ), +INDEX ( `dspr` ), +INDEX ( `twit` ), +INDEX ( `stat` ) +) ENGINE = MyISAM DEFAULT CHARSET=utf8; + + diff --git a/images/smiley-Oo.gif b/images/smiley-Oo.gif Binary files differnew file mode 100644 index 000000000..a125d0ff2 --- /dev/null +++ b/images/smiley-Oo.gif diff --git a/include/diaspora.php b/include/diaspora.php index 2d139c77c..f32113668 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -464,7 +464,7 @@ function diaspora_request($importer,$xml) { intval($importer['uid']) ); - if((count($r)) && ($r[0]['hide-friends'] == 0)) { + if((count($r)) && (! $r[0]['hide-friends']) && (! $contact['hidden'])) { require_once('include/items.php'); $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1", @@ -527,6 +527,8 @@ function diaspora_request($importer,$xml) { $batch = (($ret['batch']) ? $ret['batch'] : implode('/', array_slice(explode('/',$ret['url']),0,3)) . '/receive/public'); + + $r = q("INSERT INTO `contact` (`uid`, `network`,`addr`,`created`,`url`,`nurl`,`batch`,`name`,`nick`,`photo`,`pubkey`,`notify`,`poll`,`blocked`,`priority`) VALUES ( %d, '%s', '%s', '%s', '%s','%s','%s','%s','%s','%s','%s','%s','%s',%d,%d) ", intval($importer['uid']), @@ -550,9 +552,15 @@ function diaspora_request($importer,$xml) { $contact_record = diaspora_get_contact_by_handle($importer['uid'],$sender_handle); - $hash = random_string() . (string) time(); // Generate a confirm_key + if(! $contact_record) { + logger('diaspora_request: unable to locate newly created contact record.'); + return; + } + + if($importer['page-flags'] == PAGE_NORMAL) { + + $hash = random_string() . (string) time(); // Generate a confirm_key - if($contact_record) { $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime` ) VALUES ( %d, %d, %d, %d, '%s', '%s', '%s' )", intval($importer['uid']), @@ -564,6 +572,45 @@ function diaspora_request($importer,$xml) { dbesc(datetime_convert()) ); } + else { + + // automatic friend approval + + require_once('include/Photo.php'); + + $photos = import_profile_photo($contact_record['photo'],$importer['uid'],$contact_record['id']); + + // technically they are sharing with us (CONTACT_IS_SHARING), + // but if our page-type is PAGE_COMMUNITY or PAGE_SOAPBOX + // we are going to change the relationship and make them a follower. + + if($importer['page-flags'] == PAGE_FREELOVE) + $new_relation = CONTACT_IS_FRIEND; + else + $new_relation = CONTACT_IS_FOLLOWER; + + $r = q("UPDATE `contact` SET + `photo` = '%s', + `thumb` = '%s', + `micro` = '%s', + `rel` = %d, + `name-date` = '%s', + `uri-date` = '%s', + `avatar-date` = '%s', + `blocked` = 0, + `pending` = 0, + WHERE `id` = %d LIMIT 1 + ", + dbesc($photos[0]), + dbesc($photos[1]), + dbesc($photos[2]), + intval($new_relation), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + intval($contact_record['id']) + ); + } return; } @@ -1235,6 +1282,8 @@ function diaspora_conversation($importer,$xml,$msg) { 'source_name' => $person['name'], 'source_link' => $person['url'], 'source_photo' => $person['thumb'], + 'verb' => ACTIVITY_POST, + 'otype' => 'mail' )); } diff --git a/include/items.php b/include/items.php index 9f006306f..0bd77582a 100644 --- a/include/items.php +++ b/include/items.php @@ -945,10 +945,15 @@ function tgroup_deliver($uid,$item_id) { $link = normalise_link($a->get_baseurl() . '/profile/' . $u[0]['nickname']); + // Diaspora uses their own hardwired link URL in @-tags + // instead of the one we supply with webfinger + + $dlink = normalise_link($a->get_baseurl() . '/u/' . $u[0]['nickname']); + $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$item['body'],$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { - if(link_compare($link,$mtch[1])) { + if(link_compare($link,$mtch[1]) || link_compare($dlink,$mtch[1])) { $deliver_to_tgroup = true; logger('tgroup_deliver: local group mention found: ' . $mtch[2]); } @@ -1798,7 +1803,9 @@ function local_delivery($importer,$data) { 'link' => $a->get_baseurl() . '/notifications/intros', 'source_name' => $importer['name'], 'source_link' => $importer['url'], - 'source_photo' => $importer['photo'] + 'source_photo' => $importer['photo'], + 'verb' => ACTIVITY_REQ_FRIEND, + 'otype' => 'intro' )); return 0; @@ -1847,6 +1854,8 @@ function local_delivery($importer,$data) { 'source_name' => $msg['from-name'], 'source_link' => $importer['url'], 'source_photo' => $importer['thumb'], + 'verb' => ACTIVITY_POST, + 'otype' => 'mail' ); notification($notif_params); @@ -2118,7 +2127,10 @@ function local_delivery($importer,$data) { 'source_name' => stripslashes($datarray['author-name']), 'source_link' => $datarray['author-link'], 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) - ? $importer['thumb'] : $datarray['author-avatar']) + ? $importer['thumb'] : $datarray['author-avatar']), + 'verb' => ACTIVITY_POST, + 'otype' => 'item' + )); } @@ -2234,7 +2246,10 @@ function local_delivery($importer,$data) { 'source_name' => stripslashes($datarray['author-name']), 'source_link' => $datarray['author-link'], 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) - ? $importer['thumb'] : $datarray['author-avatar']) + ? $importer['thumb'] : $datarray['author-avatar']), + 'verb' => ACTIVITY_POST, + 'otype' => 'item' + )); break; diff --git a/include/text.php b/include/text.php index f32aaad07..1db88ca2c 100644 --- a/include/text.php +++ b/include/text.php @@ -678,7 +678,7 @@ function smilies($s) { $a = get_app(); $s = str_replace( - array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '\\o/', + array( '<3', '</3', '<\\3', ':-)', ':)', ';-)', ':-(', ':(', ':-P', ':P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O', '\\o/', 'o.O', 'O.o', '~friendika', '~friendica', 'Diaspora*' ), array( '<img src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />', @@ -698,6 +698,8 @@ function smilies($s) { '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" />', '<img src="' . $a->get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" />', '<img src="' . $a->get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" />', + '<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" />', + '<img src="' . $a->get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" />', '<a href="http://project.friendika.com">~friendika <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>', '<a href="http://friendica.com">~friendica <img src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendica" /></a>', '<a href="http://diasporafoundation.org">Diaspora<img src="' . $a->get_baseurl() . '/images/diaspora.png" alt="Diaspora*" /></a>', diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index a96860403..aa14bc473 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -580,7 +580,9 @@ function dfrn_request_content(&$a) { 'link' => $a->get_baseurl() . '/notifications/intros', 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), 'source_link' => $r[0]['url'], - 'source_photo' => $r[0]['photo'] + 'source_photo' => $r[0]['photo'], + 'verb' => ACTIVITY_REQ_FRIEND, + 'otype' => 'intro' )); } diff --git a/mod/item.php b/mod/item.php index ece92f0f3..c4e66ebeb 100644 --- a/mod/item.php +++ b/mod/item.php @@ -691,7 +691,9 @@ function item_post(&$a) { 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], - 'source_photo' => $datarray['author-avatar'] + 'source_photo' => $datarray['author-avatar'], + 'verb' => ACTIVITY_POST, + 'otype' => 'item' )); } @@ -731,7 +733,9 @@ function item_post(&$a) { 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], - 'source_photo' => $datarray['author-avatar'] + 'source_photo' => $datarray['author-avatar'], + 'verb' => ACTIVITY_POST, + 'otype' => 'item' )); } } diff --git a/update.php b/update.php index 6eade22f7..4dff59c98 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1114 ); +define( 'UPDATE_VERSION' , 1115 ); /** * @@ -972,3 +972,21 @@ function update_1113() { q("ALTER TABLE `notify` ADD `verb` CHAR( 255 ) NOT NULL , ADD `otype` CHAR( 16 ) NOT NULL"); } + +function update_1114() { + q("CREATE TABLE IF NOT EXISTS `item_id` ( +`iid` INT NOT NULL , +`uid` INT NOT NULL , +`face` CHAR( 255 ) NOT NULL , +`dspr` CHAR( 255 ) NOT NULL , +`twit` CHAR( 255 ) NOT NULL , +`stat` CHAR( 255 ) NOT NULL , +PRIMARY KEY ( `iid` ), +INDEX ( `uid` ), +INDEX ( `face` ), +INDEX ( `dspr` ), +INDEX ( `twit` ), +INDEX ( `stat` ) +) ENGINE = MYISAM "); + +} diff --git a/view/en/cmnt_received_eml.tpl b/view/en/cmnt_received_eml.tpl deleted file mode 100644 index d60fcd375..000000000 --- a/view/en/cmnt_received_eml.tpl +++ /dev/null @@ -1,18 +0,0 @@ - -Dear $username, - - '$from' commented on an item/conversation which you have been following. - ------ -$body ------ - -Please login at $siteurl to view the complete conversation: - -$display - -Thank you, - $sitename administrator - - - diff --git a/view/en/cmnt_received_html_body_eml.tpl b/view/en/cmnt_received_html_body_eml.tpl deleted file mode 100644 index 95f56a4d5..000000000 --- a/view/en/cmnt_received_html_body_eml.tpl +++ /dev/null @@ -1,25 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> -<html> -<head> - <title>Friendica Message</title> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -</head> -<body> -<table style="border:1px solid #ccc"> - <tbody> - <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> - - <tr><td style="padding-top:22px;" colspan="2">$from commented on an item/conversation which you have been following.</td></tr> - - - <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> - <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> - <tr><td style="padding-bottom:5px;"></td></tr> - <tr><td style="padding-right:22px;">$body</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Please login to <a href="$display">view the complete conversation</a>.</td></tr> - <tr><td></td><td>Thank You,</td></tr> - <tr><td></td><td>$sitename Administrator</td></tr> - </tbody> -</table> -</body> -</html> diff --git a/view/en/cmnt_received_text_body_eml.tpl b/view/en/cmnt_received_text_body_eml.tpl deleted file mode 100644 index 7dcedeb0c..000000000 --- a/view/en/cmnt_received_text_body_eml.tpl +++ /dev/null @@ -1,14 +0,0 @@ -Dear $username, - - '$from' commented on an item/conversation which you have been following. - ------ -$body ------ - -Please login at $siteurl to view the complete conversation: - -$display - -Thank you, - $sitename administrator
\ No newline at end of file diff --git a/view/en/mail_received_html_body_eml.tpl b/view/en/mail_received_html_body_eml.tpl deleted file mode 100644 index bd105a61b..000000000 --- a/view/en/mail_received_html_body_eml.tpl +++ /dev/null @@ -1,26 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> -<html> -<head> - <title>Friendica Message</title> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -</head> -<body> -<table style="border:1px solid #ccc"> - <tbody> - <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> - - - <tr><td style="padding-top:22px;" colspan="2">$from sent you a new private message at $siteName.</td></tr> - - - <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> - <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> - <tr><td style="font-weight:bold;padding-bottom:5px;">$title</td></tr> - <tr><td style="padding-right:22px;">$htmlversion</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Please login at <a href="$siteurl/message">$siteurl/message</a> to read and reply to your private messages.</td></tr> - <tr><td></td><td>Thank You,</td></tr> - <tr><td></td><td>$siteName Administrator</td></tr> - </tbody> -</table> -</body> -</html> diff --git a/view/en/mail_received_text_body_eml.tpl b/view/en/mail_received_text_body_eml.tpl deleted file mode 100644 index 023867304..000000000 --- a/view/en/mail_received_text_body_eml.tpl +++ /dev/null @@ -1,10 +0,0 @@ -$from sent you a new private message at $siteName. - -$title - -$textversion - -Please login at $siteurl to read and reply to your private messages. - -Thank you, -$siteName administrator diff --git a/view/en/wall_received_eml.tpl b/view/en/wall_received_eml.tpl deleted file mode 100644 index c296de785..000000000 --- a/view/en/wall_received_eml.tpl +++ /dev/null @@ -1,18 +0,0 @@ - -Dear $username, - - '$from' posted something to your profile wall. - ------ -$body ------ - -Please login at $siteurl to view or delete the item: - -$display - -Thank you, - $sitename administrator - - - diff --git a/view/en/wall_received_html_body_eml.tpl b/view/en/wall_received_html_body_eml.tpl deleted file mode 100644 index 91ef61e29..000000000 --- a/view/en/wall_received_html_body_eml.tpl +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> -<html> -<head> - <title>Friendica Message</title> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> -</head> -<body> -<table style="border:1px solid #ccc"> - <tbody> - <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> - - <tr><td style="padding-top:22px;" colspan="2">$from posted something to your profile wall.</td></tr> - - - <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> - <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> - <tr><td style="padding-right:22px;">$body</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Please login at <a href="$siteurl">$siteurl</a> to <a href="$display">view or delete the post</a>.</td></tr> - <tr><td></td><td>Thank You,</td></tr> - <tr><td></td><td>$sitename Administrator</td></tr> - </tbody> -</table> -</body> -</html> diff --git a/view/en/wall_received_text_body_eml.tpl b/view/en/wall_received_text_body_eml.tpl deleted file mode 100644 index c296de785..000000000 --- a/view/en/wall_received_text_body_eml.tpl +++ /dev/null @@ -1,18 +0,0 @@ - -Dear $username, - - '$from' posted something to your profile wall. - ------ -$body ------ - -Please login at $siteurl to view or delete the item: - -$display - -Thank you, - $sitename administrator - - - diff --git a/view/jot-header.tpl b/view/jot-header.tpl index ecfed6c42..941a8f3e2 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -7,6 +7,7 @@ var textlen = 0; function initEditor(cb){ if (editor==false){ $("#profile-jot-text-loading").show(); +// $("#jot-title").show(); tinyMCE.init({ theme : "advanced", mode : "specific_textareas", diff --git a/view/jot.tpl b/view/jot.tpl index 71b92986d..83af1ae37 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -12,8 +12,10 @@ <input type="hidden" name="return" value="$return_path" /> <input type="hidden" name="location" id="jot-location" value="$defloc" /> <input type="hidden" name="coord" id="jot-coord" value="" /> - <input type="hidden" name="title" id="jot-title" value="" /> <input type="hidden" name="post_id" value="$post_id" /> + <div id="jot-title-wrapper"> + <input type="text" name="title" id="jot-title" value="" style="display: none;" /> + </div> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> |