mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 12:15:19 +00:00
Merge branch 'dev'
This commit is contained in:
commit
8bcbbfbd8f
3 changed files with 13 additions and 33 deletions
|
@ -1560,17 +1560,18 @@ class Activity {
|
|||
);
|
||||
}
|
||||
|
||||
if (! $icon)
|
||||
if (! $icon) {
|
||||
$icon = z_root() . '/' . get_default_profile_photo(300);
|
||||
|
||||
}
|
||||
|
||||
Master::Summon( [ 'Xchan_photo', bin2hex($icon), bin2hex($url) ] );
|
||||
|
||||
}
|
||||
|
||||
static function drop($channel,$observer,$act) {
|
||||
$r = q("select * from item where mid = '%s' and uid = %d limit 1",
|
||||
$act->obj['id'],
|
||||
$channel['channel_id']
|
||||
dbesc((is_array($act->obj)) ? $act->obj['id'] : $act->obj),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
|
||||
if (! $r) {
|
||||
|
@ -1587,33 +1588,6 @@ class Activity {
|
|||
}
|
||||
|
||||
|
||||
static function create_action($channel,$observer_hash,$act) {
|
||||
|
||||
if (in_array($act->obj['type'], [ 'Note', 'Article', 'Video', 'Audio', 'Image' ])) {
|
||||
self::create_note($channel,$observer_hash,$act);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static function announce_action($channel,$observer_hash,$act) {
|
||||
|
||||
if (in_array($act->type, [ 'Announce' ])) {
|
||||
self::announce_note($channel,$observer_hash,$act);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static function like_action($channel,$observer_hash,$act) {
|
||||
|
||||
if (in_array($act->obj['type'], [ 'Note', 'Article', 'Video', 'Audio', 'Image' ])) {
|
||||
self::like_note($channel,$observer_hash,$act);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// sort function width decreasing
|
||||
|
||||
static function vid_sort($a,$b) {
|
||||
|
|
|
@ -61,6 +61,7 @@ class ActivityStreams {
|
|||
$tmp = JSalmon::unpack($this->data['data']);
|
||||
if($ret && $ret['success']) {
|
||||
if($ret['signer']) {
|
||||
logger('Unpacked: ' . json_encode($tmp,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT),LOGGER_DATA,LOG_DEBUG);
|
||||
$saved = json_encode($this->data,JSON_UNESCAPED_SLASHES);
|
||||
$this->data = $tmp;
|
||||
$this->data['signer'] = $ret['signer'];
|
||||
|
|
|
@ -503,15 +503,20 @@ class ThreadItem {
|
|||
else {
|
||||
$result['authors'][] = $profile_addr;
|
||||
}
|
||||
// Add any mentions from the immediate parent, unless they are mentions of the current viewer or duplicates
|
||||
if ($item['term']) {
|
||||
foreach ($item['term'] as $t) {
|
||||
if ($t['ttype'] == TERM_MENTION) {
|
||||
if (strpos($t['term'],'@') !== false) {
|
||||
$result['authors'][] = $t['term'];
|
||||
if ($observer && $t['term'] !== $observer['xchan_addr'] && ! in_array($t['term'],$result['authors'])) {
|
||||
$result['authors'][] = $t['term'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$url = ((($position = strpos($t['url'],'url=')) !== false) ? urldecode(substr($t['url'],$position + 4)) : $t['url']);
|
||||
$result['authors'][] = $url;
|
||||
if ($observer && $url !== $observer['xchan_url'] && ! in_array($url,$result['authors'])) {
|
||||
$result['authors'][] = $url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue