Index: trunk/extensions/InterwikiIntegration/InterwikiIntegration.hooks.php |
— | — | @@ -350,6 +350,7 @@ |
351 | 351 | * Add newly watched articles to integration_watchlist |
352 | 352 | */ |
353 | 353 | public static function InterwikiIntegrationWatchArticleComplete( &$user, &$article ) { |
| 354 | + global $wgDBname; |
354 | 355 | $title = $article->getTitle(); |
355 | 356 | if ( $title->isTalkPage () ) { |
356 | 357 | $subjectNamespace = $title->getSubjectPage()->getNamespace(); |
— | — | @@ -362,17 +363,17 @@ |
363 | 364 | $dbw = wfGetDB( DB_MASTER ); |
364 | 365 | $dbw->insert( 'integration_watchlist', |
365 | 366 | array( |
366 | | - 'integration_wl_user' => $user->id, |
| 367 | + 'integration_wl_user' => $user->getId(), |
| 368 | + 'integration_wl_db' => $wgDBname, |
367 | 369 | 'integration_wl_namespace' => $subjectNamespace, |
368 | | - 'integration_wl_title' => $DBkey, |
369 | | - 'integration_wl_notificationtimestamp' => null |
| 370 | + 'integration_wl_title' => $DBkey |
370 | 371 | ) ); |
371 | 372 | $dbw->insert( 'integration_watchlist', |
372 | 373 | array( |
373 | | - 'integration_wl_user' => $this->id, |
| 374 | + 'integration_wl_user' => $user->getId(), |
| 375 | + 'integration_wl_db' => $wgDBname, |
374 | 376 | 'integration_wl_namespace' => $talkNamespace, |
375 | | - 'integration_wl_title' => $DBkey, |
376 | | - 'integration_wl_notificationtimestamp' => null |
| 377 | + 'integration_wl_title' => $DBkey |
377 | 378 | ) ); |
378 | 379 | return true; |
379 | 380 | } |
— | — | @@ -381,6 +382,7 @@ |
382 | 383 | * Remove newly unwatched articles from integration_watchlist |
383 | 384 | */ |
384 | 385 | public static function InterwikiIntegrationUnwatchArticleComplete ( &$user, &$article ) { |
| 386 | + global $wgDBname; |
385 | 387 | $title = $article->getTitle(); |
386 | 388 | if ( $title->isTalkPage () ) { |
387 | 389 | $subjectNamespace = $title->getSubjectPage()->getNamespace(); |
— | — | @@ -393,13 +395,15 @@ |
394 | 396 | $dbw = wfGetDB( DB_MASTER ); |
395 | 397 | $dbw->delete( 'integration_watchlist', |
396 | 398 | array( |
397 | | - 'integration_wl_user' => $user->id, |
| 399 | + 'integration_wl_user' => $user->getId(), |
| 400 | + 'integration_wl_db' => $wgDBname, |
398 | 401 | 'integration_wl_namespace' => $subjectNamespace, |
399 | 402 | 'integration_wl_title' => $DBkey |
400 | 403 | ) ); |
401 | | - $dbw->insert( 'integration_watchlist', |
| 404 | + $dbw->delete( 'integration_watchlist', |
402 | 405 | array( |
403 | | - 'integration_wl_user' => $this->id, |
| 406 | + 'integration_wl_user' => $user->getId(), |
| 407 | + 'integration_wl_db' => $wgDBname, |
404 | 408 | 'integration_wl_namespace' => $talkNamespace, |
405 | 409 | 'integration_wl_title' => $DBkey |
406 | 410 | ) ); |