aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Libzot.php4
-rw-r--r--include/text.php21
2 files changed, 11 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index cb9bf9937..ae8c725d7 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -727,7 +727,7 @@ class Libzot {
|| $hidden_changed || $adult_changed || $deleted_changed || $pubforum_changed) {
$rup = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_connurl = '%s', xchan_follow = '%s',
xchan_connpage = '%s', xchan_hidden = %d, xchan_selfcensored = %d, xchan_deleted = %d, xchan_pubforum = %d,
- xchan_addr = '%s', xchan_url = '%s' where xchan_url = '%s'",
+ xchan_addr = '%s', xchan_url = '%s' where xchan_hash = '%s'",
dbesc(($arr['name']) ? escape_tags($arr['name']) : '-'),
dbesc($arr['name_updated']),
dbesc($arr['primary_location']['connections_url']),
@@ -739,7 +739,7 @@ class Libzot {
intval($arr['public_forum']),
dbesc(escape_tags($arr['primary_location']['address'])),
dbesc(escape_tags($arr['primary_location']['url'])),
- dbesc($r[0]['xchan_url'])
+ dbesc($xchan_hash)
);
logger('Update: existing: ' . print_r($r[0], true), LOGGER_DATA, LOG_DEBUG);
diff --git a/include/text.php b/include/text.php
index 9869bfbfa..841abdbd3 100644
--- a/include/text.php
+++ b/include/text.php
@@ -11,6 +11,7 @@ use Ramsey\Uuid\Exception\UnableToBuildUuidException;
use Zotlabs\Lib\Crypto;
use Zotlabs\Lib\SvgSanitizer;
+use Zotlabs\Lib\Libzot;
require_once("include/bbcode.php");
@@ -2851,7 +2852,7 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true)
// BEGIN mentions
- if ( in_array($termtype, [ TERM_MENTION, TERM_FORUM ] )) {
+ if ($termtype === TERM_MENTION) {
// The @! tag will alter permissions
@@ -2939,7 +2940,10 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true)
// $r is set if we found something
if($r) {
- foreach($r as $xc) {
+
+ $xchan[0] = Libzot::zot_record_preferred($r, 'xchan_network');
+
+ foreach($xchan as $xc) {
$profile = $xc['xchan_url'];
$newname = $xc['xchan_name'];
// add the channel's xchan_hash to $access_tag if exclusive
@@ -2954,16 +2958,9 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true)
//create profile link
$profile = str_replace(',','%2c',$profile);
$url = $profile;
-/*
- if($termtype === TERM_FORUM) {
- $newtag = '!' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
- $body = str_replace('!' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
- }
-*/
- if ($termtype === TERM_MENTION) {
- $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
- $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
- }
+
+ $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
+ $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
// append tag to str_tags
if(! stristr($str_tags,$newtag)) {