]> git.mxchange.org Git - friendica-addons.git/blobdiff - ifttt/ifttt.php
PL translation libertree THX waldis
[friendica-addons.git] / ifttt / ifttt.php
index bdb2b6076234c2ab808179dcb1b2b687eb08eec1..14add12a28a4adadf18ec7a589bd5120ab018b28 100644 (file)
@@ -14,7 +14,8 @@ 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()
 {
@@ -99,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;
        }
@@ -170,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';
@@ -182,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') {