]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into item-abstraction
authorMichael <heluecht@pirati.ca>
Sun, 17 Jun 2018 06:23:56 +0000 (06:23 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 Jun 2018 06:23:56 +0000 (06:23 +0000)
1  2 
twitter/twitter.php

index 0b8f5c38e6bcfe88cbc4147879421a4c8459638e,51e87335bd2fc3479b81f91cf940b70556ec1a3c..e0a29665f4fd1b1c3593ac9e52dd0b0b8c936be1
@@@ -1486,7 -1492,76 +1485,7 @@@ function twitter_createpost(App $a, $ui
        return $postarray;
  }
  
- function twitter_fetchparentposts(App $a, $uid, $post, $connection, $self, $own_id)
 -function twitter_checknotification(App $a, $uid, $own_id, $top_item, $postarray)
 -{
 -      /// TODO: this whole function doesn't seem to work. Needs complete check
 -      $user = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1",
 -              intval($uid)
 -      );
 -
 -      if (!DBM::is_result($user)) {
 -              return;
 -      }
 -
 -      // Is it me?
 -      if (link_compare($user[0]["url"], $postarray['author-link'])) {
 -              return;
 -      }
 -
 -      $own_user = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' LIMIT 1",
 -              intval($uid),
 -              dbesc("twitter::".$own_id)
 -      );
 -
 -      if (!DBM::is_result($own_user)) {
 -              return;
 -      }
 -
 -      // Is it me from twitter?
 -      if (link_compare($own_user[0]["url"], $postarray['author-link'])) {
 -              return;
 -      }
 -
 -      $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 AND `deleted` = 0",
 -              dbesc($postarray['parent-uri']),
 -              intval($uid)
 -      );
 -
 -      if (DBM::is_result($myconv)) {
 -              foreach ($myconv as $conv) {
 -                      // now if we find a match, it means we're in this conversation
 -                      if (!link_compare($conv['author-link'], $user[0]["url"]) && !link_compare($conv['author-link'], $own_user[0]["url"])) {
 -                              continue;
 -                      }
 -
 -                      require_once 'include/enotify.php';
 -
 -                      $conv_parent = $conv['parent'];
 -
 -                      notification([
 -                              'type' => NOTIFY_COMMENT,
 -                              'notify_flags' => $user[0]['notify-flags'],
 -                              'language' => $user[0]['language'],
 -                              'to_name' => $user[0]['username'],
 -                              'to_email' => $user[0]['email'],
 -                              'uid' => $user[0]['uid'],
 -                              'item' => $postarray,
 -                              'link' => $a->get_baseurl() . '/display/' . urlencode(Item::getGuidById($top_item)),
 -                              'source_name' => $postarray['author-name'],
 -                              'source_link' => $postarray['author-link'],
 -                              'source_photo' => $postarray['author-avatar'],
 -                              'verb' => ACTIVITY_POST,
 -                              'otype' => 'item',
 -                              'parent' => $conv_parent,
 -                      ]);
 -
 -                      // only send one notification
 -                      break;
 -              }
 -      }
 -}
 -
+ function twitter_fetchparentposts(App $a, $uid, $post, TwitterOAuth $connection, $self, $own_id)
  {
        logger("twitter_fetchparentposts: Fetching for user " . $uid . " and post " . $post->id_str, LOGGER_DEBUG);