From 35fc14d6ab286a20bc8c510733c46cbd5f0d9676 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 15:11:57 -0700 Subject: don't relay diaspora comments to sys channel --- include/diaspora.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/diaspora.php b/include/diaspora.php index 7295b4261..da55b8fb6 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1287,6 +1287,12 @@ function diaspora_comment($importer,$xml,$msg) { // our post, so he/she must be a contact of ours and his/her public key // should be in $msg['key'] + if($importer['system']) { + // don't relay to the sys channel + logger('diaspora_comment: relay to sys channel blocked.'); + return; + } + $author_signature = base64_decode($author_signature); if(! rsa_verify($signed_data,$author_signature,$key,'sha256')) { -- cgit v1.2.3 From 4e98a70e66ccac9de891760219bf86eda3bb3d68 Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Wed, 11 Mar 2015 20:56:40 -0400 Subject: add missing %d for abook_closeness --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index c3325609b..5c12dc4ba 100644 --- a/include/zot.php +++ b/include/zot.php @@ -469,7 +469,7 @@ function zot_refresh($them,$channel = null, $force = false) { if($closeness === false) $closeness = 80; - $y = q("insert into abook ( abook_account, abook_channel, abook_closeness, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_dob, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', '%s', %d )", + $y = q("insert into abook ( abook_account, abook_channel, abook_closeness, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_dob, abook_flags ) values ( %d, %d, %d, '%s', %d, %d, '%s', '%s', '%s', %d )", intval($channel['channel_account_id']), intval($channel['channel_id']), intval($closeness), -- cgit v1.2.3 From 1b3fee05e6db1fa80cd1a76395fa9e558e1e53c4 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 18:04:43 -0700 Subject: turn parse_url into the definitive url attaching mechanism --- include/bbcode.php | 22 +++++++++++++++++++++- include/oembed.php | 16 ++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index aa6641ca2..32e5d014f 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -756,11 +756,17 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // html5 video and audio if (strpos($Text,'[/video]') !== false) { - $Text = preg_replace_callback("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", 'tryzrlvideo', $Text); + $Text = preg_replace_callback("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/video\]/ism", 'tryzrlvideo', $Text); } if (strpos($Text,'[/audio]') !== false) { $Text = preg_replace_callback("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3|opus))\[\/audio\]/ism", 'tryzrlaudio', $Text); } + if (strpos($Text,'[/zvideo]') !== false) { + $Text = preg_replace_callback("/\[zvideo\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mpeg|mpg))\[\/zvideo\]/ism", 'tryzrlvideo', $Text); + } + if (strpos($Text,'[/zaudio]') !== false) { + $Text = preg_replace_callback("/\[zaudio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3|opus))\[\/zaudio\]/ism", 'tryzrlaudio', $Text); + } // Try to Oembed if ($tryoembed) { @@ -771,6 +777,13 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { if (strpos($Text,'[/audio]') !== false) { $Text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", 'tryoembed', $Text); } + + if (strpos($Text,'[/zvideo]') !== false) { + $Text = preg_replace_callback("/\[zvideo\](.*?)\[\/zvideo\]/ism", 'tryoembed', $Text); + } + if (strpos($Text,'[/zaudio]') !== false) { + $Text = preg_replace_callback("/\[zaudio\](.*?)\[\/zaudio\]/ism", 'tryoembed', $Text); + } } // if video couldn't be embedded, link to it instead. @@ -781,6 +794,13 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text); } + if (strpos($Text,'[/zvideo]') !== false) { + $Text = preg_replace("/\[zvideo\](.*?)\[\/zvideo\]/", '$1', $Text); + } + if (strpos($Text,'[/zaudio]') !== false) { + $Text = preg_replace("/\[zaudio\](.*?)\[\/zaudio\]/", '$1', $Text); + } + diff --git a/include/oembed.php b/include/oembed.php index 38c433e99..ea91ec22b 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -8,13 +8,25 @@ function oembed_replacecb($matches){ } +// if the url is embeddable with oembed, return the bbcode link. + +function oembed_process($url) { + $j = oembed_fetch_url($url); + logger('oembed_process: ' . print_r($j,true)); + if($j && $j->type !== 'error') + return '[embed]' . $url . '[/embed]'; + return false; +} + + + function oembed_fetch_url($embedurl){ $a = get_app(); $txt = Cache::get($a->videowidth . $embedurl); - if(strstr($txt,'youtu')) { + if(strstr($txt,'youtu') && strstr(z_root(),'https:')) { $txt = str_replace('http:','https:',$txt); } @@ -105,7 +117,7 @@ function oembed_format_object($j){ $th=120; $tw = $th*$tr; $tpl=get_markup_template('oembed_video.tpl'); - if(strstr($embedurl,'youtu')) { + if(strstr($embedurl,'youtu') && strstr(z_root(),'https:')) { $embedurl = str_replace('http:','https:',$embedurl); $j->thumbnail_url = str_replace('http:','https:', $j->thumbnail_url); $jhtml = str_replace('http:','https:', $jhtml); -- cgit v1.2.3 From d80088f6f6b2d976fc683fcc6db52d2d5ba2f092 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 18:12:04 -0700 Subject: make embeds bookmarkable --- include/oembed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/oembed.php b/include/oembed.php index ea91ec22b..0628afaa9 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -154,7 +154,7 @@ function oembed_format_object($j){ // add link to source if not present in "rich" type if ( $j->type!='rich' || !strpos($j->html,$embedurl) ){ $embedlink = (isset($j->title))?$j->title:$embedurl; - $ret .= "$embedlink"; + $ret .= '#^' . "$embedlink"; $ret .= "
"; if (isset($j->author_name)) $ret.=" by ".$j->author_name; if (isset($j->provider_name)) $ret.=" on ".$j->provider_name; -- cgit v1.2.3 From b3a9a6c802170a15cc58fd3af966b35f81c50818 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 18:56:28 -0700 Subject: remove the now redundant audio/video buttons and label the editor text style buttons which didn't have them. Unused editor buttons were commented in case we need to bring them back. If things go smoothly we can remove them. Use the link icon going forward - for all links. --- include/ItemObject.php | 2 +- include/conversation.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ItemObject.php b/include/ItemObject.php index 1785d55e7..4fc01e6d4 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -672,7 +672,7 @@ class Item extends BaseObject { '$edquote' => t('Quote'), '$edcode' => t('Code'), '$edimg' => t('Image'), - '$edurl' => t('Link'), + '$edurl' => t('Insert Link'), '$edvideo' => t('Video'), '$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''), '$indent' => $indent, diff --git a/include/conversation.php b/include/conversation.php index bc1883efc..0e35202fa 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1173,6 +1173,11 @@ function status_editor($a, $x, $popup = false) { '$id_select' => $id_select, '$id_seltext' => t('Post as'), '$writephoto' => perm_is_allowed($x['profile_uid'], get_observer_hash(), 'post_photos'), + '$bold' => t('Bold'), + '$italic' => t('Italic'), + '$underline' => t('Underline'), + '$quote' => t('Quote'), + '$code' => t('Code'), '$upload' => t('Upload photo'), '$shortupload' => t('upload photo'), '$attach' => t('Attach file'), -- cgit v1.2.3