Browse Source

Remove the internal API case for emojis

pull/676/head
Timothée Jaussoin 7 years ago
parent
commit
aa014af963
  1. 6
      app/helpers/StringHelper.php
  2. 11
      src/Movim/Daemon/Api.php

6
app/helpers/StringHelper.php

@ -100,10 +100,8 @@ function addHFR($string)
*/
function prepareString($string, $preview = false)
{
$string = addUrls($string, $preview);
// We add some smileys...
return trim((string)requestURL('http://localhost:1560/emojis/', 2, ['string' => $string]));
$emoji = \Movim\Emoji::getInstance();
return $emoji->replace(addUrls($string, $preview));
}
/**

11
src/Movim/Daemon/Api.php

@ -47,9 +47,6 @@ class Api
case 'purify':
$response = $api->purifyHTML($request->getParsedBody());
break;
case 'emojis':
$response = $api->addEmojis($request->getParsedBody());
break;
case 'session':
$response = $api->getSession($request->getParsedBody());
break;
@ -155,13 +152,5 @@ class Api
$trimmed = trim($purifier->purify($string));
return preg_replace('#(\s*<br\s*/?>)*\s*$#i', '', $trimmed);
}
public function addEmojis($post)
{
$string = $post['string'];
$emoji = \Movim\Emoji::getInstance();
return $emoji->replace($string);
}
}
Loading…
Cancel
Save