aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2012-04-24 10:38:23 +0200
committerzottel <github@zottel.net>2012-04-24 10:38:23 +0200
commit912e008ded3d439f7779310eb422e4b871a9b63d (patch)
tree61f1960c1ff17e27d0755e40ea7ccb90d0c0d4b1 /include
parente6847cdd3f6faf087dc7e738e1dbae7d70113451 (diff)
parentfbdb8fc43a3cb03f25102f15a1deaf8408e9122a (diff)
downloadvolse-hubzilla-912e008ded3d439f7779310eb422e4b871a9b63d.tar.gz
volse-hubzilla-912e008ded3d439f7779310eb422e4b871a9b63d.tar.bz2
volse-hubzilla-912e008ded3d439f7779310eb422e4b871a9b63d.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php43
-rw-r--r--include/bbcode.php3
-rw-r--r--include/diaspora.php12
-rw-r--r--include/html2plain.php2
4 files changed, 53 insertions, 7 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 9ba1e8ae5..537850e00 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -73,6 +73,49 @@ function contact_remove($id) {
}
+// sends an unfriend message. Does not remove the contact
+
+function terminate_friendship($user,$self,$contact) {
+
+
+ $a = get_app();
+
+ require_once('include/datetime.php');
+
+ if($contact['network'] === NETWORK_OSTATUS) {
+
+ $slap = replace_macros(get_markup_template('follow_slap.tpl'), array(
+ '$name' => $user['username'],
+ '$profile_page' => $a->get_baseurl() . '/profile/' . $user['nickname'],
+ '$photo' => $self['photo'],
+ '$thumb' => $self['thumb'],
+ '$published' => datetime_convert('UTC','UTC', 'now', ATOM_TIME),
+ '$item_id' => 'urn:X-dfrn:' . $a->get_hostname() . ':unfollow:' . random_string(),
+ '$title' => '',
+ '$type' => 'text',
+ '$content' => t('stopped following'),
+ '$nick' => $user['nickname'],
+ '$verb' => 'http://ostatus.org/schema/1.0/unfollow', // ACTIVITY_UNFOLLOW,
+ '$ostat_follow' => '' // '<as:verb>http://ostatus.org/schema/1.0/unfollow</as:verb>' . "\r\n"
+ ));
+
+ if((x($contact,'notify')) && (strlen($contact['notify']))) {
+ require_once('include/salmon.php');
+ slapper($user,$contact['notify'],$slap);
+ }
+ }
+ elseif($contact['network'] === NETWORK_DIASPORA) {
+ require_once('include/diaspora.php');
+ diaspora_unshare($user,$contact);
+ }
+ elseif($contact['network'] === NETWORK_DFRN) {
+ require_once('include/items.php');
+ dfrn_deliver($user,$contact,'placeholder', 1);
+ }
+
+}
+
+
// Contact has refused to recognise us as a friend. We will start a countdown.
// If they still don't recognise us in 32 days, the relationship is over,
// and we won't waste any more time trying to communicate with them.
diff --git a/include/bbcode.php b/include/bbcode.php
index 3697f1fc5..85d310b75 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -298,6 +298,9 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_unspacefy_and_trim',$Text);
$Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_unspacefy_and_trim',$Text);
+
+ $Text = preg_replace('/\[\&amp\;([#a-z0-9]+)\;\]/','&$1;',$Text);
+
// fix any escaped ampersands that may have been converted into links
$Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
if(strlen($saved_image))
diff --git a/include/diaspora.php b/include/diaspora.php
index afd86957b..5069c1127 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -706,10 +706,10 @@ function diaspora_post($importer,$xml) {
continue;
$basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
+ $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags))
$str_tags .= ',';
- $str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
+ $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
continue;
}
}
@@ -872,10 +872,10 @@ function diaspora_reshare($importer,$xml) {
$basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
+ $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags))
$str_tags .= ',';
- $str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
+ $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
continue;
}
}
@@ -1113,10 +1113,10 @@ function diaspora_comment($importer,$xml,$msg) {
$basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
+ $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags))
$str_tags .= ',';
- $str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
+ $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
continue;
}
}
diff --git a/include/html2plain.php b/include/html2plain.php
index 21261327d..839dd70a7 100644
--- a/include/html2plain.php
+++ b/include/html2plain.php
@@ -83,7 +83,7 @@ function collecturls($message) {
$urls = array();
foreach ($result as $treffer) {
// A list of some links that should be ignored
- $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "mailto:", "/u/", "/node/",
+ $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/",
"//facebook.com/profile.php?id=", "//plus.google.com/");
foreach ($list as $listitem)
if (strpos($treffer[1], $listitem) !== false)