Index: trunk/phase3/includes/specials/SpecialUserrights.php |
— | — | @@ -154,6 +154,7 @@ |
155 | 155 | $removegroup[] = $group; |
156 | 156 | } |
157 | 157 | } |
| 158 | + |
158 | 159 | $this->doSaveUserGroups( $user, $addgroup, $removegroup, $reason ); |
159 | 160 | } |
160 | 161 | |
— | — | @@ -172,7 +173,7 @@ |
173 | 174 | // Validate input set... |
174 | 175 | $isself = ($user->getName() == $wgUser->getName()); |
175 | 176 | $groups = $user->getGroups(); |
176 | | - $changeable = $wgUser->changeableGroups(); |
| 177 | + $changeable = $this->changeableGroups(); |
177 | 178 | $addable = array_merge( $changeable['add'], $isself ? $changeable['add-self'] : array() ); |
178 | 179 | $removable = array_merge( $changeable['remove'], $isself ? $changeable['remove-self'] : array() ); |
179 | 180 | |
Index: trunk/extensions/LiquidThreads/classes/LqtNewMessages.php |
— | — | @@ -94,11 +94,7 @@ |
95 | 95 | if ( $changeUser->getId() == $row->wl_user ) |
96 | 96 | continue; |
97 | 97 | |
98 | | - if ( $row->ums_read_timestamp ) { |
99 | | - $conds = array( 'ums_user' => $row->ums_user, |
100 | | - 'ums_thread' => $t->id() ); |
101 | | - $update_tuples[$row->ums_user.$t->id()] = $dbw->makeList( $conds, LIST_AND ); |
102 | | - } elseif ( $row->ums_user ) { |
| 98 | + if ( $row->ums_user && !$row->ums_read_timestamp ) { |
103 | 99 | // It's already positive. |
104 | 100 | } else { |
105 | 101 | $insert_rows[] = |
— | — | @@ -114,9 +110,6 @@ |
115 | 111 | } |
116 | 112 | } |
117 | 113 | |
118 | | - // Avoids duplicates |
119 | | - $update_tuples = array_values( $update_tuples ); |
120 | | - |
121 | 114 | // Add user talk notification |
122 | 115 | if ( $t->article()->getTitle()->getNamespace() == NS_USER_TALK ) { |
123 | 116 | $name = $t->article()->getTitle()->getText(); |
— | — | @@ -125,12 +118,9 @@ |
126 | 119 | if ( $user ) { |
127 | 120 | $user->setNewtalk( true ); |
128 | 121 | |
129 | | - $dbw->replace( 'user_message_state', |
130 | | - array( array( 'ums_user', 'ums_thread' ) ), |
131 | | - array( 'ums_user' => $user->getId(), |
| 122 | + $insert_rows[] = array( 'ums_user' => $user->getId(), |
132 | 123 | 'ums_thread' => $t->id(), |
133 | | - 'ums_read_timestamp' => null ), |
134 | | - __METHOD__ ); |
| 124 | + 'ums_read_timestamp' => null ); |
135 | 125 | |
136 | 126 | if ( $user->getOption( 'enotifusertalkpages' ) ) { |
137 | 127 | $notify_users[] = $user->getId(); |
— | — | @@ -141,14 +131,9 @@ |
142 | 132 | |
143 | 133 | // Do the actual updates |
144 | 134 | if ( count($insert_rows) ) { |
145 | | - $dbw->insert( 'user_message_state', $insert_rows, __METHOD__, array( 'IGNORE' ) ); |
| 135 | + $dbw->replace( 'user_message_state', array( array( 'ums_user', 'ums_thread' ) ), |
| 136 | + $insert_rows, __METHOD__ ); |
146 | 137 | } |
147 | | - if ( count($update_tuples) ) { |
148 | | - $where = $dbw->makeList( $update_tuples, LIST_OR ); |
149 | | - |
150 | | - $dbw->update( 'user_message_state', array( 'ums_read_timestamp' => null ), |
151 | | - array($where), __METHOD__ ); |
152 | | - } |
153 | 138 | |
154 | 139 | if ( count($notify_users) ) { |
155 | 140 | self::notifyUsersByMail( $t, $notify_users, wfTimestampNow(), $type ); |