use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
- if (! can_write_wall($a, $item['uid'])) {
- logger('like: unable to write on wall ' . $item['uid']);
+ if (($uid == 0) && local_user()) {
+ $uid = local_user();
+ }
+
+ if (!can_write_wall($uid)) {
+ logger('like: unable to write on wall ' . $uid);
// Clean up the Diaspora signatures for this like
// Go ahead and do it even if Diaspora support is disabled. We still want to clean up
// if it had been enabled in the past
// Clean up the Diaspora signatures for this like
// Go ahead and do it even if Diaspora support is disabled. We still want to clean up
// if it had been enabled in the past
$like_item_id = $like_item['id'];
Worker::add(PRIORITY_HIGH, "Notifier", "like", $like_item_id);
$like_item_id = $like_item['id'];
Worker::add(PRIORITY_HIGH, "Notifier", "like", $like_item_id);
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$plink = '[url=' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$plink = '[url=' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
$new_item_id = item_store($new_item);
// @todo: Explain this block
if (! $item['visible']) {
$new_item_id = item_store($new_item);
// @todo: Explain this block
if (! $item['visible']) {
Worker::add(PRIORITY_HIGH, "Notifier", "like", $new_item_id);
Worker::add(PRIORITY_HIGH, "Notifier", "like", $new_item_id);