]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
TwitterBridge: Add $notice->verb on import
authorChimo <chimo@chromic.org>
Tue, 27 Oct 2015 14:12:33 +0000 (10:12 -0400)
committerChimo <chimo@chromic.org>
Tue, 27 Oct 2015 14:12:33 +0000 (10:12 -0400)
Since /plugins/ActivityModeration::onStartNotieSave expects it to be there when calling ActivityUtils::compareVerbs. Otherwise, the following exception is unhandled:

2015-10-26 15:33:03 LOG_ERR: [sn.chromic.org:queuedaemon.php:25931] Unhandled exception: No URI to resolve in ActivityUtils::resolveUri
 #0 /lib/activityutils.php(353): ActivityUtils::resolveUri(NULL)
 #1 /lib/activityutils.php(364): ActivityUtils::compareTypes(NULL, Array)
 #2 /plugins/ActivityModeration/ActivityModerationPlugin.php(113): ActivityUtils::compareVerbs(NULL, Array)
 #3 [internal function]: ActivityModerationPlugin->onStartNoticeSave(Object(Notice))
 #4 /lib/event.php(105): call_user_func_array(Array, Array)
 #5 /plugins/TwitterBridge/lib/twitterimport.php(173): Event::handle('StartNoticeSave', Array)
 #6 /plugins/TwitterBridge/lib/twitterimport.php(72): TwitterImport->saveStatus(Object(stdClass))
 #7 /plugins/TwitterBridge/lib/tweetinqueuehandler.php(52): TwitterImport->importStatus(Object(stdClass))
 #8 /lib/dbqueuemanager.php(94): TweetInQueueHandler->handle(Array)
 #9 /lib/iomaster.php(287): DBQueueManager->poll()
 #10 /lib/iomaster.php(161): IoMaster->poll()
 #11 /scripts/queuedaemon.php(111): IoMaster->service()
 #12 /lib/spawningdaemon.php(189): QueueDaemon->runThread()
 #13 /lib/spawningdaemon.php(118): SpawningDaemon->initAndRunChild(2)
 #14 /lib/daemon.php(168): SpawningDaemon->run()
 #15 /scripts/queuedaemon.php(181): Daemon->runOnce()
 #16 {main}

plugins/TwitterBridge/lib/twitterimport.php

index d929fecf83291deff3b5b218cce37a1e1c7485a1..9abc022fd8dc04b3ac893a7da3cf5372daa411d4 100644 (file)
@@ -138,6 +138,7 @@ class TwitterImport
         $notice->profile_id = $profile->id;
         $notice->uri        = $statusUri;
         $notice->url        = $statusUri;
+        $notice->verb       = ActivityVerb::POST;
         $notice->created    = strftime(
             '%Y-%m-%d %H:%M:%S',
             strtotime($status->created_at)