Index: trunk/extensions/SemanticWatchlist/includes/SWL_Group.php |
— | — | @@ -421,6 +421,19 @@ |
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
| 425 | + * Removethe non covered properties. |
| 426 | + * |
| 427 | + * @since 0.1 |
| 428 | + * |
| 429 | + * @param SWLChangeSet $changes |
| 430 | + * |
| 431 | + * @return SWLChangeSet |
| 432 | + */ |
| 433 | + public function removeNonCoveredChanges( SWLChangeSet &$changes ) { |
| 434 | + $changes->filterOnProperties( $this->getProperties() ); |
| 435 | + } |
| 436 | + |
| 437 | + /** |
425 | 438 | * Gets all the watching users and passes them, together with the specified |
426 | 439 | * changes and the group object itself, to the SWLGroupNotify hook. |
427 | 440 | * |
— | — | @@ -431,7 +444,11 @@ |
432 | 445 | public function notifyWatchingUsers( SWLChangeSet $changes ) { |
433 | 446 | $users = $this->getWatchingUsers(); |
434 | 447 | |
435 | | - wfRunHooks( 'SWLGroupNotify', array( $this, $users, $changes ) ); |
| 448 | + $this->removeNonCoveredChanges( $changes ); |
| 449 | + |
| 450 | + if ( $changes->hasChanges( true ) ) { |
| 451 | + wfRunHooks( 'SWLGroupNotify', array( $this, $users, $changes ) ); |
| 452 | + } |
436 | 453 | } |
437 | 454 | |
438 | 455 | } |
Index: trunk/extensions/SemanticWatchlist/includes/SWL_ChangeSet.php |
— | — | @@ -363,4 +363,19 @@ |
364 | 364 | return $this->time; |
365 | 365 | } |
366 | 366 | |
| 367 | + /** |
| 368 | + * Remove changes to properties not in the porvided list. |
| 369 | + * |
| 370 | + * @since 0.1 |
| 371 | + * |
| 372 | + * @param array $properties List of property names |
| 373 | + */ |
| 374 | + public function filterOnProperties( array $properties ) { |
| 375 | + foreach ( $this->getAllProperties() as /* SMWDIProperty */ $property ) { |
| 376 | + if ( !in_array( $property->getSerialization(), $properties ) ) { |
| 377 | + $this->changeSet->removeChangesForProperty( $property ); |
| 378 | + } |
| 379 | + } |
| 380 | + } |
| 381 | + |
367 | 382 | } |
\ No newline at end of file |