aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-26 17:52:24 -0700
committerFriendika <info@friendika.com>2011-08-26 17:52:24 -0700
commit721db93e8450eb051f98a9a0b12db476d3cc3dfc (patch)
tree5690d5958c6f9a2658a1790311b9334e0bc871a9 /include/diaspora.php
parent144f241c5daa56428113dd53138002f40fd7cb44 (diff)
downloadvolse-hubzilla-721db93e8450eb051f98a9a0b12db476d3cc3dfc.tar.gz
volse-hubzilla-721db93e8450eb051f98a9a0b12db476d3cc3dfc.tar.bz2
volse-hubzilla-721db93e8450eb051f98a9a0b12db476d3cc3dfc.zip
check for existing diaspora comment before accepting, add 'Diaspora' app to item, use html_entity_decode so quotes don't get messed up
Diffstat (limited to 'include/diaspora.php')
-rw-r--r--include/diaspora.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index bb4bd98c7..e3ab9458d 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -453,6 +453,7 @@ function diaspora_post($importer,$xml) {
$datarray['author-link'] = $contact['url'];
$datarray['author-avatar'] = $contact['thumb'];
$datarray['body'] = $body;
+ $datarray['app'] = 'Diaspora';
item_store($datarray);
@@ -485,6 +486,15 @@ function diaspora_comment($importer,$xml,$msg) {
$r = q("SELECT * FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
intval($importer['uid']),
+ dbesc($guid)
+ );
+ if(count($r)) {
+ logger('daspora_comment: our comment just got relayed back to us (or there was a guid collision) : ' . $guid);
+ return;
+ }
+
+ $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
+ intval($importer['uid']),
dbesc($parent_guid)
);
if(! count($r)) {
@@ -558,6 +568,7 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['author-link'] = $person['url'];
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
$datarray['body'] = $body;
+ $datarray['app'] = 'Diaspora';
$message_id = item_store($datarray);
@@ -776,6 +787,8 @@ EOT;
$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
+ $arr['app'] = 'Diaspora';
+
$arr['private'] = $parent_item['private'];
$arr['verb'] = $activity;
$arr['object-type'] = $objtype;
@@ -897,7 +910,8 @@ function diaspora_send_status($item,$owner,$contact) {
}
}
- $body = xmlify(bb2diaspora($body));
+ $body = xmlify(html_entity_decode(bb2diaspora($body)));
+
$public = (($item['private']) ? 'false' : 'true');
require_once('include/datetime.php');
@@ -990,7 +1004,7 @@ function diaspora_send_followup($item,$owner,$contact) {
$like = false;
}
- $text = bb2diaspora($item['body']);
+ $text = html_entity_decode(bb2diaspora($item['body']));
// sign it
@@ -1046,7 +1060,7 @@ function diaspora_send_relay($item,$owner,$contact) {
$like = false;
}
- $text = bb2diaspora($item['body']);
+ $text = html_entity_decode(bb2diaspora($item['body']));
// fetch the original signature if somebody sent the post to us to relay
// if we are relaying for a reply originating here, there wasn't a 'send to relay'