aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
committerredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
commit1e68d4fb75b9831ed763328b7982e44d1d4cdc5b (patch)
tree5379f5803f4aa3ec8b5bced6b3151cd08cf89d0f /Zotlabs/Module/Item.php
parent6d4188f05e2a8e92508b1d38e4b7ef5156ba6c42 (diff)
downloadvolse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.gz
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.bz2
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.zip
deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication.
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 2601feb0a..272da7971 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -1,4 +1,5 @@
<?php
+
namespace Zotlabs\Module;
/**
@@ -229,7 +230,7 @@ class Item extends \Zotlabs\Web\Controller {
if($namespace && $remote_id) {
// It wasn't an internally generated post - see if we've got an item matching this remote service id
- $i = q("select iid from item_id where service = '%s' and sid = '%s' limit 1",
+ $i = q("select iid from iconfig where cat = 'system' and k = '%s' and v = '%s' limit 1",
dbesc($namespace),
dbesc($remote_id)
);
@@ -880,13 +881,21 @@ class Item extends \Zotlabs\Web\Controller {
}
}
+ if($webpage) {
+ Zlib\IConfig::Set($datarray,'system', webpage_to_namespace($webpage),
+ (($pagetitle) ? $pagetitle : substr($datarray['mid'],0,16)),true);
+ }
+ elseif($namespace) {
+ Zlib\IConfig::Set($datarray,'system', $namespace,
+ (($remote_id) ? $remote_id : substr($datarray['mid'],0,16)),true);
+ }
+
+
if($orig_post) {
$datarray['id'] = $post_id;
item_store_update($datarray,$execflag);
- update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
-
if(! $parent) {
$r = q("select * from item where id = %d",
intval($post_id)
@@ -894,10 +903,7 @@ class Item extends \Zotlabs\Web\Controller {
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
- $rid = q("select * from item_id where iid = %d",
- intval($post_id)
- );
- build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid));
+ build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true))));
}
}
if(! $nopush)
@@ -978,10 +984,7 @@ class Item extends \Zotlabs\Web\Controller {
goaway(z_root() . "/" . $return_path );
// NOTREACHED
}
-
-
- update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
-
+
if(($parent) && ($parent != $post_id)) {
// Store the comment signature information in case we need to relay to Diaspora
//$ditem = $datarray;
@@ -995,10 +998,7 @@ class Item extends \Zotlabs\Web\Controller {
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
- $rid = q("select * from item_id where iid = %d",
- intval($post_id)
- );
- build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid));
+ build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true))));
}
}