X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=twitter%2Ftwitter.php;h=d846b1ada1afef4f5dd5c7b7ce209942389f1766;hb=f96ff32b212a71aff8f55b4b7b75b6948cbaba2b;hp=f05fc1f208cbd92fcb8a59d24345854705e4e926;hpb=08206fdcc0750ec9dd12a68addb341cd05f8bcfb;p=friendica-addons.git diff --git a/twitter/twitter.php b/twitter/twitter.php index f05fc1f2..d846b1ad 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -64,6 +64,7 @@ use Abraham\TwitterOAuth\TwitterOAuth; use Abraham\TwitterOAuth\TwitterOAuthException; +use Codebird\Codebird; use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Content\Text\BBCode; @@ -79,13 +80,12 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Conversation; -use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemContent; -use Friendica\Model\Queue; use Friendica\Model\User; use Friendica\Object\Image; +use Friendica\Util\ConfigFileLoader; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\Strings; @@ -105,7 +105,6 @@ function twitter_install() Hook::register('notifier_normal' , __FILE__, 'twitter_post_hook'); Hook::register('jot_networks' , __FILE__, 'twitter_jot_nets'); Hook::register('cron' , __FILE__, 'twitter_cron'); - Hook::register('queue_predeliver' , __FILE__, 'twitter_queue_hook'); Hook::register('follow' , __FILE__, 'twitter_follow'); Hook::register('expire' , __FILE__, 'twitter_expire'); Hook::register('prepare_body' , __FILE__, 'twitter_prepare_body'); @@ -123,7 +122,6 @@ function twitter_uninstall() Hook::unregister('notifier_normal' , __FILE__, 'twitter_post_hook'); Hook::unregister('jot_networks' , __FILE__, 'twitter_jot_nets'); Hook::unregister('cron' , __FILE__, 'twitter_cron'); - Hook::unregister('queue_predeliver' , __FILE__, 'twitter_queue_hook'); Hook::unregister('follow' , __FILE__, 'twitter_follow'); Hook::unregister('expire' , __FILE__, 'twitter_expire'); Hook::unregister('prepare_body' , __FILE__, 'twitter_prepare_body'); @@ -135,9 +133,9 @@ function twitter_uninstall() Hook::unregister('addon_settings_post', __FILE__, 'twitter_settings_post'); } -function twitter_load_config(App $a) +function twitter_load_config(App $a, ConfigFileLoader $loader) { - $a->loadConfigFile(__DIR__ . '/config/twitter.config.php'); + $a->getConfigCache()->load($loader->loadAddonConfig('twitter')); } function twitter_check_item_notification(App $a, array &$notification_data) @@ -193,21 +191,25 @@ function twitter_follow(App $a, array &$contact) } } -function twitter_jot_nets(App $a, &$b) +function twitter_jot_nets(App $a, array &$jotnets_fields) { if (!local_user()) { return; } - $tw_post = PConfig::get(local_user(), 'twitter', 'post'); - if (intval($tw_post) == 1) { - $tw_defpost = PConfig::get(local_user(), 'twitter', 'post_by_default'); - $selected = ((intval($tw_defpost) == 1) ? ' checked="checked" ' : ''); - $b .= '
' . L10n::t('Currently connected to: ') . '' . $details->screen_name . '
@@ -359,6 +364,12 @@ function twitter_settings(App $a, &$s) ' . $details->description . 'Invalid Twitter info
+