aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-23 01:36:01 -0700
committerfriendica <info@friendica.com>2014-10-23 01:36:40 -0700
commit0ebfee8f87f73111b4de659ee5c97c12ad04b356 (patch)
tree3fac60a61222b6dfc8acc56b7248fee50fd802df
parent58c692e3897a7807fed23e2633496c4960f022ca (diff)
downloadvolse-hubzilla-0ebfee8f87f73111b4de659ee5c97c12ad04b356.tar.gz
volse-hubzilla-0ebfee8f87f73111b4de659ee5c97c12ad04b356.tar.bz2
volse-hubzilla-0ebfee8f87f73111b4de659ee5c97c12ad04b356.zip
wrong permalink on remote events
-rw-r--r--include/event.php14
-rw-r--r--version.inc2
2 files changed, 11 insertions, 5 deletions
diff --git a/include/event.php b/include/event.php
index 1fe6e6f7f..03ecaa0a7 100644
--- a/include/event.php
+++ b/include/event.php
@@ -400,8 +400,7 @@ function event_store_item($arr,$event) {
}
else {
- $z = q("select * from channel where channel_hash = '%s' and channel_id = %d limit 1",
- dbesc($event['event_xchan']),
+ $z = q("select * from channel where channel_id = %d limit 1",
intval($arr['uid'])
);
@@ -413,7 +412,7 @@ function event_store_item($arr,$event) {
$item_arr['id'] = $item['id'];
}
else {
- $wall = (($z) ? true : false);
+ $wall = (($z[0]['channel_hash'] == $event['event_xchan']) ? true : false);
$item_flags = ITEM_THREAD_TOP;
if($wall) {
@@ -455,7 +454,14 @@ function event_store_item($arr,$event) {
$item_arr['body'] = $prefix . format_event_bbcode($arr);
- $item_arr['plink'] = z_root() . '/channel/' . $z[0]['channel_address'] . '/?f=&mid=' . $item_arr['mid'];
+ // if it's local send the permalink to the channel page.
+ // otherwise we'll fallback to /display/$message_id
+
+ if($wall)
+ $item_arr['plink'] = z_root() . '/channel/' . $z[0]['channel_address'] . '/?f=&mid=' . $item_arr['mid'];
+ else
+ $item_arr['plink'] = z_root() . '/display/' . $item_arr['mid'];
+
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($arr['event_xchan'])
diff --git a/version.inc b/version.inc
index 1f7ba0290..e93632a42 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-10-22.836
+2014-10-23.837