X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ifttt%2Fifttt.php;h=14add12a28a4adadf18ec7a589bd5120ab018b28;hb=8a700150cc8c0d430ca2b245618cc3aa4df375c7;hp=40cc5250c4f434af428c19ab7ef581f883358d04;hpb=0afd633346b517894ff8e92c705bd5d052dd06a2;p=friendica-addons.git diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 40cc5250..14add12a 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -12,8 +12,10 @@ require_once 'include/text.php'; use Friendica\App; use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Database\DBM; +use Friendica\Database\DBA; +use Friendica\Model\Item; function ifttt_install() { @@ -51,35 +53,35 @@ function ifttt_settings(App $a, &$s) } $s .= ''; - $s .= '

' . t('IFTTT Mirror') . '

'; + $s .= '

' . L10n::t('IFTTT Mirror') . '

'; $s .= '
'; $s .= ''; } @@ -98,8 +100,8 @@ function ifttt_post(App $a) $nickname = $a->argv[1]; - $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]); - if (!DBM::is_result($user)) { + $user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]); + if (!DBA::isResult($user)) { logger('User ' . $nickname . ' not found.', LOGGER_DEBUG); return; } @@ -169,7 +171,6 @@ function ifttt_message($uid, $item) $_SESSION['uid'] = $uid; unset($_REQUEST); - $_REQUEST['type'] = 'wall'; $_REQUEST['api_source'] = true; $_REQUEST['profile_uid'] = $uid; $_REQUEST['source'] = 'IFTTT'; @@ -181,7 +182,7 @@ function ifttt_message($uid, $item) if (strstr($item['url'], 'facebook.com')) { $hash = hash('ripemd128', item['url']); $_REQUEST['extid'] = NETWORK_FACEBOOK; - $_REQUEST['message_id'] = item_new_uri($a->get_hostname(), $uid, NETWORK_FACEBOOK . ':' . $hash); + $_REQUEST['message_id'] = Item::newURI($uid, NETWORK_FACEBOOK . ':' . $hash); } if ($item['type'] == 'link') {