aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/item.php10
-rw-r--r--util/wp/post_to_red/post_to_red.php6
2 files changed, 15 insertions, 1 deletions
diff --git a/mod/item.php b/mod/item.php
index 7eebbe287..dba9f01b6 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -58,6 +58,12 @@ function item_post(&$a) {
// If you are unsure, it is prudent (and important) to leave it unset.
$origin = (($api_source && array_key_exists('origin',$_REQUEST)) ? intval($_REQUEST['origin']) : 1);
+
+ // To represent message-ids on other networks - this will create an item_id record
+
+ $namespace = (($api_source && array_key_exists('namespace',$_REQUEST)) ? strip_tags($_REQUEST['namespace']) : '');
+ $remote_id = (($api_source && array_key_exists('remote_id',$_REQUEST)) ? strip_tags($_REQUEST['remote_id']) : '');
+
$owner_hash = null;
$message_id = ((x($_REQUEST,'message_id') && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
@@ -782,6 +788,10 @@ function item_post(&$a) {
$page_type = 'BUILDBLOCK';
elseif($webpage & ITEM_PDL)
$page_type = 'PDL';
+ elseif($namespace && $remote_id) {
+ $page_type = $namespace;
+ $pagetitle = $remote_id;
+ }
if($page_type) {
diff --git a/util/wp/post_to_red/post_to_red.php b/util/wp/post_to_red/post_to_red.php
index 8e62a1a56..095884007 100644
--- a/util/wp/post_to_red/post_to_red.php
+++ b/util/wp/post_to_red/post_to_red.php
@@ -78,6 +78,10 @@ function post_to_red_post($post_id) {
}
}
+ $message_namespace = 'wordpress';
+
+ $message_id = $site_url() . '/' . $post_id;
+
$message = $post->post_title . "<br /><br />" . $message;
$message .= "<br /><br />permalink: " . $post->guid;
@@ -93,7 +97,7 @@ function post_to_red_post($post_id) {
$headers = array('Authorization' => 'Basic '.base64_encode("$user_name:$password"));
- $body = array('status' => $bbcode,'source' => 'WordPress');
+ $body = array('status' => $bbcode,'source' => 'WordPress', 'namespace' => $message_namespace, 'remote_id' => $message_id);
if($channel)
$body['channel'] = $channel;