mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
federated emoji support
This commit is contained in:
parent
2640c49c0e
commit
7b492d2bd3
2 changed files with 13 additions and 1 deletions
|
@ -293,7 +293,11 @@ class Activity {
|
|||
$ret[] = [ 'ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '@') ? substr($t['name'],1) : $t['name']) ];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'Emoji':
|
||||
$ret[] = [ 'ttype' => TERM_EMOJI, 'url' => t['icon']['url'], 'term' => escape_tags($t['name']) ];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1501,6 +1505,13 @@ class Activity {
|
|||
$a = self::decode_taxonomy($act->obj);
|
||||
if($a) {
|
||||
$s['term'] = $a;
|
||||
foreach($a as $b) {
|
||||
if($b['ttype'] === TERM_EMOJI) {
|
||||
$s['title'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['title']);
|
||||
$s['summary'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['summary']);
|
||||
$s['body'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['body']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = self::decode_attachment($act->obj);
|
||||
|
|
1
boot.php
1
boot.php
|
@ -407,6 +407,7 @@ define ( 'TERM_BOOKMARK', 8 );
|
|||
define ( 'TERM_HIERARCHY', 9 );
|
||||
define ( 'TERM_COMMUNITYTAG', 10 );
|
||||
define ( 'TERM_FORUM', 11 );
|
||||
define ( 'TERM_EMOJI', 12 );
|
||||
|
||||
define ( 'TERM_OBJ_POST', 1 );
|
||||
define ( 'TERM_OBJ_PHOTO', 2 );
|
||||
|
|
Loading…
Reference in a new issue