X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSubMirror%2Fclasses%2FSubMirror.php;h=b39af918d5ddb2e073199c07a373ab190e77de75;hb=c97048d01bea468e0cf8865b60c3c250b4515c39;hp=4e7e005db261d637742711074151113c9b6c1747;hpb=10f72f62af400f9b0edc6bc8a3f6a850395e3699;p=quix0rs-gnu-social.git diff --git a/plugins/SubMirror/classes/SubMirror.php b/plugins/SubMirror/classes/SubMirror.php index 4e7e005db2..b39af918d5 100644 --- a/plugins/SubMirror/classes/SubMirror.php +++ b/plugins/SubMirror/classes/SubMirror.php @@ -76,6 +76,22 @@ class SubMirror extends Memcached_DataObject null, false)); } + /** + * Temporary hack to set up the compound index, since we can't do + * it yet through regular Schema interface. (Coming for 1.0...) + * + * @param Schema $schema + * @return void + */ + static function fixIndexes($schema) + { + try { + $schema->createIndex('submirror', array('subscribed', 'subscriber')); + } catch (Exception $e) { + common_log(LOG_ERR, __METHOD__ . ': ' . $e->getMessage()); + } + } + /** * return key definitions for DB_DataObject * @@ -129,7 +145,7 @@ class SubMirror extends Memcached_DataObject $mirror->created = common_sql_now(); $mirror->modified = common_sql_now(); $mirror->insert(); - + return $mirror; } @@ -157,7 +173,7 @@ class SubMirror extends Memcached_DataObject * This retains attribution within the site, and other nice things, * but currently ends up looking like 'RT @foobar bla bla' when * bridged out over OStatus or TwitterBridge. - * + * * @param Notice $notice * @return mixed Notice on successful repeat, true if already repeated, false on failure */ @@ -176,7 +192,7 @@ class SubMirror extends Memcached_DataObject * Mirror a notice by emitting a new notice with the same contents. * Kind of dirty, but if pulling an external data feed into an account * that may be what you want. - * + * * @param Notice $notice * @return mixed Notice on successful repeat, true if already repeated, false on failure */ @@ -200,7 +216,7 @@ class SubMirror extends Memcached_DataObject /** * Get the mirroring setting for a pair of profiles, if existing. - * + * * @param Profile $subscriber * @param Profile $subscribed * @return mixed Profile or empty