* 3rd parse a SMARTY3 template, replacing some translateable strings for the form
*/
-function langfilter_addon_settings(App $a, array &$data)
+function langfilter_addon_settings(array &$data)
{
if (!DI::userSession()->getLocalUserId()) {
return;
* 3rd save the settings to the DB for later usage
*/
-function langfilter_addon_settings_post(App $a, array &$b)
+function langfilter_addon_settings_post(array &$b)
{
if (!DI::userSession()->getLocalUserId()) {
return;
* expand it again.
*/
-function langfilter_prepare_body_content_filter(App $a, &$hook_data)
+function langfilter_prepare_body_content_filter(&$hook_data)
{
$logged_user = DI::userSession()->getLocalUserId();
if (!$logged_user) {
// Never filter own messages
// TODO: find a better way to extract this
- $logged_user_profile = DI::baseUrl()->get() . '/profile/' . $a->getLoggedInUserNickname();
+ $logged_user_profile = DI::baseUrl() . '/profile/' . DI::userSession()->getLocalUserNickname();
if ($logged_user_profile == $hook_data['item']['author-link']) {
return;
}
$naked_body = strip_tags(
$hook_data['item']['rendered-html']
??''?: // Equivalent of !empty()
- BBCode::convert($hook_data['item']['body'], false, BBCode::ACTIVITYPUB, true)
+ BBCode::convertForUriId($hook_data['item']['uri-id'], $hook_data['item']['body'], BBCode::ACTIVITYPUB)
);
$naked_body = preg_replace('#\s+#', ' ', trim($naked_body));
return;
}
- $lang = $iso639->languageByCode1($iso2);
+ $lang = $iso639->languageByCode1(substr($iso2, 0, 2));
} else {
$opts = $hook_data['item']['postopts'];
if (!$opts) {