aboutsummaryrefslogtreecommitdiffstats
path: root/mod/import.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2013-08-20 08:01:30 -0700
committerPaolo T <tuscanhobbit@users.noreply.github.com>2013-08-20 08:01:30 -0700
commitf3ba283613bb5bd39c0f39f96a2f91112f947923 (patch)
tree9e31515169ab9e05f763d5ac8f625b8c3672b985 /mod/import.php
parentadd03b64985f79aa268514854e91d96b6880bb3d (diff)
parent25fdc269bed74d2f1aaeb181906f50666fca1328 (diff)
downloadvolse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.tar.gz
volse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.tar.bz2
volse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.zip
Merge pull request #1 from friendica/master
Test update of my branched Red
Diffstat (limited to 'mod/import.php')
-rw-r--r--mod/import.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/import.php b/mod/import.php
index c98f4d2eb..08311013a 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -206,10 +206,35 @@ function import_post(&$a) {
// import xchans and contact photos
+ if($seize) {
+
+ // replace our existing xchan if we're seizing control
+
+ $r = q("delete from xchan where xchan_hash = '%s' limit 1",
+ dbesc($channel['channel_hash'])
+ );
+
+ $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_l, xchan_photo_m, xchan_photo_s, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_photo_date, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
+ dbesc($channel['channel_hash']),
+ dbesc($channel['channel_guid']),
+ dbesc($channel['channel_guid_sig']),
+ dbesc($channel['channel_pubkey']),
+ dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']),
+ dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']),
+ dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']),
+ dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
+ dbesc(z_root() . '/channel/' . $channel['channel_address']),
+ dbesc($channel['channel_name']),
+ dbesc('zot'),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert())
+ );
+ }
$xchans = $data['xchan'];
if($xchans) {
foreach($xchans as $xchan) {
+
$r = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1",
dbesc($xchan['xchan_hash'])
);