minor fixes

This commit is contained in:
Mike Macgirvin 2023-09-01 20:07:57 +10:00
parent 0e3093efe1
commit fe02528001
4 changed files with 9 additions and 4 deletions

View file

@ -118,7 +118,7 @@ class ThreadItem
$locktype = intval($item['item_private']);
$shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && (! intval($item['item_private']))) ? true : false);
$shareable = ($conv->get_profile_owner() == local_channel() && local_channel()) && (! intval($item['item_private']));
$repeatable = false;
// allow an exemption for sharing stuff from your private feeds

View file

@ -108,7 +108,11 @@ class Editpost extends Controller
if ($j) {
foreach ($j as $jj) {
if (!str_starts_with($jj['type'],'application/ld+json')) {
$item['body'] .= "\n" . '[attachment]' . basename($jj['href']) . ',' . $jj['revision'] . '[/attachment]' . "\n";
$r = q("select hash from attach where display_path = '%s'",
dbesc(str_replace(z_root() . '/cloud/' . $channel['channel_address'] . '/','',$jj['href']))
);
$hash = $r ? $r[0]['hash'] : $jj['href'];
$item['body'] .= "\n" . '[attachment]' . $hash . ',' . $jj['revision'] . '[/attachment]' . "\n";
}
}
}

View file

@ -113,7 +113,7 @@ class Share extends Controller
$arr['uuid'] = new_uuid();
$arr['mid'] = z_root() . '/item/' . $arr['uuid'];
$arr['mid'] = str_replace('/item/', '/activity/', $arr['mid']);
$arr['parent_mid'] = $item['mid'];
$arr['parent_mid'] = $arr['mid'];
$mention = '@[zrl=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/zrl]';
$arr['body'] = sprintf(t('🔁 Repeated %1$s\'s %2$s'), $mention, $item['obj_type']);

View file

@ -107,7 +107,7 @@ class GitRepo
public function setRepoPath($directory)
{
if (is_dir($directory)) {
$this->path->$directory;
$this->path = $directory;
$this->git->setRepository($directory);
return true;
}
@ -126,6 +126,7 @@ class GitRepo
if (validate_url($this->url) && $this->isValidGitRepoURL($this->url) && is_dir($this->path)) {
return $this->git->clone($this->url, $this->path);
}
return false;
}
public function probeRepo()