Index: trunk/extensions/LiquidThreads/classes/LqtNewMessages.php |
— | — | @@ -45,15 +45,6 @@ |
46 | 46 | |
47 | 47 | wfDebugLog( 'LiquidThreads', 'Doing notifications' ); |
48 | 48 | |
49 | | - if ( $t->article()->getTitle()->getNamespace() == NS_USER ) { |
50 | | - $name = $t->article()->getTitle()->getDBkey(); |
51 | | - list( $name ) = split( '/', $name ); // subpages |
52 | | - $user = User::newFromName( $name ); |
53 | | - if ( $user && $user->getID() != $changeUser->getID() ) { |
54 | | - $user->setNewtalk( true ); |
55 | | - } |
56 | | - } |
57 | | - |
58 | 49 | $dbw =& wfGetDB( DB_MASTER ); |
59 | 50 | |
60 | 51 | $talkpage_t = $t->article()->getTitle()->getSubjectPage(); |
— | — | @@ -126,6 +117,28 @@ |
127 | 118 | // Avoids duplicates |
128 | 119 | $update_tuples = array_values( $update_tuples ); |
129 | 120 | |
| 121 | + // Add user talk notification |
| 122 | + if ( $t->article()->getTitle()->getNamespace() == NS_USER_TALK ) { |
| 123 | + $name = $t->article()->getTitle()->getText(); |
| 124 | + |
| 125 | + $user = User::newFromName( $name ); |
| 126 | + if ( $user ) { |
| 127 | + $user->setNewtalk( true ); |
| 128 | + |
| 129 | + $dbw->replace( 'user_message_state', |
| 130 | + array( array( 'ums_user', 'ums_thread' ) ), |
| 131 | + array( 'ums_user' => $user->getId(), |
| 132 | + 'ums_thread' => $t->id(), |
| 133 | + 'ums_read_timestamp' => null ), |
| 134 | + __METHOD__ ); |
| 135 | + |
| 136 | + if ( $user->getOption( 'enotifusertalkpages' ) ) { |
| 137 | + $notify_users[] = $user->getId(); |
| 138 | + } |
| 139 | + } |
| 140 | + |
| 141 | + } |
| 142 | + |
130 | 143 | // Do the actual updates |
131 | 144 | if ( count($insert_rows) ) { |
132 | 145 | $dbw->insert( 'user_message_state', $insert_rows, __METHOD__, array( 'IGNORE' ) ); |