X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FTwitterBridge%2FTwitterBridgePlugin.php;h=5bf63a394674ac8a18114bfbd7adb9d349d5b46c;hb=d2c7c836155dd11a52256d0db32234993cdf4b8b;hp=72c28d4fa45eb4dfc4eefbaa1528cc357bf9055e;hpb=983fd75ec9ce254423f8a2b10c4c0467d78d6869;p=quix0rs-gnu-social.git diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php index 72c28d4fa4..5bf63a3946 100644 --- a/plugins/TwitterBridge/TwitterBridgePlugin.php +++ b/plugins/TwitterBridge/TwitterBridgePlugin.php @@ -301,7 +301,7 @@ class TwitterBridgePlugin extends Plugin 'name' => 'TwitterBridge', 'version' => self::VERSION, 'author' => 'Zach Copley, Julien C, Jean Baptiste Favre', - 'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/TwitterBridge', // TRANS: Plugin description. 'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' . 'of a StatusNet instance with ' . @@ -323,31 +323,6 @@ class TwitterBridgePlugin extends Plugin return (bool)$this->adminImportControl; } - /** - * When the site is set to ssl=sometimes mode, we should make sure our - * various auth-related pages are on SSL to keep things looking happy. - * Although we're not submitting passwords directly, we do link out to - * an authentication source and it's a lot happier if we've got some - * protection against MitM. - * - * @param string $action name - * @param boolean $ssl outval to force SSL - * @return mixed hook return value - */ - function onSensitiveAction($action, &$ssl) - { - $sensitive = array('twitteradminpanel', - 'twittersettings', - 'twitterauthorization', - 'twitterlogin'); - if (in_array($action, $sensitive)) { - $ssl = true; - return false; - } else { - return true; - } - } - /** * Database schema setup * @@ -595,4 +570,28 @@ class TwitterBridgePlugin extends Plugin return true; } + + /** + * Set the object_type field of previously imported Twitter notices to + * ActivityObject::NOTE if they are unset. Null object_type caused a notice + * not to show on the timeline. + */ + public function onEndUpgrade() + { + printfnq("Ensuring all Twitter notices have an object_type..."); + + $notice = new Notice(); + $notice->whereAdd("source='twitter'"); + $notice->whereAdd('object_type IS NULL'); + + if ($notice->find()) { + while ($notice->fetch()) { + $orig = Notice::getKV('id', $notice->id); + $notice->object_type = ActivityObject::NOTE; + $notice->update($orig); + } + } + + printfnq("DONE.\n"); + } }